Class TimeBasedEndCriterion
- java.lang.Object
-
- fr.univ_artois.lgi2a.similar.extendedkernel.libs.endcriterion.TimeBasedEndCriterion
-
- All Implemented Interfaces:
IEndCriterionModel
public final class TimeBasedEndCriterion extends Object implements IEndCriterionModel
A simulation end criterion based on a final time stamp to reach.- Author:
- Yoann Kubera
-
-
Constructor Summary
Constructors Constructor Description TimeBasedEndCriterion(SimulationTimeStamp finalTimeStamp)
Builds a simulation end criterion based on a final time stamp to reach.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimulationTimeStamp
getFinalTimeStamp()
Gets the final time stamp of the simulation.boolean
isFinalTimeOrAfter(SimulationTimeStamp currentTime, ISimulationEngine engine)
Tells if a time stamp is greater or equal to the final time stamp.
-
-
-
Constructor Detail
-
TimeBasedEndCriterion
public TimeBasedEndCriterion(SimulationTimeStamp finalTimeStamp)
Builds a simulation end criterion based on a final time stamp to reach.- Parameters:
finalTimeStamp
- The final time stamp of the simulation.- Throws:
IllegalArgumentException
- If the argument isnull
.
-
-
Method Detail
-
getFinalTimeStamp
public SimulationTimeStamp getFinalTimeStamp()
Gets the final time stamp of the simulation.- Returns:
- The final time stamp of the simulation.
-
isFinalTimeOrAfter
public boolean isFinalTimeOrAfter(SimulationTimeStamp currentTime, ISimulationEngine engine)
Tells if a time stamp is greater or equal to the final time stamp.- Specified by:
isFinalTimeOrAfter
in interfaceIEndCriterionModel
- Parameters:
currentTime
- The last time the dynamic state of the simulation was in a partly consistent state.engine
- The simulation engine containing information about the currently running simulation.- Returns:
true
if the final time of the level was reached.
-
-