Class Scheduler

Class Documentation

class Scheduler

Declaration: final

Clock input is supplied by the owner; scheduling never sleeps or polls input.

advance() selects a bounded batch once. Time spent running that batch enters the next cycle, so expensive updates cannot extend the current batch forever.

Public Functions

explicit Scheduler(::CE::Runtime::Simulation::TimingOptions options = ::CE::Runtime::Simulation::TimingOptions{}, ::CE::Runtime::Simulation::Clock::time_point start = ::CE::Runtime::Simulation::Clock::now())

Validate and retain a scheduling policy and initial observation time.

See also

Detailed guide

Parameters:
  • options – Valid mode/recovery, nonnegative variable interval/cap, positive fixed step and update budget, bounded recovery prefix.

  • start – Initial monotonic observation boundary.

Throws:

CE::Exceptions::invalid_args – For invalid policy values. Creates no threads and performs no sleeping or native/input work.

inline const ::CE::Runtime::Simulation::TimingOptions &options() const

Declaration: [[nodiscard]]

Borrow the immutable policy retained by this scheduler.

See also

Detailed guide

Returns:

Reference valid until scheduler destruction; does not observe mutable external settings.

::CE::Runtime::Simulation::Batch advance(::CE::Runtime::Simulation::Clock::time_point now)

Declaration: [[nodiscard]]

Consume observation time and select a finite update batch.

See also

Detailed guide

Parameters:

now – Monotonic time at or after the previous observation.

Throws:

CE::Exceptions::invalid_args – For backwards time or unrepresentable elapsed/accumulated durations. One owner serializes calls. Time spent executing the returned batch is observed by the next call; it cannot extend this batch. This operation does not execute the steps.

Returns:

Owned step values, observation elapsed time and explicitly dropped lag.

::CE::Runtime::Simulation::Clock::time_point next_update_at() const

Declaration: [[nodiscard]]

Compute the next due observation boundary from retained debt and policy.

See also

Detailed guide

Returns:

Earliest next update time, saturated at Clock::time_point::max() on overflow. Does not sleep, advance the clock or synchronize concurrent access.