public abstract class DefaultSimulation extends Object implements Simulation
Constructor and Description |
---|
DefaultSimulation() |
Modifier and Type | Method and Description |
---|---|
protected Future<SimulationAgent> |
concurrentCreateAgent(AgentParameter parameter)
This method does the same as createAgent, but it won't block and return a Future
|
protected 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endSimulation, getSimulationState, isFinished, startSimulation, stepSimulation
protected SimulationAgent createAgent(AgentParameter parameter)
parameter
- agent creation parametersprotected Future<SimulationAgent> concurrentCreateAgent(AgentParameter parameter)
parameter
- agent creation parametersprotected 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 accessprotected Future<Action> concurrentGetAction(Perception perception, SimulationAgent a)
perception
- perception to deliver to the agenta
- agent to accesspublic void start()
Component
public void stop()
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.Copyright © 2013. All Rights Reserved.