src/model/People_Impl.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #ifndef MODEL_PEOPLE_IMPL_HPP | ||
| 7 | #define MODEL_PEOPLE_IMPL_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "SpaceLoadInstance_Impl.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | class Schedule; | ||
| 16 | class PeopleDefinition; | ||
| 17 | class People; | ||
| 18 | class Space; | ||
| 19 | class SpaceType; | ||
| 20 | |||
| 21 | namespace detail { | ||
| 22 | |||
| 23 | /** People_Impl is a SpaceLoadInstance_Impl that is the implementation class for People.*/ | ||
| 24 | class MODEL_API People_Impl : public SpaceLoadInstance_Impl | ||
| 25 | { | ||
| 26 | public: | ||
| 27 | /** @name Constructors and Destructors */ | ||
| 28 | //@{ | ||
| 29 | |||
| 30 | People_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); | ||
| 31 | |||
| 32 | People_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 33 | |||
| 34 | People_Impl(const People_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 35 | |||
| 36 | 1900 | virtual ~People_Impl() override = default; | |
| 37 | |||
| 38 | //@} | ||
| 39 | /** @name Virtual Methods */ | ||
| 40 | //@{ | ||
| 41 | |||
| 42 | virtual const std::vector<std::string>& outputVariableNames() const override; | ||
| 43 | |||
| 44 | virtual std::vector<openstudio::IdfObject> remove() override; | ||
| 45 | |||
| 46 | virtual IddObjectType iddObjectType() const override; | ||
| 47 | |||
| 48 | virtual std::vector<ScheduleTypeKey> getScheduleTypeKeys(const Schedule& schedule) const override; | ||
| 49 | |||
| 50 | virtual bool hardSize() override; | ||
| 51 | |||
| 52 | virtual bool hardApplySchedules() override; | ||
| 53 | |||
| 54 | virtual double multiplier() const override; | ||
| 55 | |||
| 56 | virtual bool isMultiplierDefaulted() const override; | ||
| 57 | |||
| 58 | virtual bool isAbsolute() const override; | ||
| 59 | |||
| 60 | //@} | ||
| 61 | /** @name Getters */ | ||
| 62 | //@{ | ||
| 63 | |||
| 64 | /** Gets the PeopleDefinition object. */ | ||
| 65 | PeopleDefinition peopleDefinition() const; | ||
| 66 | |||
| 67 | /** Returns the number of people schedule. If this object does not | ||
| 68 | * specify a schedule this function will search the hierarchy. */ | ||
| 69 | boost::optional<Schedule> numberofPeopleSchedule() const; | ||
| 70 | |||
| 71 | /** Returns true if this object does not specify a number of people schedule directly. */ | ||
| 72 | bool isNumberofPeopleScheduleDefaulted() const; | ||
| 73 | |||
| 74 | /** Returns the activity schedule. If this object does not | ||
| 75 | * specify a schedule this function will search the hierarchy. */ | ||
| 76 | boost::optional<Schedule> activityLevelSchedule() const; | ||
| 77 | |||
| 78 | /** Returns true if this object does not specify an activity directly. */ | ||
| 79 | bool isActivityLevelScheduleDefaulted() const; | ||
| 80 | |||
| 81 | /** Returns the work efficiency schedule. */ | ||
| 82 | boost::optional<Schedule> workEfficiencySchedule() const; | ||
| 83 | |||
| 84 | /** Returns the clothing insulation calculation method. */ | ||
| 85 | std::string clothingInsulationCalculationMethod() const; | ||
| 86 | |||
| 87 | /** Returns the clothing insulation calculation method schedule. */ | ||
| 88 | boost::optional<Schedule> clothingInsulationCalculationMethodSchedule() const; | ||
| 89 | |||
| 90 | /** Returns the clothing insulation schedule. */ | ||
| 91 | boost::optional<Schedule> clothingInsulationSchedule() const; | ||
| 92 | |||
| 93 | /** Returns the air velocity schedule. */ | ||
| 94 | boost::optional<Schedule> airVelocitySchedule() const; | ||
| 95 | |||
| 96 | boost::optional<Schedule> ankleLevelAirVelocitySchedule() const; | ||
| 97 | |||
| 98 | boost::optional<ModelObject> surfaceNameAngleFactorListName() const; | ||
| 99 | |||
| 100 | double coldStressTemperatureThreshold() const; | ||
| 101 | bool isColdStressTemperatureThresholdDefaulted() const; | ||
| 102 | |||
| 103 | double heatStressTemperatureThreshold() const; | ||
| 104 | bool isHeatStressTemperatureThresholdDefaulted() const; | ||
| 105 | |||
| 106 | //@} | ||
| 107 | /** @name Setters */ | ||
| 108 | //@{ | ||
| 109 | |||
| 110 | /** Sets the PeopleDefinition object. */ | ||
| 111 | bool setPeopleDefinition(const PeopleDefinition& definition); | ||
| 112 | |||
| 113 | /** Sets the definition of this instance. */ | ||
| 114 | virtual bool setDefinition(const SpaceLoadDefinition& definition) override; | ||
| 115 | |||
| 116 | /** Sets the number of people Schedule. */ | ||
| 117 | bool setNumberofPeopleSchedule(Schedule& schedule); | ||
| 118 | |||
| 119 | /** Resets the number of people Schedule. */ | ||
| 120 | void resetNumberofPeopleSchedule(); | ||
| 121 | |||
| 122 | /** Sets the activity Schedule. */ | ||
| 123 | bool setActivityLevelSchedule(Schedule& schedule); | ||
| 124 | |||
| 125 | /** Resets the activity Schedule. */ | ||
| 126 | void resetActivityLevelSchedule(); | ||
| 127 | |||
| 128 | // TODO: Handle Non-Extensible IddField Surface Name/Angle Factor List Name. | ||
| 129 | |||
| 130 | /** Sets the work efficiency Schedule. */ | ||
| 131 | bool setWorkEfficiencySchedule(Schedule& schedule); | ||
| 132 | |||
| 133 | /** Resets the work efficiency Schedule. */ | ||
| 134 | void resetWorkEfficiencySchedule(); | ||
| 135 | |||
| 136 | /** Sets the clothing insulation calculation method. */ | ||
| 137 | bool setClothingInsulationCalculationMethod(const std::string& clothingInsulationCalculationMethod); | ||
| 138 | |||
| 139 | /** Sets the clothing insulation calculation method schedule. */ | ||
| 140 | bool setClothingInsulationCalculationMethodSchedule(Schedule& schedule); | ||
| 141 | |||
| 142 | /** Resets the clothing insulation calculationg method schedule. */ | ||
| 143 | void resetClothingInsulationCalculationMethodSchedule(); | ||
| 144 | |||
| 145 | /** Sets the clothing insulation Schedule. */ | ||
| 146 | bool setClothingInsulationSchedule(Schedule& schedule); | ||
| 147 | |||
| 148 | /** Resets the clothing insulation Schedule. */ | ||
| 149 | void resetClothingInsulationSchedule(); | ||
| 150 | |||
| 151 | /** Sets the air velocity Schedule. */ | ||
| 152 | bool setAirVelocitySchedule(Schedule& schedule); | ||
| 153 | |||
| 154 | /** Resets the air velocity Schedule. */ | ||
| 155 | void resetAirVelocitySchedule(); | ||
| 156 | |||
| 157 | bool setMultiplier(double multiplier); | ||
| 158 | |||
| 159 | void resetMultiplier(); | ||
| 160 | |||
| 161 | bool setAnkleLevelAirVelocitySchedule(Schedule& schedule); | ||
| 162 | void resetAnkleLevelAirVelocitySchedule(); | ||
| 163 | |||
| 164 | bool setSurfaceNameAngleFactorListName(const ModelObject& modelObject); | ||
| 165 | void resetSurfaceNameAngleFactorListName(); | ||
| 166 | |||
| 167 | bool setColdStressTemperatureThreshold(double coldStressTemperatureThreshold); | ||
| 168 | void resetColdStressTemperatureThreshold(); | ||
| 169 | |||
| 170 | bool setHeatStressTemperatureThreshold(double heatStressTemperatureThreshold); | ||
| 171 | void resetHeatStressTemperatureThreshold(); | ||
| 172 | |||
| 173 | //@} | ||
| 174 | /** @name Other */ | ||
| 175 | //@{ | ||
| 176 | |||
| 177 | boost::optional<double> numberOfPeople() const; | ||
| 178 | |||
| 179 | boost::optional<double> peoplePerFloorArea() const; | ||
| 180 | |||
| 181 | boost::optional<double> spaceFloorAreaPerPerson() const; | ||
| 182 | |||
| 183 | /** Returns the number of people represented by this instance, assuming floorArea (m^2). */ | ||
| 184 | double getNumberOfPeople(double floorArea) const; | ||
| 185 | |||
| 186 | /** Returns the people/m^2 represented by this instance, assuming floorArea (m^2). */ | ||
| 187 | double getPeoplePerFloorArea(double floorArea) const; | ||
| 188 | |||
| 189 | /** Returns the m^2/person represented by this instance, assuming floorArea (m^2). */ | ||
| 190 | double getFloorAreaPerPerson(double floorArea) const; | ||
| 191 | |||
| 192 | virtual std::vector<EMSActuatorNames> emsActuatorNames() const override; | ||
| 193 | |||
| 194 | virtual std::vector<std::string> emsInternalVariableNames() const override; | ||
| 195 | |||
| 196 | //@} | ||
| 197 | protected: | ||
| 198 | // index of the space name | ||
| 199 | virtual int spaceIndex() const override; | ||
| 200 | |||
| 201 | // index of the definition name | ||
| 202 | virtual int definitionIndex() const override; | ||
| 203 | |||
| 204 | private: | ||
| 205 | − | REGISTER_LOGGER("openstudio.model.People"); | |
| 206 | |||
| 207 | void removeZoneMRTCalculationReferences(); | ||
| 208 | |||
| 209 | boost::optional<ModelObject> peopleDefinitionAsModelObject() const; | ||
| 210 | boost::optional<ModelObject> numberofPeopleScheduleAsModelObject() const; | ||
| 211 | boost::optional<ModelObject> activityLevelScheduleAsModelObject() const; | ||
| 212 | boost::optional<ModelObject> workEfficiencyScheduleAsModelObject() const; | ||
| 213 | boost::optional<ModelObject> clothingInsulationScheduleAsModelObject() const; | ||
| 214 | boost::optional<ModelObject> airVelocityScheduleAsModelObject() const; | ||
| 215 | boost::optional<ModelObject> ankleLevelAirVelocityScheduleAsModelObject() const; | ||
| 216 | |||
| 217 | bool setPeopleDefinitionAsModelObject(const boost::optional<ModelObject>& modelObject); | ||
| 218 | bool setNumberofPeopleScheduleAsModelObject(const boost::optional<ModelObject>& modelObject); | ||
| 219 | bool setActivityLevelScheduleAsModelObject(const boost::optional<ModelObject>& modelObject); | ||
| 220 | bool setWorkEfficiencyScheduleAsModelObject(const boost::optional<ModelObject>& modelObject); | ||
| 221 | bool setClothingInsulationScheduleAsModelObject(const boost::optional<ModelObject>& modelObject); | ||
| 222 | bool setAirVelocityScheduleAsModelObject(const boost::optional<ModelObject>& modelObject); | ||
| 223 | bool setAnkleLevelAirVelocityScheduleAsModelObject(const boost::optional<ModelObject>& modelObject); | ||
| 224 | }; | ||
| 225 | |||
| 226 | } // namespace detail | ||
| 227 | |||
| 228 | } // namespace model | ||
| 229 | } // namespace openstudio | ||
| 230 | |||
| 231 | #endif // MODEL_PEOPLE_IMPL_HPP | ||
| 232 |