|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmassim.framework.DefaultSimulation
public abstract class DefaultSimulation
This class is a good starting point to create a new simulation. It provides some methods to create and remove agents aswell as methods to ask agents to act according to some perception.
Constructor Summary | |
---|---|
DefaultSimulation()
|
Method Summary | |
---|---|
protected java.util.concurrent.Future<SimulationAgent> |
concurrentCreateAgent(AgentParameter parameter)
This method does the same as createAgent, but it won't block and return a Future |
protected java.util.concurrent.Future<Action> |
concurrentGetAction(Perception perception,
SimulationAgent a)
This is the non-blocking version of getAction. |
void |
configureSimulation(SimulationConfiguration m)
This method can be used by simulation managers to configure a simulation. |
protected SimulationAgent |
createAgent(AgentParameter parameter)
Create an agent, represented by an Agent object. |
protected Action |
getAction(Perception perception,
SimulationAgent a)
This method will deliver a perception to an agent, getting the agents reaction in return. |
AgentManager |
getAgentManager()
Retrieve the AgentManager that will be used for agent creation by this simulation. |
Controller |
getController()
|
protected void |
removeAgent(SimulationAgent a)
Remove an agent. |
protected void |
removeAllAgents()
Remove all agents that were created by this simulation. |
void |
setAgentManager(AgentManager agentmanager)
|
void |
setController(Controller controller)
|
void |
start()
Tell the component to start activity. |
void |
stop()
Tell the component to cease activity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface massim.framework.Simulation |
---|
endSimulation, getSimulationState, isFinished, startSimulation, stepSimulation |
Constructor Detail |
---|
public DefaultSimulation()
Method Detail |
---|
protected SimulationAgent createAgent(AgentParameter parameter)
parameter
- agent creation parameters
protected java.util.concurrent.Future<SimulationAgent> concurrentCreateAgent(AgentParameter parameter)
parameter
- agent creation parameters
protected void removeAgent(SimulationAgent a)
a
- agent to removeprotected void removeAllAgents()
protected Action getAction(Perception perception, SimulationAgent a)
perception
- perception to deliver to the agenta
- agent to access
protected java.util.concurrent.Future<Action> concurrentGetAction(Perception perception, SimulationAgent a)
perception
- perception to deliver to the agenta
- agent to access
public void start()
Component
start
in interface Component
public void stop()
Component
stop
in interface Component
public void configureSimulation(SimulationConfiguration m)
configureSimulation
in interface Simulation
m
- configuration messagepublic AgentManager getAgentManager()
getAgentManager
in interface Simulation
public void setAgentManager(AgentManager agentmanager)
setAgentManager
in interface Simulation
agentmanager
- The agentmanager to set.public Controller getController()
public void setController(Controller controller)
controller
- The controller to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |