NetLogo version NetLogo 4.0.4
Running with NetLogoLite.jar version 404.
NetLogo Version: NetLogo 4.0.4
;;;; SUMMARY ;; Distributing a number of evenly spread out turtles ;;;; Copyright & License ;; Copyright (C) 2006 James P. Steiner ;; You are granted a CC 2.5 by-nc-sa license to this model ;; ;; to distribute-turtles ca let side ceiling sqrt population ask patches with [ pxcor - min-pxcor < side and pycor - min-pycor < side ] [ sprout 1 [ set color 5 + who * 10 ] ] if (count turtles) > population [ ask n-of (count turtles - population) turtles [ die ] ] ask turtles [ let newx pxcor + ((pxcor - min-pxcor) * (spread - 1)) let newy pycor + ((pycor - min-pycor) * (spread - 1)) ifelse newx > max-pxcor or newy > max-pycor [ die ] [ setxy newx newy set size spread facexy 0 0 set shape "circle" ] ] tick end to orbit ask turtles [ if pxcor != 0 or pycor != 0 [ let d distancexy 0 0 facexy 0 0 rt 180 let h heading setxy 0 0 set heading heading + 5 / d ifelse can-move? d [ jump d ] [ die ] ] ] tick end
View or download the complete model file (to download: right-click, save-link-as):
-- Download distribute-turtles-grid_2009 --