FMU/Source/Building.cpp
/**
  * @brief Set up the building from the configuration struct
  * @details Setup the building, adds the zones, adds the occupants, adds the appliances
  * @param buildingInput The configuration struct which values have been populated form configuration file
  */
@brief Set up the building from the configuration struct
@details Setup the building, adds the zones, adds the occupants, adds the appliances
@param buildingInput The configuration struct which values have been populated form configuration file
@brief Set up the building from the configuration struct @details Setup the building adds the zones adds the occupants adds the appliances @param buildingInput The configuration struct which values have been populated form configuration file
void Building::setup(const ConfigStructBuilding &buildingInput) {
    name = buildingInput.name;
    id = buildingInput.id;
    std::string buildingID = "Building" + std::to_string(id) + "_";
    for (std::pair<std::string, ConfigStructZone> z : buildingInput.zones) {
      zones.push_back(std::make_shared<Building_Zone>(Building_Zone()));
      zones.back()->setName(z.second.name);
      zones.back()->setActive(z.second.active);
      zones.back()->setIDString(buildingID + z.second.name);
      zones.back()->setup(z.second);
    }
    int popSize = buildingInput.agents.size();
    std::vector<int> pop = Utility::randomIntVect(popSize);
    for (int a : pop) {
      std::string occid = std::to_string(a);
      population.push_back(Occupant());
      population.back().setBuildingID(id);
      population.back().setBuildingName(name);
      population.back().setIDString(buildingID + "Occupant" + occid + "_");
      population.back().setup(a, buildingInput.agents[a], zones);
    }
    appliances.setup(buildingInput);
}
void Building :: setup ( const ConfigStructBuilding & buildingInput ) { name = buildingInput . name ; id = buildingInput . id ; std :: string buildingID = " " + std :: to_string ( id ) + " " ; for ( std :: pair < std :: string , ConfigStructZone > z : buildingInput . zones ) { zones . push_back ( std :: make_shared < Building_Zone > ( Building_Zone ( ) ) ) ; zones . back ( ) -> setName ( z . second . name ) ; zones . back ( ) -> setActive ( z . second . active ) ; zones . back ( ) -> setIDString ( buildingID + z . second . name ) ; zones . back ( ) -> setup ( z . second ) ; } int popSize = buildingInput . agents . size ( ) ; std :: vector < int > pop = Utility :: randomIntVect ( popSize ) ; for ( int a : pop ) { std :: string occid = std :: to_string ( a ) ; population . push_back ( Occupant ( ) ) ; population . back ( ) . setBuildingID ( id ) ; population . back ( ) . setBuildingName ( name ) ; population . back ( ) . setIDString ( buildingID + " " + occid + " " ) ; population . back ( ) . setup ( a , buildingInput . agents [ a ] , zones ) ; } appliances . setup ( buildingInput ) ; }
@brief Set up the building from the configuration struct
 @details Setup the building, adds the zones, adds the occupants, adds the appliances
 @param buildingInput The configuration struct which values have been populated form configuration file
@brief Set up the building from the configuration struct @details Setup the building adds the zones adds the occupants adds the appliances @param buildingInput The configuration struct which values have been populated form configuration file
// setup each agent randomly