Jimmy, multiple agents will not access the variable simultaneously
unless you have fired them in separate threads. In the standard
MASON distribution, this is only possible via ParallelSequence or
AsynchronousSteppable. So you'll need to be more specific about what
you mean here.
As to concurrent access control, Java does this like any other
multithreaded system. Create a lock variable that both agents have
access to -- perhaps an instance variable. An empty array works nicely:
Object lock = new Object;
Then later your agents access the variable of choice like this:
// do stuff with my variable
On Dec 25, 2006, at 3:28 PM, Jimmy Ong wrote:
> Merry Christmas to all!
> Can someone show me how do i prevent concurrent access to some
> between 2 or more agents? I tried to synchronize on state.schedule
> or an
> arbitrary object, but it doesn't work.
> Thanks in advance,