Class StagedAgent

Inheritance Relationships

Base Type

Class Documentation

class StagedAgent : public kami::Agent

A superclass for all staged agents.

Staged agents use a two-phase step to allow agents to take actions without updating the state of the model before all agents have been allowed to update. All work necessary to advance the StagedAgent state should take place in the step() function. However, the StagedAgent should not actually update the state, and instead save the results for later use. Finally, during the advance() stage, the StagedAgent state should update.

StagedAgents must implement both the step() and advance() functions.

Public Functions

virtual AgentID advance(std::shared_ptr<Model> model) = 0

Post-step advance the agent.

This method should be called after step(). Any updates or cleanups to the agent that must happen for the StagedAgent to complete its step must happen here.

Parameters

model – a reference copy of the model