src/model/PeopleDefinition.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_PEOPLEDEFINITION_HPP | ||
| 7 | #define MODEL_PEOPLEDEFINITION_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "SpaceLoadDefinition.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | class PeopleDefinition_Impl; | ||
| 18 | |||
| 19 | } // namespace detail | ||
| 20 | |||
| 21 | /** PeopleDefinition is a SpaceLoadDefinition that wraps the OpenStudio IDD object | ||
| 22 | * 'OS_People_Definition'. Its fields are derived from the EnergyPlus IDD object 'People'. | ||
| 23 | * \sa People | ||
| 24 | */ | ||
| 25 | class MODEL_API PeopleDefinition : public SpaceLoadDefinition | ||
| 26 | { | ||
| 27 | public: | ||
| 28 | /** @name Constructors and Destructors */ | ||
| 29 | //@{ | ||
| 30 | |||
| 31 | explicit PeopleDefinition(const Model& model); | ||
| 32 | |||
| 33 | 1063 | virtual ~PeopleDefinition() override = default; | |
| 34 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 35 | ✗ | PeopleDefinition(const PeopleDefinition& other) = default; | |
| 36 | 11 | PeopleDefinition(PeopleDefinition&& other) = default; | |
| 37 | ✗ | PeopleDefinition& operator=(const PeopleDefinition&) = default; | |
| 38 | ✗ | PeopleDefinition& operator=(PeopleDefinition&&) = default; | |
| 39 | |||
| 40 | //@} | ||
| 41 | |||
| 42 | static IddObjectType iddObjectType(); | ||
| 43 | |||
| 44 | static std::vector<std::string> numberofPeopleCalculationMethodValues(); | ||
| 45 | |||
| 46 | static std::vector<std::string> meanRadiantTemperatureCalculationTypeValues(); | ||
| 47 | |||
| 48 | static std::vector<std::string> thermalComfortModelTypeValues(); | ||
| 49 | |||
| 50 | /** @name Getters */ | ||
| 51 | //@{ | ||
| 52 | |||
| 53 | std::string numberofPeopleCalculationMethod() const; | ||
| 54 | |||
| 55 | boost::optional<double> numberofPeople() const; | ||
| 56 | |||
| 57 | boost::optional<double> peopleperSpaceFloorArea() const; | ||
| 58 | |||
| 59 | boost::optional<double> spaceFloorAreaperPerson() const; | ||
| 60 | |||
| 61 | double fractionRadiant() const; | ||
| 62 | |||
| 63 | boost::optional<double> sensibleHeatFraction() const; | ||
| 64 | |||
| 65 | bool isSensibleHeatFractionDefaulted() const; | ||
| 66 | |||
| 67 | bool isSensibleHeatFractionAutocalculated() const; | ||
| 68 | |||
| 69 | double carbonDioxideGenerationRate() const; | ||
| 70 | |||
| 71 | bool isCarbonDioxideGenerationRateDefaulted() const; | ||
| 72 | |||
| 73 | bool enableASHRAE55ComfortWarnings() const; | ||
| 74 | |||
| 75 | bool isEnableASHRAE55ComfortWarningsDefaulted() const; | ||
| 76 | |||
| 77 | std::string meanRadiantTemperatureCalculationType() const; | ||
| 78 | |||
| 79 | bool isMeanRadiantTemperatureCalculationTypeDefaulted() const; | ||
| 80 | |||
| 81 | /** Return the thermal comfort model type in extensible group i. Indexing starts at 0, and | ||
| 82 | * i should be less than numThermalComfortModelTypes. */ | ||
| 83 | boost::optional<std::string> getThermalComfortModelType(int i) const; | ||
| 84 | |||
| 85 | /** Returns the number of thermal comfort model types registered in this object. */ | ||
| 86 | int numThermalComfortModelTypes() const; | ||
| 87 | |||
| 88 | //@} | ||
| 89 | /** @name Setters */ | ||
| 90 | //@{ | ||
| 91 | |||
| 92 | /** Also sets numberofPeopleCalculationMethod accordingly. */ | ||
| 93 | bool setNumberofPeople(double numberofPeople); | ||
| 94 | |||
| 95 | /** Also sets numberofPeopleCalculationMethod accordingly. */ | ||
| 96 | bool setPeopleperSpaceFloorArea(double peopleperSpaceFloorArea); | ||
| 97 | |||
| 98 | /** Also sets numberofPeopleCalculationMethod accordingly. */ | ||
| 99 | bool setSpaceFloorAreaperPerson(double spaceFloorAreaperPerson); | ||
| 100 | |||
| 101 | bool setFractionRadiant(double fractionRadiant); | ||
| 102 | |||
| 103 | bool setSensibleHeatFraction(double sensibleHeatFraction); | ||
| 104 | |||
| 105 | void resetSensibleHeatFraction(); | ||
| 106 | |||
| 107 | void autocalculateSensibleHeatFraction(); | ||
| 108 | |||
| 109 | bool setCarbonDioxideGenerationRate(double carbonDioxideGenerationRate); | ||
| 110 | |||
| 111 | void resetCarbonDioxideGenerationRate(); | ||
| 112 | |||
| 113 | bool setEnableASHRAE55ComfortWarnings(bool enableASHRAE55ComfortWarnings); | ||
| 114 | |||
| 115 | void resetEnableASHRAE55ComfortWarnings(); | ||
| 116 | |||
| 117 | bool setMeanRadiantTemperatureCalculationType(const std::string& meanRadiantTemperatureCalculationType); | ||
| 118 | |||
| 119 | void resetMeanRadiantTemperatureCalculationType(); | ||
| 120 | |||
| 121 | bool pushThermalComfortModelType(const std::string& thermalComfortModelType); | ||
| 122 | |||
| 123 | bool setThermalComfortModelType(int i, const std::string& thermalComfortModelType); | ||
| 124 | |||
| 125 | bool eraseThermalComfortModelType(int i); | ||
| 126 | |||
| 127 | //@} | ||
| 128 | /** @name Other */ | ||
| 129 | //@{ | ||
| 130 | |||
| 131 | /** Returns the number of people represented by this definition, assuming floorArea (m^2). */ | ||
| 132 | double getNumberOfPeople(double floorArea) const; | ||
| 133 | |||
| 134 | /** Returns the people/m^2 represented by this definition, assuming floorArea (m^2). */ | ||
| 135 | double getPeoplePerFloorArea(double floorArea) const; | ||
| 136 | |||
| 137 | /** Returns the m^2/person represented by this definition, assuming floorArea (m^2). */ | ||
| 138 | double getFloorAreaPerPerson(double floorArea) const; | ||
| 139 | |||
| 140 | /** If method is a \link numberofPeopleCalculationMethodValues valid number of people | ||
| 141 | * calculation method \endlink, changes this definition to an equivalent number of people, | ||
| 142 | * under the assumption of floorArea (m^2). */ | ||
| 143 | bool setNumberOfPeopleCalculationMethod(const std::string& method, double floorArea); | ||
| 144 | |||
| 145 | //@} | ||
| 146 | protected: | ||
| 147 | /// @cond | ||
| 148 | using ImplType = detail::PeopleDefinition_Impl; | ||
| 149 | |||
| 150 | friend class Model; | ||
| 151 | friend class openstudio::IdfObject; | ||
| 152 | |||
| 153 | explicit PeopleDefinition(std::shared_ptr<detail::PeopleDefinition_Impl> impl); | ||
| 154 | |||
| 155 | /// @endcond | ||
| 156 | private: | ||
| 157 | REGISTER_LOGGER("openstudio.model.PeopleDefinition"); | ||
| 158 | }; | ||
| 159 | |||
| 160 | /** \relates PeopleDefinition*/ | ||
| 161 | using OptionalPeopleDefinition = boost::optional<PeopleDefinition>; | ||
| 162 | |||
| 163 | /** \relates PeopleDefinition*/ | ||
| 164 | using PeopleDefinitionVector = std::vector<PeopleDefinition>; | ||
| 165 | |||
| 166 | } // namespace model | ||
| 167 | } // namespace openstudio | ||
| 168 | |||
| 169 | #endif // MODEL_PEOPLEDEFINITION_HPP | ||
| 170 |