Class Scheduler

Inheritance Relationships

Derived Type

Class Documentation

class Scheduler

Create a Kami scheduler.

Schedulers are responsible for executing each time step in the model. A scheduler will have a collection of agents assigned to it and will execute the step function for each agent based on the type of scheduling implemented.

Subclassed by kami::SequentialScheduler

Public Functions

virtual std::unique_ptr<std::vector<AgentID>> step(std::shared_ptr<Model> model) = 0

Execute a single time step.

This method will step through the list of Agents in the Population associated with model and then execute the Agent::step() method for every Agent assigned to this scheduler in the order assigned.

Parameters

model – a reference copy of the model

Returns

returns vector of agents successfully stepped

virtual std::unique_ptr<std::vector<AgentID>> step(std::shared_ptr<ReporterModel> model) = 0

Execute a single time step for a ReporterModel

This method will step through the list of Agents in the scheduler’s internal queue and then execute the Agent::step() method for every Agent assigned to this scheduler in the order assigned.

Parameters

model – a reference copy of the ReporterModel

Returns

returns vector of agents successfully stepped

virtual std::unique_ptr<std::vector<AgentID>> step(std::shared_ptr<Model> model, std::unique_ptr<std::vector<AgentID>> agent_list) = 0

Execute a single time step.

This method will step through the list of Agents provided and then execute the Agent::step() method for every Agent assigned to this scheduler in the order assigned.

Parameters
  • model – a reference copy of the model

  • agent_list – list of agents to execute the step

Returns

returns vector of agents successfully stepped

virtual std::unique_ptr<std::vector<AgentID>> step(std::shared_ptr<ReporterModel> model, std::unique_ptr<std::vector<AgentID>> agent_list) = 0

Execute a single time step for a ReporterModel

This method will step through the list of Agents in the scheduler’s internal queue and then execute the Agent::step() method for every Agent assigned to this scheduler in the order assigned.

Parameters
  • model – a reference copy of the ReporterModel

  • agent_list – list of agents to execute the step

Returns

returns vector of agents successfully stepped

Protected Attributes

int _step_counter = 0

Counter to increment on each step