Class Model

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< Model >

Derived Type

Class Documentation

class Model : public std::enable_shared_from_this<Model>

An abstract for generic models.

See also

ReporterModel

Subclassed by kami::ReporterModel

Public Functions

std::shared_ptr<Domain> get_domain()

Get the Domain associated with this model.

Returns

a shared pointer to the Domain

std::shared_ptr<Domain> set_domain(std::shared_ptr<Domain> domain)

Add a Domain to this scheduler.

This method will associate a model with the scheduler.

Returns

a shared pointer to the Domain

std::shared_ptr<Population> get_population()

Get the Population associated with this model.

Returns

a shared pointer to the Population

std::shared_ptr<Population> set_population(std::shared_ptr<Population> population)

Add a Model to this scheduler.

This method will associate a model with the scheduler.

Returns

a shared pointer to the Population

std::shared_ptr<Scheduler> get_scheduler()

Get the Scheduler associated with this model.

Returns

a shared pointer to the Scheduler

std::shared_ptr<Scheduler> set_scheduler(std::shared_ptr<Scheduler> scheduler)

Add a Model to this scheduler.

This method will associate a model with the scheduler.

Returns

a shared pointer to the Scheduler

virtual std::shared_ptr<Model> step()

Execute a single time step of the model.

This method will collect all the Agents in the Population associated with model and pass them to the associated Scheduler for stepping.

Returns

a shared pointer to the model instance

Protected Attributes

std::shared_ptr<Domain> _domain = nullptr

Reference copy of the Domain

std::shared_ptr<Population> _pop = nullptr

Reference copy of the Population

std::shared_ptr<Scheduler> _sched = nullptr

Reference copy of the Scheduler