List Info

Thread: number of turtles on them and go there




number of turtles on them and go there
country flaguser name
United States
2008-03-19 17:13:55

Thanks, I'll test it out!

--- In netlogo-users%40yahoogroups.com">netlogo-usersyahoogroups.com, "Kristy Martin"
<kristymartin2005...> wrote:
&gt;
> 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
&gt; 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, benjaminhanowell <
>; benjaminhanowell...> wrote:
&gt;
> > 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?
&gt; >
>; > 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!
> >
>; >
> >
>;

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )