|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmassim.framework.DefaultSimulation
massim.framework.simulation.AbstractSimulation
public abstract class AbstractSimulation
This class provides some reasonable defaults for relatively simple simulations and allows the reuse of classes written for such simulations. In contrast to DefaultSimulation there are som import paradigm shifts. There is now an array of agent states. Each agent state contains all agent specific state information. This might be the agents condition, position or score. Additionally there is one world state. It contains all information about the world meaning everything that is not directly associated with one agent. These two states describe the whole state of the simulation implementation specific side. Please note that those states are also exported via massim.Simulation.getSimulationState(). So they are supposed to be "clean", i.e. not containing any helper structures that are just there to ease access to data inside the state, like hashtables or something similar.
Constructor Summary | |
---|---|
AbstractSimulation()
|
Method Summary | |
---|---|
void |
configureSimulation(SimulationConfiguration config)
This method can be used by simulation managers to configure a simulation. |
java.lang.String |
endSimulation()
This method will be automatically called once when the simulation has been started and it is to end. |
abstract java.lang.String |
finalizeSimpleSimulation()
This method is supposed to make final actions before the simulation is shut down. |
SimulationAgent[] |
getAgents()
Retrieves an array of SimulationAgent objects that participate in this simulation. |
abstract WorldState |
getSimpleSimulationState()
This method is supposed to return the state of the world, excluding agents. |
SimulationState |
getSimulationState()
This method will retrieve the whole simulation state. |
int |
getSteps()
Retrieves the number of the steps that have been started to process in this simulation run. |
abstract void |
initializeSimpleSimulation()
This method is supposed to initialize a simulation. |
abstract void |
postSimulationStep()
This method is supposed to make necessary changes to the world that must occur after agent act in have acted in that step. |
abstract void |
preSimulationStep()
This method is supposed to make necessary changes to the world that must occur before agents act in that step. |
abstract void |
runAgents()
This method is supposed to let agents act. |
abstract void |
runFinalAgents()
|
abstract void |
runInitAgents()
|
void |
setSteps(int steps)
Set number of the step. this is important when the server is started with recovery mode In recovery mode a simulation will run continuously at the step where he was stopped |
abstract void |
simulationStep()
|
void |
startSimulation()
This method will be automatically called when the simulation starts. |
void |
stepSimulation()
This method will be automatically called when the simulation is supposed to do a simulation step. |
Methods inherited from class massim.framework.DefaultSimulation |
---|
concurrentCreateAgent, concurrentGetAction, createAgent, getAction, getAgentManager, getController, removeAgent, removeAllAgents, setAgentManager, setController, start, stop |
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 |
---|
isFinished |
Constructor Detail |
---|
public AbstractSimulation()
Method Detail |
---|
public void startSimulation()
Simulation
public void stepSimulation()
Simulation
public SimulationState getSimulationState()
Simulation
public void configureSimulation(SimulationConfiguration config)
DefaultSimulation
configureSimulation
in interface Simulation
configureSimulation
in class DefaultSimulation
config
- configuration messagepublic abstract WorldState getSimpleSimulationState()
public abstract void initializeSimpleSimulation()
public SimulationAgent[] getAgents()
public int getSteps()
public void setSteps(int steps)
steps
- public abstract void preSimulationStep()
public abstract void postSimulationStep()
public abstract void runAgents()
public abstract void simulationStep()
public abstract void runInitAgents()
public abstract void runFinalAgents()
public abstract java.lang.String finalizeSimpleSimulation()
public java.lang.String endSimulation()
Simulation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |