Sample Inheritance with Tendency

Sample Inheritance with Tendency preview image

1 collaborator

Larry_bencivengo Larry Bencivengo (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.2.0 • Viewed 252 times • Downloaded 31 times • Run 0 times
Download the 'Sample Inheritance with Tendency' modelDownload this modelEmbed this model

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


WHAT IS IT?

smaples of how to create heritable variation and to use a slider to set a "tendency" for behavior.

HOW IT WORKS

inheritance: uses "hatch" and " of myself" to pass on a trait to offspring (+/- random #). tendency: uses slider to set the "tendency", then an "ifelse tendency < 0" to choose between different behaviors

HOW TO USE IT

Click 'setup' to create some kings. Click 'go' to get one random king to "hatch" an offspring that will tend to be either bigger or smaller, depending on the value of "size-preference". Every time you click 'go', one more king will hatch. Use the "size-preference" slider to change the tendency for the kings to grow larger or smaller.

THINGS TO NOTICE

Kings inherit the size of their parent, plus or minus a random amount. Changing the "size-preference" slider makes it more likely for kings to get bigger or smaller.

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

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

Click to Run Model

to setup            ;; create gray 5 kings of size 5
  clear-all
  ask patches [set pcolor white]
  create-turtles 10 [set shape "chess king" set size 5 set color gray fd random 5]
end 

to go               ;; hatch a new king that inherits its parent's size, plus or minus a random amount
  if size-preference < 0 
    [ask one-of turtles [hatch 1 [set size [size] of myself + random (size-preference - 1) set color random 390 fd random 3 + 1]]]
  if size-preference = 0 
    [ask one-of turtles [hatch 1 [set size [size] of myself set color random 390 fd random 3 + 1]]]
  if size-preference > 0 
    [ask one-of turtles [hatch 1 [set size [size] of myself + random (size-preference + 1) set color random 390 fd random 3 + 1]]]    
end 

There is only one version of this model, created over 8 years ago by Larry Bencivengo.

Attached files

File Type Description Last updated
Sample Inheritance with Tendency.png preview Preview for 'Sample Inheritance with Tendency' over 8 years ago, by Larry Bencivengo Download

This model does not have any ancestors.

This model does not have any descendants.