public static interface Scheduler.SimulationTime
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATE_BASED_MODE_REQUIRED |
static java.lang.String |
TICK_BASED_MODE_REQUIRED |
Modifier and Type | Method and Description |
---|---|
void |
addOneTimeUnit()
Adds one time unit to the simulation current time
|
default java.time.LocalDateTime |
getCurrentDate()
Gets the current date
|
default java.math.BigDecimal |
getCurrentTick()
Gets the current tick
|
default java.math.BigDecimal |
getEndTick()
returns the tick for which the simulation should end.
|
boolean |
hasReachedEndTime()
Checks if the simulation has reached the specified end time
|
default void |
incrementCurrentDate(long amountToAdd) |
default void |
incrementCurrentDate(long amountToAdd,
java.time.temporal.ChronoUnit unit)
Shortcut for
setCurrentDate(getCurrentDate().plus(amountToAdd, unit)); |
default void |
incrementCurrentTick(java.math.BigDecimal delta)
Shortcut for
setCurrentTick(getCurrentTick().add(delta)); |
default void |
incrementCurrentTick(double delta)
Shortcut for
setCurrentTick(getCurrentTick().add(BigDecimal.valueOf(delta))); |
default void |
setCurrentDate(java.time.LocalDateTime date)
Shortcut for
setCurrentDate(getCurrentDate().plus(amountToAdd, unit)); |
default void |
setCurrentTick(java.math.BigDecimal value)
Sets the current tick a the simulation to the specified value
|
default void |
setCurrentTick(double value)
Shortcut for
setCurrentTick(BigDdecimal.valuof(value)); |
default java.time.LocalDateTime |
setDefaultTemporalUnit(java.time.temporal.ChronoUnit unit)
Sets the default temporal unit which will be used by
addOneTimeUnit()
and incrementCurrentDate(long) in a date-based mode |
default void |
setEndDate(java.time.LocalDateTime endDate)
Sets the date at which the simulation should stop
|
default void |
setEndTick(java.math.BigDecimal endTick)
Sets the tick at which the simulation should end
|
static final java.lang.String TICK_BASED_MODE_REQUIRED
static final java.lang.String DATE_BASED_MODE_REQUIRED
default void setCurrentTick(java.math.BigDecimal value)
value
- default void setCurrentTick(double value)
setCurrentTick(BigDdecimal.valuof(value));
value
- specifies the current tick valuedefault void setCurrentDate(java.time.LocalDateTime date)
setCurrentDate(getCurrentDate().plus(amountToAdd, unit));
date
- the date to set as current datedefault java.math.BigDecimal getCurrentTick()
default java.time.LocalDateTime getCurrentDate()
void addOneTimeUnit()
boolean hasReachedEndTime()
true
if the simulation should be stopped.default void incrementCurrentTick(java.math.BigDecimal delta)
setCurrentTick(getCurrentTick().add(delta));
delta
- specifies how much time should be addeddefault void incrementCurrentTick(double delta)
setCurrentTick(getCurrentTick().add(BigDecimal.valueOf(delta)));
delta
- specifies how much time should be addeddefault void incrementCurrentDate(long amountToAdd, java.time.temporal.ChronoUnit unit)
setCurrentDate(getCurrentDate().plus(amountToAdd, unit));
amountToAdd
- the amount of the unit to add to the result, may be negativeunit
- the unit of the amount to add, not nulldefault void incrementCurrentDate(long amountToAdd)
amountToAdd
- the amount of default temporal unit to addsetDefaultTemporalUnit(ChronoUnit)
default java.time.LocalDateTime setDefaultTemporalUnit(java.time.temporal.ChronoUnit unit)
addOneTimeUnit()
and incrementCurrentDate(long)
in a date-based modeunit
- a temporal unit as defined in ChronoUnit
default java.math.BigDecimal getEndTick()
default void setEndTick(java.math.BigDecimal endTick)
endTick
- the endTick to setdefault void setEndDate(java.time.LocalDateTime endDate)
endDate
- the date at which the simulation should stop
Fabien Michel, Olivier Gutknecht, Jacques Ferber - September 9 2019