Skip to main content

Module scheduler

Module scheduler 

Source
Expand description

Scheduler trait and built-in implementations.

Schedulers control the order in which agents are activated each step. The built-in schedulers mirror Julia Agents.jl Schedulers.*:

Rust typeJulia equivalentBehavior
FastestSchedulers.fastestIteration order (no sorting)
ByIdSchedulers.ByIDSorted ascending by agent ID
RandomlySchedulers.RandomlyShuffled randomly each step
ByPropertySchedulers.ByPropertySorted by a user-defined key (greatest first)
PartiallyRandomSchedulers.PartiallyRandom subset with a given probability

§Determinism notes

Deterministic replay depends on both the scheduler and the order of agent IDs collected from the store.

  • ById imposes an explicit deterministic order.
  • Fastest is deterministic only if the underlying store iteration order is deterministic.
  • Randomly and PartiallyRandom are reproducible for a fixed RNG seed only when the pre-randomization ID collection order is itself deterministic.
  • ByProperty is reproducible when the selected key is deterministic and either ties do not occur or the source ID order is deterministic.

Structs§

ById
ID-ordered scheduler - returns agents sorted ascending by AgentId.
ByProperty
Property-sorted scheduler - activates agents sorted by a user-defined key.
Fastest
Fastest scheduler - returns agents in store iteration order.
PartiallyRandom
Partial random scheduler - activates a random subset of agents each step.
Randomly
Random scheduler - shuffles agent IDs each step using the model’s RNG.

Traits§

Scheduler
Trait for agent activation schedulers.