pySimBlocks.core.scheduler

class pySimBlocks.core.scheduler.Scheduler(tasks: list[Task])[source]

Bases: object

Scheduler for dispatching tasks based on their sample times.

tasks

List of tasks sorted by ascending sample time.

active_tasks() list[Task][source]

Return all tasks due to run at the current tick.

Returns:

List of tasks whose should_run() returns True.

tick() None[source]

Advance all task countdowns by one tick.

Must be called once per simulator tick, regardless of which tasks were active.