swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] setting flags for agents


From: Steve Railsback
Subject: Re: [Swarm-Support] setting flags for agents
Date: Mon, 25 Jun 2007 16:19:01 -0700
User-agent: Thunderbird 2.0.0.4 (Windows/20070604)

address@hidden wrote:
I am trying to give agents memory of where they have walked. To do this I am creating a flag in a class Cell (similar to HabitatCell in StupidModel). Currently, all agents can set and get this flag by:

Cell flags = (cell) cellWorld.getObjectAtX$Y(myX, myY);
flags.setFlag(num);
flags.getFlag(num);

As each agent walks through the Grid2dImpl space they change the flag from a 0 to one. The agents can then see where others have walked and not walk on those spaces. I do not want this feature. I would like the agents to set and get their own flags, which will allow them to only see where they have walked. Any suggestions on how to do this with Java Swarm 2.2.

One alternative is for each agent to keep a list of cells it has been in, as its "memory". The agent can check whether it has been to some cell simply by whether its list of previously-visited cells contains that cell.

Steve R.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]