[starlogo-users] patch and global variables...

Eric Klopfer klopfer at MIT.EDU
Sun Mar 11 18:41:05 EDT 2007


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



More information about the starlogo-users mailing list