Class SequentialScheduler

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class SequentialScheduler : public kami::Scheduler

Will execute all agent steps in a sequential order.

A sequential scheduler will iterate over the agents assigned to the scheduler and call their step() function in a sequential order. That order is preserved between calls to step() but may be modified by addAgent() or deleteAgent().

Subclassed by kami::RandomScheduler, kami::StagedScheduler

Public Functions

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

Execute a single time step.

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 model

Returns

returns vector of agents successfully stepped

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

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) override

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) override

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