public class SimulationImpl extends Object implements Simulation
Simulation.TICK_PHASE| Constructor and Description |
|---|
SimulationImpl(long totalTicks,
List<String> phases,
List<SimulationMember> members,
Map<String,SeriesProvider<?>> series,
Set<ServiceProvider<?>> services)
Creates a new simulation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
executeAndIncreaseTick()
Executes the current tick and advanced to the next tick.
|
void |
executeCurrentTick()
Executes the current tick.
|
boolean |
executedCurrentTick()
Determines whether the current tick has been prepared (return value is
false) or has already been processed (returned value is
true). |
void |
executeToEnd()
Executes the simulation from the current tick until the total number of
ticks defined (see
Simulation.getTotalTicks()). |
void |
executeUpToTick(long tick)
Executes the simulation up to the given tick, stopping at this tick in a
non-processed state (
Simulation.executedCurrentTick() is false). |
long |
getCurrentTick()
Returns the current tick.
|
List<String> |
getPhases()
Returns the phases used in this simulation.
|
<T> SeriesResult<T> |
getSeries(String symbol,
Class<T> clazz)
Returns the series result for a given series.
|
long |
getTotalTicks()
Returns the number of ticks this simulation has been configured to
process.
|
void |
increaseTick()
Advances to the next tick.
|
void |
increaseTickStrictly()
Advances to the next tick.
|
Map<Long,List<SimulationEvent>> |
test__getEventsMap()
Testability method only.
|
public SimulationImpl(long totalTicks,
List<String> phases,
List<SimulationMember> members,
Map<String,SeriesProvider<?>> series,
Set<ServiceProvider<?>> services)
totalTicks - the total ticks this simulation must run forphases - a list of phases to be usedmembers - a list of members to be servicedseries - a list of series to be recordedservices - a list of services to be providedpublic void executeToEnd()
SimulationSimulation.getTotalTicks()).executeToEnd in interface Simulationpublic void executeUpToTick(long tick)
SimulationSimulation.executedCurrentTick() is false).executeUpToTick in interface Simulationtick - the tick to stop beforepublic void executeCurrentTick()
SimulationIllegalStateException is thrown.executeCurrentTick in interface Simulationpublic long getCurrentTick()
SimulationSimulation.executedCurrentTick() is false) or has already been processed (
Simulation.executedCurrentTick() is true).getCurrentTick in interface Simulationpublic void executeAndIncreaseTick()
SimulationIllegalStateException is thrown.executeAndIncreaseTick in interface Simulationpublic void increaseTick()
SimulationSimulation.increaseTickStrictly() for a
version where this behavior is different.increaseTick in interface Simulationpublic void increaseTickStrictly()
SimulationIllegalStateException is thrown. See
Simulation.increaseTickStrictly() for a version where this behavior is
different.increaseTickStrictly in interface Simulationpublic boolean executedCurrentTick()
Simulationfalse) or has already been processed (returned value is
true).executedCurrentTick in interface Simulationpublic long getTotalTicks()
SimulationgetTotalTicks in interface Simulationpublic <T> SeriesResult<T> getSeries(String symbol, Class<T> clazz)
Simulationnull is returned.getSeries in interface SimulationT - the type of series to reutrnsymbol - the symbol to return the series result forclazz - the class of the seriespublic Map<Long,List<SimulationEvent>> test__getEventsMap()
public List<String> getPhases()
SimulationgetPhases in interface SimulationCopyright © 2015. All rights reserved.