Print

Print


It depends how you are updating the grid on which your agents are stored. If, after an agent moves, you are telling that agent to update its location in the grid, then when the next agent queries the grid it will reflect that other agent's new location. If, however, you are not updating the grid until all agents have acted, then the new locations will not be accessible until the next time step.

In netlogo terms, you can think of it as:

ask agents [
  do-stuff;
  move;
]

versus 

ask agents [ do-stuff ]
ask agents [move]


MASON does exactly what you tell it to do, when you tell it to do it. Not all objects are thread-safe though, so if you're updating something across multiple threads, you may want to synchronize your actions. 


On Wed, Feb 26, 2014 at 4:03 PM, Megan Olsen <[log in to unmask]> wrote:
Hi,

I have a question regarding bookkeeping in MASON in terms of the location of agents, which I didn't find a definitive answer to on the website.  

When I ask MASON for a bag of neighbors, is this the bag of neighbors based on a previous timestep, or does a neighbor who moved to my neighborhood during this timestep get included? (Since updates are done serially instead of actually parallelized)

For example, if I have a 2D grid of agents, say it looks like the one below:

xxxxxoxx
xxxxo*ox
xxx#xxxx

In my new time step, the # agent updates first:
xxxxxoxx
xxxxo*ox
xxxxx#xx

And now my * agent is updating second.  Will # count as being in *'s neighborhood, even though it moved there during the same timestep, so could be interpretted as "not yet there"?

Thanks,
Megan