Class SubEnvironmentDescription

Class Documentation

class SubEnvironmentDescription

This class provides an interface to a mapping between a parent and submodel’s environment properties

Public Functions

void autoMapProperties()

Automatically map all compatible properties In order to be compatible, properties must share the same name, type, length (number of elements) Const master properties cannot be mapped to non-const sub properties, however the inverse is permitted

void mapProperty(const std::string &sub_property_name, const std::string &master_property_name)

Links the named properties between the master and sub environment In order to be compatible, properties must share the same name, type, length (number of elements) Const master properties cannot be mapped to non-const sub properties, however the inverse is permitted

Parameters
  • sub_property_name – Name of the property in the sub models agent

  • master_property_name – Name of the property in the master models agent

Throws
  • InvalidParent – If the sub agent or master agent weak_ptrs have expired (this should never happen)

  • InvalidEnvProperty – If the named property does not exist within the bound sub or master environment

  • InvalidEnvProperty – If the named properties do not share the same type and length

std::string getPropertyMapping(const std::string &sub_property_name)

Returns the master agent property which has been mapped to the name subagent state

Parameters

sub_property_name – Name of the state in the sub agent to check

Throws

InvalidEnvProperty – If the sub environment property does not exist or has not been mapped yet

Returns

The name of the state within the master agent which is mapped