Hex Cells Example
Model was written in NetLogo 5.0.4
•
Viewed 690 times
•
Downloaded 88 times
•
Run 1 time
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
breed [ cells cell ] cells-own [ hex-neighbors ;; agentset of 6 neighboring cells n ;; used to store a count of white neighbors ] to setup1 clear-all setup-grid ;; make the center hexagon white, as the "seed" from which we ;; grow our "snowflake" ask patch 0 0 [ ask cells-here [ set color white ] ] reset-ticks end to setup2 clear-all setup-grid ;; make two center hexagons white, as the "seed" from which we ;; grow our "snowflake" ask patches at-points [[0 0] [1 0]] [ ask cells-here [ set color white ] ] reset-ticks end to setup-grid set-default-shape cells "hex" ask patches [ sprout-cells 1 [ set color gray - 3 ;; dark gray ;; shift even columns down if pxcor mod 2 = 0 [ set ycor ycor - 0.5 ] ] ] ;; now set up the hex-neighbors agentsets ask cells [ ifelse pxcor mod 2 = 0 [ set hex-neighbors cells-on patches at-points [[0 1] [1 0] [1 -1] [0 -1] [-1 -1] [-1 0]] ] [ set hex-neighbors cells-on patches at-points [[0 1] [1 1] [1 0] [0 -1] [-1 0] [-1 1]] ] ] end to go ;; these are example cellular automaton rules; they produce ;; a snowflake-like pattern ask cells [ set n count hex-neighbors with [color = white] ] ask cells [ if n = 1 [ set color white ] ] tick end ; Public Domain: ; To the extent possible under law, Uri Wilensky has waived all ; copyright and related or neighboring rights to this model.
There are 10 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Hex Cells Example.png | preview | Preview for 'Hex Cells Example' | over 11 years ago, by Uri Wilensky | Download |
This model does not have any ancestors.
This model does not have any descendants.