Struct SubModelData

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< SubModelData >

Struct Documentation

struct SubModelData : public std::enable_shared_from_this<SubModelData>

Holds all the mappings between a submodel and master/parent/host model

Public Types

typedef std::unordered_map<std::string, std::shared_ptr<SubAgentData>> SubAgentMap

Map of name:subagent definition map<string, SubAgentData>

Public Functions

bool operator==(const SubModelData &rhs) const

Equality operator, checks whether SubModelData hierarchies are functionally the same

Note

Instead compare pointers if you wish to check that they are the same instance

Returns:

True when models are the same

bool operator!=(const SubModelData &rhs) const

Equality operator, checks whether SubModelData hierarchies are functionally different

Note

Instead compare pointers if you wish to check that they are not the same instance

Returns:

True when models are not the same

SubModelData(const SubModelData &other) = delete

Default copy constructor, not implemented

Public Members

std::weak_ptr<const ModelData> model

Parent model

std::shared_ptr<const ModelData> submodel

The SubModel represented by this class

SubAgentMap subagents = {}

Holds all of the model’s subagent definitions

std::shared_ptr<SubEnvironmentData> subenvironment

The SubModel represented by this class

unsigned int max_steps

Max number of steps per submodel execution 0 is unlimited, but requires the submodel to have an exit condition

std::string name

Name assigned to the submodel at creation

Protected Functions

explicit SubModelData(std::shared_ptr<ModelData> model, const SubModelData &other)

Copy constructor This should only be called via clone();

explicit SubModelData(std::shared_ptr<ModelData> model, const std::string &submodel_name, const std::shared_ptr<ModelData> &submodel)

Normal constructor This should only be called by ModelDescription

Friends

friend class SubModelDescription
friend struct ModelData
friend class ModelDescription