org.vizzini.game.simulation
Class AbstractSimulationEnvironment

java.lang.Object
  extended by org.vizzini.game.AbstractEnvironment
      extended by org.vizzini.game.simulation.AbstractSimulationEnvironment
All Implemented Interfaces:
Serializable, Cloneable, IEnvironment, ISimulationEnvironment
Direct Known Subclasses:
DefaultSimulationEnvironment

public abstract class AbstractSimulationEnvironment
extends AbstractEnvironment
implements ISimulationEnvironment

Provides base functionality for a simulation environment.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Constructor Summary
AbstractSimulationEnvironment()
          Construct this object.
 
Method Summary
 void configure(Properties properties)
          Configure this environment.
 long getMinCycleTime()
           
 Date getSimDate()
           
 Date getStartDate()
           
 void incrementTurnNumber()
          Increment the turn number.
 void performAction(IAction action)
          Perform the given action.
protected  void setMinCycleTime(long minCycleTime)
           
protected  void setSimDate(Date simDate)
           
 void setStartDate(Date startDate)
           
 void undoAction(IAction action)
          Undo the given action.
 void update(long deltaTime)
          Update the environment for the given elapsed time.
 
Methods inherited from class org.vizzini.game.AbstractEnvironment
addStateListener, clone, copy, createInitialTokens, equals, get, getAdjudicator, getAgentCollection, getStateManager, getTeamCollection, getTokenCollection, getTokenCollectionClass, getTurnNumber, hashCode, isFiringStateChanges, open, performActions, removeStateListener, reset, setAdjudicator, setAgentCollection, setFiringStateChanges, setTokenCollectionClass, setTurnNumber
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.vizzini.game.IEnvironment
addStateListener, clone, copy, get, getAdjudicator, getAgentCollection, getTeamCollection, getTokenCollection, getTurnNumber, isFiringStateChanges, open, performActions, removeStateListener, reset, setAdjudicator, setAgentCollection, setFiringStateChanges, setTurnNumber
 

Constructor Detail

AbstractSimulationEnvironment

public AbstractSimulationEnvironment()
Construct this object.

Since:
v0.3
Method Detail

configure

public void configure(Properties properties)
               throws InstantiationException,
                      IllegalAccessException
Configure this environment.

Specified by:
configure in interface IEnvironment
Overrides:
configure in class AbstractEnvironment
Parameters:
properties - Source of configuration information.
Throws:
InstantiationException
IllegalAccessException
Since:
v0.3

getMinCycleTime

public long getMinCycleTime()
Specified by:
getMinCycleTime in interface ISimulationEnvironment
Returns:
Return minCycleTime.
Since:
v0.3

getSimDate

public Date getSimDate()
Specified by:
getSimDate in interface ISimulationEnvironment
Returns:
Return simDate.
Since:
v0.3

getStartDate

public Date getStartDate()
Specified by:
getStartDate in interface ISimulationEnvironment
Returns:
Return startDate.
Since:
v0.3

incrementTurnNumber

public void incrementTurnNumber()
Increment the turn number. Extend the super method to update the simulation date time.

Specified by:
incrementTurnNumber in interface IEnvironment
Overrides:
incrementTurnNumber in class AbstractEnvironment
Since:
v0.3

performAction

public void performAction(IAction action)
Perform the given action.

Specified by:
performAction in interface IEnvironment
Parameters:
action - Action.
Since:
v0.3

setStartDate

public void setStartDate(Date startDate)
Specified by:
setStartDate in interface ISimulationEnvironment
Parameters:
startDate - the startDate to set
Since:
v0.3

undoAction

public void undoAction(IAction action)
Undo the given action.

Specified by:
undoAction in interface IEnvironment
Parameters:
action - Action.
Since:
v0.3

update

public void update(long deltaTime)
Update the environment for the given elapsed time.

Specified by:
update in interface IEnvironment
Overrides:
update in class AbstractEnvironment
Parameters:
deltaTime - Delta time. (milliseconds)
Since:
v0.3

setMinCycleTime

protected void setMinCycleTime(long minCycleTime)
Parameters:
minCycleTime - the minCycleTime to set
Since:
v0.3

setSimDate

protected void setSimDate(Date simDate)
Parameters:
simDate - the simDate to set
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02