Class StagedScheduler

Inheritance Relationships

Base Type

Class Documentation

class StagedScheduler : public kami::SequentialScheduler

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 add_agent() or delete_agent().

Public Functions

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 in the scheduler’s internal queue and execute the Agent::step() method for each Agent in the same order. Finally, it will execute the Agent::advance() method for each Agent in the same order.

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