Empty the queue but maintain all other state variables.
Empty the queue but maintain all other state variables.
Empty the queue and return all Event
s in prioritized order.
Add an event to the Schedule
.
Add an event to the Schedule
.
To maintain a hygienic schedule, the at
time must meet several
preconditions.
- It must be less than the MaximumTime
.
- It must not be NaN
.
- It cannot precede or equal the Epoch
- It cannot precede the current schedule time.
Violation of any of these conditions results in a raised ArgumentError.
Additionally, at
is always greater than the Schedule
time. However,
this method does not thrown an exception if at == this.time
. Instead,
at
is incremented by the smallest amount possible. Effectively,
scheduling at the current time asks the scheduler to run something at
the next tick.
the schedule time at which the event should activate
the activation group, given the same time
the activity to run
true if any Event
s are enqueued
true if the schedule was ever run and it is now empty
the number of enqueued Event
s
Merge two schedules.
Merge two schedules.
This method schedules the activities of other
on the called schedule.
However, it **does not** remove them from other
. Call that.clear()
afterwards if that is the desired behavior.
Raises an ArgumentError if the the
other schedule has events in this
schedules past.
Schedule an function (as an activity) to run once at a given time and group.
Schedule an activity to run once at a given time and group.
Schedule an activity (as an activity) to run once at time+delta and group.
Schedule an activity to run once at time+delta and group.
The queue is the core of scheduling.
The queue is the core of scheduling. It prioritizes Event
s in reverse
order, so that the item with the lowest time then the lowest ordering
goes first.
Schedule a function (as an action) repeatedly at a fixed interval.
Schedule an action run repeatedly at a fixed interval.
Schedule an action run repeatedly at a fixed interval.
the activity to run repeatedly
the initial scheduled time
the interval (in time) for rescheduling
the group relative to other Event
s at the same time
a Stoppable for possible early termination
Resets all items back to their pristine state, except for the RNG
Runs a schedule until over an environment until it is exhausted or the continueConditional returns false.
Runs a schedule over an environment for n steps or until it is exhausted.
Runs the schedule one step forward over some environment.
Runs the schedule one step forward over some environment.
Time and step are set **prior** to each activity's execution.
A step corresponds to a time with scheduled activities. For example, given two activities at 1.0, one at 3.0, and one at 9.0, the corresponding step (after each time runs) is 1, 2, and 3, respectively.
Activities scheduled at the same time but with a different group run over the same step. However, activities with a lower group (i.e. higher priority) are guaranteed to run first. Activities at the same time and the same group run in a random order.
the environment given to each activity
true if the any activity was executed, false otherwise
Runs a schedule until it is exhausted
The runOneStep
method collects Event
s that should run next into a
collection.
The runOneStep
method collects Event
s that should run next into a
collection. Rather than reallocating that collection each time,
Schedule
allocates it once in shuffleTmp
. Then, the Schedule
clears it as needed.