Each event is linked to a simulator represented by an instance of {@link Simulator} before it can be scheduled and processed.A default simulator, given by Simulator.getDefaultSimulator, is used if no simulator is linked explicitly with an event. When an event is constructed, it is not scheduled. It must be scheduled separately by calling one of the scheduling methods {@link #schedule schedule}, {@link #scheduleNext scheduleNext}, {@link #scheduleBefore scheduleBefore}, etc. An event can also be cancelled before it occurs.
A scheduled event has an associated time at which it will happen and a priority, which can be queried using the methods {@link #time time} and {@link #priority priority}, respectively. By default, events occur in ascending order of time, and have priority 1. Events with the same time occur in ascending order of priority. For example, if events e1 and e2 occur at the same time with priority 2 and 1 respectively, then e2 will occur before e1. Events with the same time and priority occur in the order they were scheduled.
|
|
|
|