elge.examples.simple
Class SimpleWorld
java.lang.Object
|
+--elge.agent.Agent
|
+--elge.agent.AgentContainer
|
+--elge.world.World
|
+--elge.world.World2D
|
+--elge.examples.simple.SimpleWorld
- All Implemented Interfaces:
- EventListener, PropertyChangeListener, WorldRules
- public class SimpleWorld
- extends World2D
- implements PropertyChangeListener
This world provides simplestes functionality for simple Agent.
- Author:
- Palino
Constructor Summary |
SimpleWorld()
Creates a new instance of SimpleWorld |
Methods inherited from class elge.world.World |
add, addPropertyChangeListener, getAgentCycle, getAnswer_addAgent, getAnswer_delAgent, getAnswer_rndPosition, getAnswer_sense, getDimension, getDisplay, getRemoveAgent, getRepresentation, getTick, isPaintable, paint, remove, removePropertyChangeListener, sense, setAgentCycle, setDimension, setDisplay, setRemoveAgent, setRepresentation, setTick |
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 |
agentChooseTypes
public static final String[] agentChooseTypes
gameAgents
protected Vector gameAgents
agentChoose
protected ComboInteger agentChoose
SimpleWorld
public SimpleWorld()
- Creates a new instance of SimpleWorld
init
public void init()
- Description copied from class:
Agent
- This method performs initializing of the agent. This method is called every time
agent is added to the world or when the init of the world is called.
- Overrides:
init
in class World
createSense
public String createSense()
fillGameAgents
public void fillGameAgents()
createSituationForAgent
public Situation createSituationForAgent(Agent agent,
Object params)
- Overrides:
createSituationForAgent
in class World
life
public void life()
- Description copied from class:
AgentContainer
- 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).
- Overrides:
life
in class World
launchLanguageGame
public void launchLanguageGame()
chooseAgent
public GameAgent chooseAgent()
chooseSecondAgent
public GameAgent chooseSecondAgent(GameAgent first)
getLastGameCount
public int getLastGameCount()
getLastSucGameCount
public int getLastSucGameCount()
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- This method gets called when a bound property is changed.
- Specified by:
propertyChange
in interface PropertyChangeListener
- Overrides:
propertyChange
in class World
- Parameters:
evt
- A PropertyChangeEvent object describing the event source
and the property that has changed.
setSAgentChoose
public void setSAgentChoose(ComboInteger ci)
getSAgentChoose
public ComboInteger getSAgentChoose()
restart
public void restart()
- Description copied from class:
World
- Restarts the world, zeros tick counter, removes agents or restart
them...
- Overrides:
restart
in class World
getGameAgents
public Vector getGameAgents()
- Returns a vector of agents that can be choose to play the language game.