Genetic Inheritance

No preview image

This model is seeking new collaborators — would you please help?

1 collaborator


(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.1 • Viewed 56 times • Downloaded 6 times • Run 0 times
Download the 'Genetic Inheritance' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [ gene-list]


to setup
  create-turtles 20
  [ setxy random-xcor random-ycor
    set genes []
    set sex one-of ["Male" "Female"]
    if sex = "Male" [set color white]
    if sex = "Female" [set color red]
    repeat 5 [
      set genes lput one-of [1 2 ] genes  ]

  inspect one-of turtles

to go
  ask turtles [
    right random 90
    left random 90
    fd 1]

  ask turtles with [sex = "Male"] [
    let partner one-of turtles-here with [sex = "Female"] ; males initiate when they find a female partner
    if partner != nobody [
      let mother-genes [genes ] of partner ; the mom and dad's genes are remembered as two lists (mother-genes and father-genes)
      let father-genes genes
      hatch 1 [ ; make a baby
        set sex one-of ["Male" "Female"] ; randomly pick a sex for the new kid
        if sex = "Male" [set color blue] ; this recoloring is just so we know if they are second generation or not
        if sex = "Female" [set color green]
        set genes []
        let n 0 ; a placeholder that is increased each time the gene list is created
        repeat length mother-genes[ ; it walks through this command block once for each gene (1st, 2nd, etc.)
          set gene-list [] ; possible list of inheritable genes is reset
          set gene-list lput item n mother-genes gene-list ; inheritable genes could either be the mom or dads
          set gene-list lput item n father-genes gene-list
          set genes lput one-of gene-list genes ; the kids genes is increased by one by randomly picking one from the gene-list
          set n n + 1] ; ratchets up one to look at the nth + 1 gene in the list

  while [count turtles > 20] [ ; population control
    ask one-of turtles [

There is only one version of this model, created 10 months ago by Andrew Calinger-Yoak.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.