Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

turtle setup with even spacing in xcor and ycor

Tags:

netlogo

I want to setup turtles in NetLogo that are evenly distributed from min-xcor to max-xcor every 1 patch. Currently, what is clear is that turtles can be created with random-xcor and random-ycor. Please help.

like image 596
user3265543 Avatar asked Feb 03 '14 11:02

user3265543


1 Answers

Try using sprout. sprout tells a patch to create a turtle directly on top of it. So, for example:

ask patches [ sprout 1 ]

will create exactly one turtle on every patch. You can use with to restrict the patches if you want do this in only part of the world:

ask patches with [ -6 < pxcor and pxcor < 10 ] [ sprout 1 ]

You can also include initialization code for the turtles just like you can with create-turtles and hatch:

ask patches [ sprout 1 [ set color red ] ]

like image 179
Bryan Head Avatar answered Oct 01 '22 05:10

Bryan Head