Package gov.nasa.jpl.engine
Class Waiter
java.lang.Object
gov.nasa.jpl.engine.Waiter
- All Implemented Interfaces:
Comparable<Waiter>
A Waiter is an object stored by the engine that tells it to run a certain function (Activity model())
at a certain time. Supports 'pausing' and 'resuming' thread by returning new object holding a subset of
original model function
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Waiter
Constructs a waiter to execute at the given Time with the given priority.- Parameters:
t
- The Time this Waiter should execute.priority
- Used to further prioritize Waiters that execute at the same time but under different contextual meanings. By convention the modeling engine uses the following values: priority = -1 -> signaled activities (immediately) priority = 0 -> resumed activities (before activity end) priority = 1 -> new activities (at activity start)
-
-
Method Details
-
getTime
- Returns:
- The Time which this Waiter will execute
-
compareTo
Sorts waiters by runtime and then priority.- Specified by:
compareTo
in interfaceComparable<Waiter>
- Parameters:
o
- the object to be compared.- Returns:
-