public static interface Scheduler.SimulationTime
| Modifier and Type | Field and Description |
|---|---|
static String |
DATE_BASED_MODE_REQUIRED |
static String |
TICK_BASED_MODE_REQUIRED |
| Modifier and Type | Method and Description |
|---|---|
void |
addOneTimeUnit()
Adds one time unit to the simulation current time
|
default LocalDateTime |
getCurrentDate()
Gets the current date
|
default BigDecimal |
getCurrentTick()
Gets the current tick
|
default ChronoUnit |
getDefaultTemporalUnit()
Gets the default temporal unit which will be used by
addOneTimeUnit()
and incrementCurrentDate(long) in a date-based mode |
default 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,
ChronoUnit unit)
Shortcut for
setCurrentDate(getCurrentDate().plus(amountToAdd, unit)); |
default void |
incrementCurrentTick(BigDecimal delta)
Shortcut for
setCurrentTick(getCurrentTick().add(delta)); |
default void |
incrementCurrentTick(double delta)
Shortcut for
setCurrentTick(getCurrentTick().add(BigDecimal.valueOf(delta))); |
default void |
setCurrentDate(LocalDateTime date)
Shortcut for
setCurrentDate(getCurrentDate().plus(amountToAdd, unit)); |
default void |
setCurrentTick(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 void |
setDefaultTemporalUnit(ChronoUnit unit)
Sets the default temporal unit which will be used by
addOneTimeUnit()
and incrementCurrentDate(long) in a date-based mode |
default void |
setEndDate(LocalDateTime endDate)
Sets the date at which the simulation should stop
|
default void |
setEndTick(BigDecimal endTick)
Sets the tick at which the simulation should end
|
static final String TICK_BASED_MODE_REQUIRED
static final String DATE_BASED_MODE_REQUIRED
default void setCurrentTick(BigDecimal value)
value - default void setCurrentTick(double value)
setCurrentTick(BigDdecimal.valuof(value));value - specifies the current tick valuedefault void setCurrentDate(LocalDateTime date)
setCurrentDate(getCurrentDate().plus(amountToAdd, unit));date - the date to set as current datedefault BigDecimal getCurrentTick()
default LocalDateTime getCurrentDate()
void addOneTimeUnit()
boolean hasReachedEndTime()
true if the simulation should be stopped.default void incrementCurrentTick(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,
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 void setDefaultTemporalUnit(ChronoUnit unit)
addOneTimeUnit()
and incrementCurrentDate(long) in a date-based modeunit - a temporal unit as defined in ChronoUnitdefault ChronoUnit getDefaultTemporalUnit()
addOneTimeUnit()
and incrementCurrentDate(long) in a date-based modedefault BigDecimal getEndTick()
default void setEndTick(BigDecimal endTick)
endTick - the endTick to setdefault void setEndDate(LocalDateTime endDate)
endDate - the date at which the simulation should stop
Fabien Michel, Olivier Gutknecht, Jacques Ferber - February 17 2020