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::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

std::unique_ptr<SubModelDescription> description

Description class which provides convenient accessors This may be null if the instance has been cloned

Protected Functions

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

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

explicit SubModelData(const 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