FMU/Source/Building.cpp
/**
 * @brief collects the occupants heatgains and sets for the zone
 * @details collects the heatgains of each occupant, calculates an average for per occupant
 * and sets the desired negotiated state to the zone
 * @param zone A pointer to a buldings zone
 */
@brief collects the occupants heatgains and sets for the zone
@details collects the heatgains of each occupant, calculates an average for per occupant
and sets the desired negotiated state to the zone
@param zone A pointer to a buldings zone
@brief collects the occupants heatgains and sets for the zone @details collects the heatgains of each occupant calculates an average for per occupant and sets the desired negotiated state to the zone @param zone A pointer to a buldings zone
void Building::setOccupantGainsForZone(std::shared_ptr<Building_Zone> zone) {
    double numberOfOccupants = 0;
    double totalRadientGains = 0;
    double aveRadientGains = 0;
    for (Occupant &agent : population) {
        if  (agent.isActionHeatGains(*zone)) {
            numberOfOccupants++;
            totalRadientGains += agent.getCurrentRadientGains(*zone);
        }
    }
    if (totalRadientGains > 0) {
        aveRadientGains = totalRadientGains / numberOfOccupants;
    }
    zone->setCurrentOccupantGains(aveRadientGains);
}
void Building :: setOccupantGainsForZone ( std :: shared_ptr < Building_Zone > zone ) { double numberOfOccupants = 0 ; double totalRadientGains = 0 ; double aveRadientGains = 0 ; for ( Occupant & agent : population ) { if ( agent . isActionHeatGains ( * zone ) ) { numberOfOccupants ++ ; totalRadientGains += agent . getCurrentRadientGains ( * zone ) ; } } if ( totalRadientGains > 0 ) { aveRadientGains = totalRadientGains / numberOfOccupants ; } zone -> setCurrentOccupantGains ( aveRadientGains ) ; }
@brief collects the occupants heatgains and sets for the zone
 @details collects the heatgains of each occupant, calculates an average for per occupant
 and sets the desired negotiated state to the zone
 @param zone A pointer to a buldings zone
@brief collects the occupants heatgains and sets for the zone @details collects the heatgains of each occupant calculates an average for per occupant and sets the desired negotiated state to the zone @param zone A pointer to a buldings zone