pub trait Scheduler<M> {
// Required method
fn schedule_into(&mut self, model: &M, buf: &mut Vec<AgentId>);
}Expand description
Trait for agent activation schedulers.
Each step, the model calls schedule_into to populate a buffer with
the agent IDs to activate, in the desired order. The buffer is cleared
by the caller before being passed in.
Schedulers are stateless - the buffer is owned by the model and reused across steps to avoid per-step allocations.
Required Methods§
Sourcefn schedule_into(&mut self, model: &M, buf: &mut Vec<AgentId>)
fn schedule_into(&mut self, model: &M, buf: &mut Vec<AgentId>)
Fill buf with the agent IDs to activate this step, in the desired order.
The buffer is cleared by the caller before this method is invoked.