|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--elge.agent.Agent | +--elge.agent.AgentContainer | +--elge.world.World
Class Basic world should define the rules, how it should work in the World. How to hold info about ancestor and provide them an enviroment. Every World consists of some elements, like monitors :). So, we should make them here.
Field Summary | |
static String[] |
agentCycleTypes
|
static String |
ASK_RND_POSITION
|
static String |
PROP_REPRESENTATION
|
static String[] |
removeAgentsTypes
|
static String |
RESULT_GENERATED_POSITION
|
Fields inherited from class elge.agent.AgentContainer |
agents, innerAgency |
Fields inherited from class elge.agent.Agent |
actualSituation, agency, agencyClass, agentClassCounter, id, name, registered |
Fields inherited from interface elge.world.WorldRules |
LIFE_TICK, RESULT, SENSE_ALL_AGENTS, SENSE_VECTOR_VIEW, SENSE_VIEW, STD_ADDAGENT, STD_DELAGENT |
Constructor Summary | |
World()
Creates a new instance of BasicWorld |
Method Summary | |
void |
add(Agent a)
adds an agent to the system and sets it the agency. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
Situation |
createSituationForAgent(Agent agent,
Object params)
|
ComboInteger |
getAgentCycle()
|
Situation |
getAnswer_addAgent(Agent agent,
Object params)
This should be a method, wich can add new agents to the system. |
Situation |
getAnswer_delAgent(Agent agent,
Object params)
This should remove the agent from the system... |
Situation |
getAnswer_rndPosition(Agent agent,
Object params)
This calls the AgentRepresentation object to generate a new position.. |
Situation |
getAnswer_sense(Agent agent,
Object params)
monitors - all monitors registred in the world |
Dimension |
getDimension()
|
WorldDisplay |
getDisplay()
|
ComboInteger |
getRemoveAgent()
|
AgentRepresentation |
getRepresentation()
|
int |
getTick()
|
void |
init()
This method performs initializing of the agent. |
boolean |
isPaintable()
|
void |
life()
The life cycle of the AgentContainer is different, because it should handle the angents it sonsist of, and not himeself (but yo may want to do this anyway). |
void |
paint(Graphics gfx)
|
void |
propertyChange(PropertyChangeEvent evt)
This method gets called when a bound property is changed. |
void |
remove(Agent a)
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
restart()
Restarts the world, zeros tick counter, removes agents or restart them... |
void |
sense()
First method for the agent life cycle. |
void |
setAgentCycle(ComboInteger ci)
|
void |
setDimension(Dimension d)
|
void |
setDisplay(WorldDisplay wd)
|
void |
setRemoveAgent(ComboInteger ci)
|
void |
setRepresentation(AgentRepresentation wr)
|
void |
setTick(int tickCount)
|
Methods inherited from class elge.agent.AgentContainer |
add, add, agentsLife, del, getAgentCount, getAgents, setAgents |
Methods inherited from class elge.agent.Agent |
ask, ask, ask, createDefaultAgency, createUniqueID, getAgency, getFullName, getID, getName, chooseAction, life, memorize, setAgency, setAgency, setAgency, setID, setName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String PROP_REPRESENTATION
public static final String RESULT_GENERATED_POSITION
public static final String ASK_RND_POSITION
public static final String[] agentCycleTypes
public static final String[] removeAgentsTypes
Constructor Detail |
public World()
Method Detail |
public void addPropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void add(Agent a)
AgentContainer
add
in class AgentContainer
a
- agent to addpublic void remove(Agent a)
public Situation getAnswer_sense(Agent agent, Object params)
public void sense()
Agent
sense
in class Agent
public Situation createSituationForAgent(Agent agent, Object params)
public final Situation getAnswer_addAgent(Agent agent, Object params)
public final Situation getAnswer_delAgent(Agent agent, Object params)
public final Situation getAnswer_rndPosition(Agent agent, Object params)
public void paint(Graphics gfx)
public boolean isPaintable()
public void init()
Agent
init
in class Agent
public void restart()
restart
in class Agent
public void life()
AgentContainer
life
in class AgentContainer
public void setRepresentation(AgentRepresentation wr)
public AgentRepresentation getRepresentation()
public void setDisplay(WorldDisplay wd)
public WorldDisplay getDisplay()
public void setDimension(Dimension d)
public Dimension getDimension()
public int getTick()
public void setTick(int tickCount)
public void setAgentCycle(ComboInteger ci)
public ComboInteger getAgentCycle()
public void setRemoveAgent(ComboInteger ci)
public ComboInteger getRemoveAgent()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
evt
- A PropertyChangeEvent object describing the event source
and the property that has changed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |