FMU/Source/Building.cpp
/**
 * @brief collects the occupants light choices and sets for the zone
 * @details collects the light choice of each occupant, calls the negotiate function
 * on the collected values and sets the desired negotiated state to the zone
 * @param zone A pointer to a buldings zone
 */
@brief collects the occupants light choices and sets for the zone
@details collects the light choice of each occupant, calls the negotiate function
on the collected values and sets the desired negotiated state to the zone
@param zone A pointer to a buldings zone
@brief collects the occupants light choices and sets for the zone @details collects the light choice of each occupant calls the negotiate function on the collected values and sets the desired negotiated state to the zone @param zone A pointer to a buldings zone
void Building::setOccupantLightDecisionForZone(
        std::shared_ptr<Building_Zone> zone) {
    double open = 0;
    double close = 0;
    double numberOfActiveOccupants = 0;
    for (const Occupant &agent : population) {
        if (agent.isActionLights(*zone)) {
            numberOfActiveOccupants++;
            double power = agent.getPower();
            if (agent.getDesiredLightState(*zone)) {
                open = open + power;
            } else {
                close = close + power;
            }
        }
    }
    if (numberOfActiveOccupants > 0.0) {
        zone->setLightState(decisionBoolean(close, open));
    }
}
void Building :: setOccupantLightDecisionForZone ( std :: shared_ptr < Building_Zone > zone ) { double open = 0 ; double close = 0 ; double numberOfActiveOccupants = 0 ; for ( const Occupant & agent : population ) { if ( agent . isActionLights ( * zone ) ) { numberOfActiveOccupants ++ ; double power = agent . getPower ( ) ; if ( agent . getDesiredLightState ( * zone ) ) { open = open + power ; } else { close = close + power ; } } } if ( numberOfActiveOccupants > 0.0 ) { zone -> setLightState ( decisionBoolean ( close , open ) ) ; } }
@brief collects the occupants light choices and sets for the zone
 @details collects the light choice of each occupant, calls the negotiate function
 on the collected values and sets the desired negotiated state to the zone
 @param zone A pointer to a buldings zone
@brief collects the occupants light choices and sets for the zone @details collects the light choice of each occupant calls the negotiate function on the collected values and sets the desired negotiated state to the zone @param zone A pointer to a buldings zone