FMU/Source/Building.cpp
/**
 * @brief The buildings timestep function
 * @details calls the timestep function for the appliance, occupants and zones.
 * Also calls the functions to run the social interactions between occupants, and between occupants and appliances.
 */
@brief The buildings timestep function
@details calls the timestep function for the appliance, occupants and zones.
Also calls the functions to run the social interactions between occupants, and between occupants and appliances.
@brief The buildings timestep function @details calls the timestep function for the appliance occupants and zones . Also calls the functions to run the social interactions between occupants and between occupants and appliances .
void Building::step() {
  int popSize = population.size();
  std::vector<int> pop = Utility::randomIntVect(popSize);
  for (int a : pop) {
      population[a].step();
      appliances.addCurrentStates(population[a].getStateID());
  }
  for (std::shared_ptr<Building_Zone> &zone : zones) {
      if (zone->isActive()) {
        setOccupantCountForZone(zone);
        if (Configuration::info.windows
          || Configuration::info.windowsLearn) {
            setOccupantWindowDecisionForZone(zone);
        }
        if (Configuration::info.shading) {
            setOccupantBlindDecisionForZone(zone);
        }
        if (Configuration::info.lights) {
            setOccupantLightDecisionForZone(zone);
        }
        if (Configuration::info.heating) {
            setOccupantHeatDecisionsForZone(zone);
        }
        setOccupantGainsForZone(zone);
        setAppGainsForZone(zone);
      }
  }
  buildingInteractions();
  for (std::shared_ptr<Building_Zone> &zone : zones) {
    if (zone->isActive()) {
      zone->step();
    }
  }
}
void Building :: step ( ) { int popSize = population . size ( ) ; std :: vector < int > pop = Utility :: randomIntVect ( popSize ) ; for ( int a : pop ) { population [ a ] . step ( ) ; appliances . addCurrentStates ( population [ a ] . getStateID ( ) ) ; } for ( std :: shared_ptr < Building_Zone > & zone : zones ) { if ( zone -> isActive ( ) ) { setOccupantCountForZone ( zone ) ; if ( Configuration :: info . windows || Configuration :: info . windowsLearn ) { setOccupantWindowDecisionForZone ( zone ) ; } if ( Configuration :: info . shading ) { setOccupantBlindDecisionForZone ( zone ) ; } if ( Configuration :: info . lights ) { setOccupantLightDecisionForZone ( zone ) ; } if ( Configuration :: info . heating ) { setOccupantHeatDecisionsForZone ( zone ) ; } setOccupantGainsForZone ( zone ) ; setAppGainsForZone ( zone ) ; } } buildingInteractions ( ) ; for ( std :: shared_ptr < Building_Zone > & zone : zones ) { if ( zone -> isActive ( ) ) { zone -> step ( ) ; } } }
@brief The buildings timestep function
 @details calls the timestep function for the appliance, occupants and zones.
@brief The buildings timestep function @details calls the timestep function for the appliance occupants and zones .
// step each occupant //for each active zone // set number of occupants in the zone // calculate the window interaction and set for zone // calculate the shade interaction and set for zone // calculate the light interaction and set for zone // calculate the heating setpoint interaction and set for zone // calculate the occupant gains and set for zone // calculate the appliance gains and set for zone // Run BDI rules for the building // call timestep function on each zone