Class RandomScheduler
Defined in File random.h
Inheritance Relationships
Base Types
public kami::SequentialScheduler(Class SequentialScheduler)private std::enable_shared_from_this< RandomScheduler >
Class Documentation
-
class RandomScheduler : public kami::SequentialScheduler, private std::enable_shared_from_this<RandomScheduler>
Will execute all agent steps in a random order.
A random scheduler will iterate over the agents assigned to the scheduler and call their
step()function in a random order. That order should be different for each subsequent call tostep(), but is not guaranteed not to repeat.Public Functions
-
RandomScheduler() = default
Constructor.
Constructor.
- Parameters
rng – [in] A uniform random number generator of type
std::mt19937, used as the source of randomness.
Execute a single time step.
This method will randomize the list of Agents provided then execute the
Agent::step()method for every Agent listed.- Parameters
model – a reference copy of the model
agent_list – list of agents to execute the step
- Returns
returns vector of agents successfully stepped
Execute a single time step for a
ReporterModelThis method will randomize the list of Agents provided then execute the
Agent::step()method for every Agent listed.- Parameters
model – a reference copy of the
ReporterModelagent_list – list of agents to execute the step
- Returns
returns vector of agents successfully stepped
Set the RNG.
Set the random number generator used to randomize the order of agent stepping.
- Parameters
rng – [in] A uniform random number generator of type
std::mt19937, used as the source of randomness.- Returns
a shared pointer to the random number generator
-
std::shared_ptr<std::mt19937> get_rng()
Get the RNG.
Get a reference to the random number generator used to randomize the order of agent stepping.
-
RandomScheduler() = default