GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.0% 4 / 0 / 5
Functions: 80.0% 4 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/People.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_HPP
7 #define MODEL_PEOPLE_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceLoadInstance.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class Schedule;
16 class PeopleDefinition;
17
18 namespace detail {
19
20 class People_Impl;
21
22 } // namespace detail
23
24 /** People is a SpaceLoadInstance that wraps the OpenStudio IDD object 'OS_People'. Its fields are
25 * derived from the EnergyPlus IDD object 'People'. \sa PeopleDefinition
26 */
27 class MODEL_API People : public SpaceLoadInstance
28 {
29 public:
30 /** @name Constructors and Destructors */
31 //@{
32
33 explicit People(const PeopleDefinition& peopleDefinition);
34
35 2319 virtual ~People() override = default;
36 // Default the copy and move operators because the virtual dtor is explicit
37 84 People(const People& other) = default;
38 936 People(People&& other) = default;
39 ✗ People& operator=(const People&) = default;
40 9 People& operator=(People&&) = default;
41
42 //@}
43
44 static IddObjectType iddObjectType();
45
46 static std::vector<std::string> clothingInsulationCalculationMethodValues();
47
48 /** @name Getters */
49 //@{
50
51 /** Gets the PeopleDefinition object. */
52 PeopleDefinition peopleDefinition() const;
53
54 /** Returns the number of people schedule. If this object does not
55 * specify a schedule this function will search the hierarchy. */
56 boost::optional<Schedule> numberofPeopleSchedule() const;
57
58 /** Returns true if this object does not specify a number of people schedule directly. */
59 bool isNumberofPeopleScheduleDefaulted() const;
60
61 /** Returns the activity schedule. If this object does not
62 * specify a schedule this function will search the hierarchy. */
63 boost::optional<Schedule> activityLevelSchedule() const;
64
65 /** Returns true if this object does not specify an activity directly. */
66 bool isActivityLevelScheduleDefaulted() const;
67
68 /** Returns the work efficiency schedule. */
69 boost::optional<Schedule> workEfficiencySchedule() const;
70
71 /** Returns the clothing insulation calculation method. */
72 std::string clothingInsulationCalculationMethod() const;
73
74 /** Returns the clothing insulation calculation method schedule. */
75 boost::optional<Schedule> clothingInsulationCalculationMethodSchedule() const;
76
77 /** Returns the clothing insulation schedule. */
78 boost::optional<Schedule> clothingInsulationSchedule() const;
79
80 /** Returns the air velocity schedule. */
81 boost::optional<Schedule> airVelocitySchedule() const;
82
83 /** Returns the ankle-level air velocity schedule. */
84 boost::optional<Schedule> ankleLevelAirVelocitySchedule() const;
85
86 boost::optional<ModelObject> surfaceNameAngleFactorListName() const;
87
88 double coldStressTemperatureThreshold() const;
89 bool isColdStressTemperatureThresholdDefaulted() const;
90
91 double heatStressTemperatureThreshold() const;
92 bool isHeatStressTemperatureThresholdDefaulted() const;
93
94 //@}
95 /** @name Setters */
96 //@{
97
98 /** Sets the PeopleDefinition object. */
99 bool setPeopleDefinition(const PeopleDefinition& definition);
100
101 /** Sets the number of people Schedule. Returns false if schedule has a ScheduleTypeLimits
102 * that is incompatible with this use. Sets the ScheduleTypeLimits of schedule if there is
103 * none. */
104 bool setNumberofPeopleSchedule(Schedule& schedule);
105
106 /** Resets the number of people Schedule. */
107 void resetNumberofPeopleSchedule();
108
109 /** Sets the activity Schedule. Returns false if schedule has a ScheduleTypeLimits
110 * that is incompatible with this use. Sets the ScheduleTypeLimits of schedule if there is
111 * none. */
112 bool setActivityLevelSchedule(Schedule& schedule);
113
114 /** Resets the activity Schedule. */
115 void resetActivityLevelSchedule();
116
117 /** Sets the work efficiency Schedule. Returns false if schedule has a ScheduleTypeLimits
118 * that is incompatible with this use. Sets the ScheduleTypeLimits of schedule if there is
119 * none. */
120 bool setWorkEfficiencySchedule(Schedule& schedule);
121
122 /** Resets the work efficiency Schedule. */
123 void resetWorkEfficiencySchedule();
124
125 /** Sets the clothing insulation calculation method. */
126 bool setClothingInsulationCalculationMethod(const std::string& clothingInsulationCalculationMethod);
127
128 /** Sets the clothing insulation calculation method schedule. */
129 bool setClothingInsulationCalculationMethodSchedule(Schedule& schedule);
130
131 /** Resets the clothing insulation calculationg method schedule. */
132 void resetClothingInsulationCalculationMethodSchedule();
133
134 /** Sets the clothing insulation Schedule. Returns false if schedule has a ScheduleTypeLimits
135 * that is incompatible with this use. Sets the ScheduleTypeLimits of schedule if there is
136 * none. */
137 bool setClothingInsulationSchedule(Schedule& schedule);
138
139 /** Resets the clothing insulation Schedule. */
140 void resetClothingInsulationSchedule();
141
142 /** Sets the air velocity Schedule. Returns false if schedule has a ScheduleTypeLimits
143 * that is incompatible with this use. Sets the ScheduleTypeLimits of schedule if there is
144 * none. */
145 bool setAirVelocitySchedule(Schedule& schedule);
146
147 /** Resets the air velocity Schedule. */
148 void resetAirVelocitySchedule();
149
150 bool setMultiplier(double multiplier);
151
152 void resetMultiplier();
153
154 bool setAnkleLevelAirVelocitySchedule(Schedule& schedule);
155 void resetAnkleLevelAirVelocitySchedule();
156
157 bool setSurfaceNameAngleFactorListName(const ModelObject& modelObject);
158 void resetSurfaceNameAngleFactorListName();
159
160 bool setColdStressTemperatureThreshold(double coldStressTemperatureThreshold);
161 void resetColdStressTemperatureThreshold();
162
163 bool setHeatStressTemperatureThreshold(double heatStressTemperatureThreshold);
164 void resetHeatStressTemperatureThreshold();
165
166 //@}
167 /** @name Other */
168 //@{
169
170 /** Returns the numberOfPeople if possible based on the underlying data of
171 * peopleDefinition(). */
172 boost::optional<double> numberOfPeople() const;
173
174 /** Returns the peoplePerFloorArea if possible based on the underlying data of
175 * peopleDefinition(). */
176 boost::optional<double> peoplePerFloorArea() const;
177
178 /** Returns the spaceFloorAreaPerPerson if possible based on the underlying data of
179 * peopleDefinition(). */
180 boost::optional<double> spaceFloorAreaPerPerson() const;
181
182 /** Returns the number of people represented by this instance, assuming floorArea (m^2). */
183 double getNumberOfPeople(double floorArea) const;
184
185 /** Returns the people/m^2 represented by this instance, assuming floorArea (m^2). */
186 double getPeoplePerFloorArea(double floorArea) const;
187
188 /** Returns the m^2/person represented by this instance, assuming floorArea (m^2). */
189 double getFloorAreaPerPerson(double floorArea) const;
190
191 //@}
192 protected:
193 /// @cond
194 using ImplType = detail::People_Impl;
195
196 friend class Model;
197 friend class openstudio::IdfObject;
198
199 explicit People(std::shared_ptr<detail::People_Impl> impl);
200
201 /// @endcond
202 private:
203 REGISTER_LOGGER("openstudio.model.People");
204 };
205
206 /** \relates People*/
207 using OptionalPeople = boost::optional<People>;
208
209 /** \relates People*/
210 using PeopleVector = std::vector<People>;
211
212 } // namespace model
213 } // namespace openstudio
214
215 #endif // MODEL_PEOPLE_HPP
216