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

Field Summary
protected  ComboInteger agentChoose
           
static String[] agentChooseTypes
           
protected  Vector gameAgents
           
 
Fields inherited from class elge.world.World
agentCycleTypes, ASK_RND_POSITION, PROP_REPRESENTATION, removeAgentsTypes, 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
SimpleWorld()
          Creates a new instance of SimpleWorld
 
Method Summary
 String createSense()
           
 Situation createSituationForAgent(Agent agent, Object params)
           
 void fillGameAgents()
           
 Vector getGameAgents()
          Returns a vector of agents that can be choose to play the language game.
 int getLastGameCount()
           
 int getLastSucGameCount()
           
 ComboInteger getSAgentChoose()
           
 GameAgent chooseAgent()
           
 GameAgent chooseSecondAgent(GameAgent first)
           
 void init()
          This method performs initializing of the agent.
 void launchLanguageGame()
           
 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 propertyChange(PropertyChangeEvent evt)
          This method gets called when a bound property is changed.
 void restart()
          Restarts the world, zeros tick counter, removes agents or restart them...
 void setSAgentChoose(ComboInteger ci)
           
 
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.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

agentChooseTypes

public static final String[] agentChooseTypes

gameAgents

protected Vector gameAgents

agentChoose

protected ComboInteger agentChoose
Constructor Detail

SimpleWorld

public SimpleWorld()
Creates a new instance of SimpleWorld

Method Detail

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.