The class Kinetic::Simulator controls kinetic data structures by maintaining a the current time and ensuring that events are processed when necessary.
In addition, the Kinetic::Simulator can call on the kinetic data structures to audit themselves at appropriate times. When the last event processed and the next to be processed have different times, then there is a rational value of time at which all kinetic data structures should be non-degenerate (since there are no events at that time). At such a time, kinetic data structures can easily verify their correctness by checking that all the certificate predicates have the correct value. When exactness checks are enabled, whenever the last event processed and the next event to be processed have different times, a Kinetic::Simulator::Listener::HAS_AUDIT_TIME notification is made. Kinetic data structures can listen for that event, and when it is made, they can call Kinetic::Simulator::audit_time() to get the time value and then verify that their structure is correct.
Typically, the simulator is created by the Kinetic:SimulationTraits class and kinetic data structures request a handle to it from there.
| |
The type of the function kernel used to instantiate this Kinetic::Simulator.
| |
| |
Extend this base class to listen to notifications from this Kinetic::Simulator. There are two types of notifications: HAS_AUDIT_TIME and DIRECTION_OF_TIME. The first is made when kinetic data structures can perform an audit. The second is made when the direction of time is changed.
| |
| |
The representation type for times in the simulator. It is Function_kernel::Root_enumerator::Root.
| |
| |
The key to access scheduled Event in order to inspect or delete them.
| |
| |
The basic number type used in computations.
| |
| |
A reference counted pointer to be used for storing references to the object.
| |
| |
A reference counted pointer to be used for storing references to the object.
|
| |||
Construct a Kinetic::Simulator which will process events between times start and end (events outside this window will be discarded).
|
|
| |
Access the Function_kernel object used by the Kinetic::Simulator. | ||
|
| |
Return the current time. | ||
|
| |
Set the current time to t, which cannot be less than current_time. Any events in the queue before time t are processed. | ||
|
| |
This returns a ration number representing the current time. This only returns a valid time if has_current_time_nt() is true. | ||
|
| |
Return true if there is a rational number which is equivalent to the current time. Equivalent means that it has the same ordering relation to all previous and scheduled events. | ||
|
| |
Returns true if the current time is a rational number and there are no events at the current time. This means that the simulation can be audited at this time. | ||
|
| |
Return the time of the next event in the queue. | ||
|
| Return the time the simulation will end. If time is running backwards, then this returns Time::infinity(). |
|
| |
Advance the end time to t. This is not generally a safe operation as all the kinetic data structures must rebuild their certificates at this time. | ||
| ||
|
| |
Schedule a new event at time t. The object event must implement the concept Event. The Event_key returned can be used to access or deschedule the event. | ||
|
| This method returns an Event_key which is guaranteed never to be assigned to any real event. |
|
| |
Remove the event referenced by k from the event queue. | ||
| ||
| ||
| ||
This method returns a pointer to an event, which can be used for recoving data, such as cached solvers, from that event. The second argument really shouldn't be there, but gcc seems to sometimes have issues if you try to specify the template value directly. | ||
|
| |
Return the time at which the event referenced by k occurs. | ||
| ||
|
| |
Set the event referenced by key k to ev, for example if you want to change what happens when that event occurs. A new event key is returned. | ||
|
| |
Return POSITIVE if time is running forwards or NEGATIVE if it is running backwards. | ||
|
| |
Set which direction time is running. | ||
|
| |
Return the number of events which have been processed. | ||
|
| |
Process all events up to the ith event. i cannot be less than current_event_number. |