Here are two lines of code that you could try:
ask n-of 50 patches[sprout random 5[] ]
ask turtle 0 [let destination_patch one-of patches with[count turtles-here = 2 ] face destination_patch jump distance destination_patch]
The purpose of the first line of code is just to set up a situation
The second line of code does the task in three steps: first, pick the patch with specific number of turtles; second, turn so that heading is in direction of the destination patch; third, move to patch using jump command
On Wed, Mar 19, 2008 at 1:56 AM, benjaminha
nowell < benjaminhanowell
yahoo.com">benjaminhanowell
yahoo.com> wrote:
Does anybody have any code for asking an individual turtle or breed of
turtles search for a patch with a specified number turtles on it and
going there in the span of one time step?
Should I just create a loop where the turtle moves randomly until it
comes across a patch with the specified number of turtles on it? That
seems like it might make my run-time a lot slower, but that's what I
can think of with my very limited knowledge of NetLogo syntax.
Thanks!
.