FMU/Source/Occupant.cpp
/**
 * @brief Initialises the states and assigns them to a zone
 * @details builds the states an occupant can be in, and then matches the states
 * to their corresponding zones
 * @param zones Zones that the occupant can inhabit
 */
@brief Initialises the states and assigns them to a zone
@details builds the states an occupant can be in, and then matches the states
to their corresponding zones
@param zones Zones that the occupant can inhabit
@brief Initialises the states and assigns them to a zone @details builds the states an occupant can be in and then matches the states to their corresponding zones @param zones Zones that the occupant can inhabit
void Occupant::initialiseStates(
                  const std::vector<std::shared_ptr<Building_Zone>> &zones) {
    State present(-100,-1,-1,"");
    if (Configuration::info.presencePage) {
        State it(3, 70, 1, "IT");
        matchStateToZone(&it, zones);
        present.addState(it);
    } else {
        State sleep(0, 46, 2.55, "Sleep");
        State passive(1, 58, 1, "Passive");
        State audioVisual(2, 70, 1, "AudioVisual");
        State it(3, 70, 1, "IT");
        State cooking(4, 116, 1, "Cooking");
        State cleaning(5, 116, 1, "Cleaning");
        State washing(6, 116, 0, "Washing");
        State metabolic(7, 93, 1, "Metabolic");
        State washingAppliance(8, 116, 1, "WashingAppliance");
        matchStateToZone(&sleep, zones);
        matchStateToZone(&passive, zones);
        matchStateToZone(&washingAppliance, zones);
        matchStateToZone(&washing, zones);
        matchStateToZone(&audioVisual, zones);
        matchStateToZone(&cleaning, zones);
        matchStateToZone(&cooking, zones);
        matchStateToZone(&metabolic, zones);
        matchStateToZone(&it, zones);
        present.addState(sleep);
        present.addState(passive);
        present.addState(washingAppliance);
        present.addState(washing);
        present.addState(audioVisual);
        present.addState(cleaning);
        present.addState(cooking);
        present.addState(metabolic);
        present.addState(it);
    }
    stateMachine.addState(present);
    State out(9, 0, 1, "Out");
    matchStateToZone(&out, zones);
    stateMachine.addState(out);
    setState(out);
}
void Occupant :: initialiseStates ( const std :: vector < std :: shared_ptr < Building_Zone > > & zones ) { State present ( -100 , -1 , -1 , " " ) ; if ( Configuration :: info . presencePage ) { State it ( 3 , 70 , 1 , " " ) ; matchStateToZone ( & it , zones ) ; present . addState ( it ) ; } else { State sleep ( 0 , 46 , 2.55 , " " ) ; State passive ( 1 , 58 , 1 , " " ) ; State audioVisual ( 2 , 70 , 1 , " " ) ; State it ( 3 , 70 , 1 , " " ) ; State cooking ( 4 , 116 , 1 , " " ) ; State cleaning ( 5 , 116 , 1 , " " ) ; State washing ( 6 , 116 , 0 , " " ) ; State metabolic ( 7 , 93 , 1 , " " ) ; State washingAppliance ( 8 , 116 , 1 , " " ) ; matchStateToZone ( & sleep , zones ) ; matchStateToZone ( & passive , zones ) ; matchStateToZone ( & washingAppliance , zones ) ; matchStateToZone ( & washing , zones ) ; matchStateToZone ( & audioVisual , zones ) ; matchStateToZone ( & cleaning , zones ) ; matchStateToZone ( & cooking , zones ) ; matchStateToZone ( & metabolic , zones ) ; matchStateToZone ( & it , zones ) ; present . addState ( sleep ) ; present . addState ( passive ) ; present . addState ( washingAppliance ) ; present . addState ( washing ) ; present . addState ( audioVisual ) ; present . addState ( cleaning ) ; present . addState ( cooking ) ; present . addState ( metabolic ) ; present . addState ( it ) ; } stateMachine . addState ( present ) ; State out ( 9 , 0 , 1 , " " ) ; matchStateToZone ( & out , zones ) ; stateMachine . addState ( out ) ; setState ( out ) ; }
@brief Initialises the states and assigns them to a zone
 @details builds the states an occupant can be in, and then matches the states
 to their corresponding zones
 @param zones Zones that the occupant can inhabit
@brief Initialises the states and assigns them to a zone @details builds the states an occupant can be in and then matches the states to their corresponding zones @param zones Zones that the occupant can inhabit