[starlogo-users] patch and global variables...
Ken Kahn
toontalk at googlemail.com
Mon Mar 12 04:12:07 EDT 2007
Hi.
Your patch variable example points to a shortcoming with the concept of
patches. If indeed only a few patches are poisoned then why not keep a
global variable listing the coordinates of the poisoned patches and check
for membership. The check may take a few extra nanoseconds but you don't
waste 10,000 memory locations.
I'm glad to hear that "Patches are a less active part of StarLogo TNG" since
I dislike the idea of having something that are really agents but they can't
move. It just complicates the computation model. There can be an efficiency
argument for low-level support of non-mobile agents but I think it is often
less efficient to support patches -- e.g. the poison example. Also it pushes
one's model towards a uniform rectangular grid while there are plenty of
other ways to model the environment. Maybe poison is spread out over circles
of radius 10 while other variables are at different patch sizes. Patches are
too special purpose to be part of a language.
Best,
-ken
On 11/03/07, Eric Klopfer <klopfer at mit.edu> wrote:
>
> Patches are a less active part of StarLogo TNG than they were in
> StarLogo 2. But the patches are an underlying grid on which the
> Agents walk. You can see the patches when the Agents walk around
> with their pens down and the different squares get colored. In
> addition to each patch being able to have a height and color (which
> the agents can change by stamping, stomping, yanking, etc.) the patch
> can also contain arbitrary variables defined by the user. So on the
> 100x100 grid there would be 10,000 copies of that variable.
>
> So one could define a "poison?" boolean variable for each patch and
> set it to true for a few patches (you'd have to create an agent to go
> to those patches and set that value). Then when an agent landed on a
> patch it could check to see if the poison? value were true and if so
> die.
>
> You are right on your guess for the right hand slot. It is supposed
> to be an optional initialization value. That option is somewhat buggy
> (when it is initialized) in preview 3, but should be fixed in Beta 1
> so that it is initialized when the agent is created.
>
> Eric
>
> On Mar 11, 2007, at 6:09 PM, josh wrote:
>
> > Hi,
> >
> > I hope these aren't faqs, but I sure couldn't find any answers:
> >
> > could somebody please tell me what the heck a "patch variable" is?
> > (the
> > description in the docs makes it sound identical to an agent
> > variable.)
> >
> > Also, the variable declarations themselves have an end slot to take an
> > argument. Can I use this to initialize the variable, or why can I plug
> > in a number to the end of the var. declaration block?
> >
> > Thanks in advance for help!
> >
> > -j
> > _______________________________________________
> > starlogo-users mailing list
> > starlogo-users at media.mit.edu
> > http://education.mit.edu/mailman/listinfo/starlogo-users
>
> _______________________________________________
> starlogo-users mailing list
> starlogo-users at media.mit.edu
> http://education.mit.edu/mailman/listinfo/starlogo-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://education.mit.edu/pipermail/starlogo-users/attachments/20070312/98c22349/attachment-0001.html
More information about the starlogo-users
mailing list