public interface Simulation
getTotalTicks()).
A simulation has a collection of members, represented by
SimulationMember objects, which are called for each phase in each
tick. Members may interact by using service objects, however, the
services must make sure that no communication is allowed during one phase.
Furthermore, a simulation provides its members with a possibility of
recording values for profiling, called series. The series results can
later be obtained via getSeries(String, Class).| Modifier and Type | Field and Description |
|---|---|
static String |
TICK_PHASE
The name of the main phase, the tick phase.
|
| 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
getTotalTicks()). |
void |
executeUpToTick(long tick)
Executes the simulation up to the given tick, stopping at this tick in a
non-processed state (
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.
|
static final String TICK_PHASE
void executeToEnd()
getTotalTicks()).void executeCurrentTick()
IllegalStateException is thrown.void executeAndIncreaseTick()
IllegalStateException is thrown.long getCurrentTick()
executedCurrentTick() is false) or has already been processed (
executedCurrentTick() is true).void increaseTick()
increaseTickStrictly() for a
version where this behavior is different.void increaseTickStrictly()
IllegalStateException is thrown. See
increaseTickStrictly() for a version where this behavior is
different.boolean executedCurrentTick()
false) or has already been processed (returned value is
true).void executeUpToTick(long tick)
executedCurrentTick() is false).tick - the tick to stop beforelong getTotalTicks()
<T> SeriesResult<T> getSeries(String symbol, Class<T> clazz)
null is returned.T - the type of series to reutrnsymbol - the symbol to return the series result forclazz - the class of the seriesCopyright © 2015. All rights reserved.