FMU/Source/Occupant.cpp
/**
 * @brief matches a state to a zone
 * @param s     The state
 * @param zones zones to be searched for which the state will belong
 */
@brief matches a state to a zone
@param s     The state
@param zones zones to be searched for which the state will belong
@brief matches a state to a zone @param s The state @param zones zones to be searched for which the state will belong
void Occupant::matchStateToZone(State *s,
                  const std::vector<std::shared_ptr<Building_Zone>> &zones) {
    for (unsigned int i =0; i < zones.size(); i++) {
      if (Configuration::info.presencePage &&
          zones[i]->hasActivity(3) &&
          !zones[i]->isNamed(office)) {
        continue;
      }
      if (!Configuration::info.presencePage &&
          zones[i]->hasActivity(0) &&
          !zones[i]->isNamed(bedroom) &&
          zones[i]->getNumberOfActivities() == 1) {
        continue;
      }
      if (zones[i]->hasActivity(s->getId())) {
          s->setZonePtr(zones[i]);
          break;
      }
    }
}
void Occupant :: matchStateToZone ( State * s , const std :: vector < std :: shared_ptr < Building_Zone > > & zones ) { for ( unsigned int i = 0 ; i < zones . size ( ) ; i ++ ) { if ( Configuration :: info . presencePage && zones [ i ] -> hasActivity ( 3 ) && ! zones [ i ] -> isNamed ( office ) ) { continue ; } if ( ! Configuration :: info . presencePage && zones [ i ] -> hasActivity ( 0 ) && ! zones [ i ] -> isNamed ( bedroom ) && zones [ i ] -> getNumberOfActivities ( ) == 1 ) { continue ; } if ( zones [ i ] -> hasActivity ( s -> getId ( ) ) ) { s -> setZonePtr ( zones [ i ] ) ; break ; } } }
@brief matches a state to a zone
 @param s     The state
 @param zones zones to be searched for which the state will belong
@brief matches a state to a zone @param s The state @param zones zones to be searched for which the state will belong