Life Benchmark
No preview image
Model was written in NetLogo 4.1pre9
•
Viewed 173 times
•
Downloaded 31 times
•
Run 0 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
globals [result] patches-own [ living? ;; indicates if the cell is living live-neighbors ;; counts how many neighboring cells are alive ] to benchmark random-seed 22 reset-timer setup-random repeat 500 [ go ] set result timer end to benchmark-__life random-seed 22 reset-timer setup-random repeat 500 [ __life ] set result timer end to setup-random clear-all ask patches [ ifelse random-float 1.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
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.