BehaviorSpace Example
No preview image
Model was written in NetLogo 4.1RC2
•
Viewed 636 times
•
Downloaded 52 times
•
Run 4 times
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
patches-own [ living? ;; indicates if the cell is living live-neighbors ;; counts how many neighboring cells are alive ] to setup-blank reset-ticks ask patches [ cell-death ] end to setup-random reset-ticks ask patches [ ifelse random-float 100.0 < initial-density [ cell-birth ] [ cell-death ] ] end to cell-birth set living? true set pcolor fgcolor end to cell-death set living? false set pcolor bgcolor end to go if mouse-down? [ stop ] ;; wait for user to stop drawing ask patches [ set live-neighbors count neighbors with [living?] ] ;; Starting a new "ask patches" here ensures that all the patches ;; finish executing the first ask before any of them start executing ;; the second ask. This keeps all the patches in sync with each other, ;; so the births and deaths at each generation all happen in lockstep. ask patches [ ifelse live-neighbors = 3 [ cell-birth ] [ if live-neighbors != 2 [ cell-death ] ] ] tick end to add-cells if mouse-down? [ ask patch mouse-xcor mouse-ycor [ cell-birth ] ] display end to remove-cells if mouse-down? [ ask patch mouse-xcor mouse-ycor [ cell-death ] ] display end
There are 3 versions of this model.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.