Lattice-Walking Turtles Example
Model was written in NetLogo 5.0.4
•
Viewed 619 times
•
Downloaded 92 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 [nodes node] breed [walkers walker] walkers-own [location] ;; holds a node to setup clear-all set-default-shape nodes "hex" ;; create a hex grid of nodes ask patches [ sprout-nodes 1 [ set color gray - 3.5 ;; dark gray set size 1.2 ;; shift even columns down if pxcor mod 2 = 0 [ set ycor ycor - 0.5 ] ] ] ;; connect the nodes to make a lattice ask nodes [ ifelse pxcor mod 2 = 0 [ create-links-with nodes-on patches at-points [[0 1] [1 0] [1 -1]] ] [ create-links-with nodes-on patches at-points [[0 1] [1 1] [1 0]] ] ] ask links [ hide-link ] ;; put some "walker" turtles on the lattice create-walkers 20 [ set color red set location one-of nodes move-to location ] reset-ticks end to go ask walkers [ set-location one-of [link-neighbors] of location ] tick end to set-location [new-location] ;; walker procedure set location new-location face new-location ;; not strictly necessary, but improves the visuals a bit move-to new-location 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 | |
---|---|---|---|---|
Lattice-Walking Turtles Example.png | preview | Preview for 'Lattice-Walking Turtles Example' | over 11 years ago, by Uri Wilensky | Download |
This model does not have any ancestors.
This model does not have any descendants.