massim.competition2008
Class GridSimulation

java.lang.Object
  extended by massim.framework.DefaultSimulation
      extended by massim.framework.simulation.AbstractSimulation
          extended by massim.framework.simulation.ParallelizedRandomOrderSimulation
              extended by massim.gridsimulations.AbstractGridSimulation
                  extended by massim.competition2008.GridSimulation
All Implemented Interfaces:
Component, Simulation

public class GridSimulation
extends AbstractGridSimulation

This class is the main class of the GridSimulation. It provides methods to handle the initialization, configuration, presimulationstep and postsimulationstep.


Constructor Summary
GridSimulation()
           
 
Method Summary
 void configureSimulation(SimulationConfiguration c)
          This method can be used by simulation managers to configure a simulation.
 GridSimulationAgentState getAgentState(int x, int y)
           
 GridSimulationWorldState getSimpleSimulationState()
          This method is supposed to return the state of the world, excluding agents.
 void initializeSimpleSimulation()
          This method is supposed to initialize a simulation.
 boolean isFinished()
          This method returns true iff the simulation is in a final state.
 void postSimulationStep()
          calculate score save this State of Game and try to connect to the Flash-Server
 void simulationStep()
           
 
Methods inherited from class massim.gridsimulations.AbstractGridSimulation
finalizeSimpleSimulation, preSimulationStep, runAgents, updateAgentPosition
 
Methods inherited from class massim.framework.simulation.ParallelizedRandomOrderSimulation
runFinalAgents, runInitAgents
 
Methods inherited from class massim.framework.simulation.AbstractSimulation
endSimulation, getAgents, getSimulationState, getSteps, setSteps, startSimulation, stepSimulation
 
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
 

Constructor Detail

GridSimulation

public GridSimulation()
Method Detail

configureSimulation

public void configureSimulation(SimulationConfiguration c)
Description copied from class: DefaultSimulation
This method can be used by simulation managers to configure a simulation.

Specified by:
configureSimulation in interface Simulation
Overrides:
configureSimulation in class AbstractSimulation
Parameters:
c - configuration message

getSimpleSimulationState

public GridSimulationWorldState getSimpleSimulationState()
Description copied from class: AbstractSimulation
This method is supposed to return the state of the world, excluding agents.

Specified by:
getSimpleSimulationState in class AbstractSimulation
Returns:
state of the world

initializeSimpleSimulation

public void initializeSimpleSimulation()
Description copied from class: AbstractSimulation
This method is supposed to initialize a simulation. It should setup a world state and make everything ready for the first step. When this method is called agents are already initialized and available. Possibly it will also have to initialize their states.

Specified by:
initializeSimpleSimulation in class AbstractSimulation

isFinished

public boolean isFinished()
Description copied from interface: Simulation
This method returns true iff the simulation is in a final state.

Returns:
true iff simulation is in final state

simulationStep

public void simulationStep()
Overrides:
simulationStep in class AbstractGridSimulation

getAgentState

public GridSimulationAgentState getAgentState(int x,
                                              int y)

postSimulationStep

public void postSimulationStep()
calculate score save this State of Game and try to connect to the Flash-Server

Specified by:
postSimulationStep in class AbstractSimulation


Copyright © 2012. All Rights Reserved.