|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.sc.ants.Environment.RunningThingContainer
Contains all the running things (i.e. agents) objects, their threads, and messages (mbox)
Field Summary | |
(package private) int |
currentID
Each agent gets a currentID taken from this variable. |
(package private) java.util.Vector |
runningThings
Contains all the running things |
Constructor Summary | |
(package private) |
Environment.RunningThingContainer()
|
Method Summary | |
void |
addAgent(Environment e,
int x,
int y,
double h,
java.lang.String type)
Create a new agent and add it to the environment |
boolean |
deleteAgent(int id)
Delete an agent with the given ID. |
boolean |
deleteAgent(java.lang.String type)
Delete the agent that was last picked. |
(package private) Environment.RunningThing |
getAgent(int agentID)
Look for an agent. |
(package private) Observation |
getAgentLocation(int agentID)
Look for an agent. |
(package private) Observation |
getAgentLocationCopy(int agentID)
Look for an agent. |
java.util.Vector |
getCloseAgents(int agentID,
double range)
Get all the agents that are close to agentID, including itself |
java.util.Vector |
getCloseRunningThings(int agentID,
double range)
Get all the agents that are close to agentID, not including agentID |
int |
getCurrentID()
Get the value of currentID. |
(package private) Message |
getMessage(int agentID)
Get the message of the given agent |
java.util.Vector |
getRunningThings()
Get the value of runningThings. |
void |
setCurrentID(int v)
Set the value of currentID. |
void |
setRunningThings(java.util.Vector v)
Set the value of runningThings. |
Methods inherited from class java.lang.Object |
|
Field Detail |
java.util.Vector runningThings
int currentID
Constructor Detail |
Environment.RunningThingContainer()
Method Detail |
public java.util.Vector getRunningThings()
public void setRunningThings(java.util.Vector v)
v
- Value to assign to runningThings.public int getCurrentID()
public void setCurrentID(int v)
v
- Value to assign to currentID.public void addAgent(Environment e, int x, int y, double h, java.lang.String type)
public boolean deleteAgent(java.lang.String type)
type
- the type of the agent to be deletedpublic boolean deleteAgent(int id)
id
- of the agent we want to delete.Environment.RunningThing getAgent(int agentID)
agentID
- the ID of the agent to look for.Message getMessage(int agentID)
Observation getAgentLocation(int agentID)
agentID
- the ID of the agent to look for.Observation getAgentLocationCopy(int agentID)
agentID
- the ID of the agent to look for.public java.util.Vector getCloseRunningThings(int agentID, double range)
agentID
- the agent in the middlerange
- the radius of the agent's radar.public java.util.Vector getCloseAgents(int agentID, double range)
agentID
- the agent in the middlerange
- the radius of the agent's radar.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |