MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / doPlantSizingCalculation

Method doPlantSizingCalculation

src/model/SimulationControl.cpp:247–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245 }
246
247 bool SimulationControl_Impl::doPlantSizingCalculation() const {
248
249 auto shouldItBeOn = [this]() -> bool {
250 const auto m = model();
251 return !m.getModelObjects<SizingPeriod>().empty() && !m.getConcreteModelObjects<PlantLoop>().empty();
252 };
253
254 if (!isDoPlantSizingCalculationDefaulted()) {
255 boost::optional<std::string> value = getString(OS_SimulationControlFields::DoPlantSizingCalculation, true);
256 OS_ASSERT(value);
257 const auto result = openstudio::istringEqual(value.get(), "Yes");
258 if (!result && shouldItBeOn()) {
259 LOG(Warn, "You have PlantLoop(s) and design days, it's possible you should enable SimulationControl::DoPlantSizingCalculation");
260 }
261 return result;
262 }
263
264 const auto result = shouldItBeOn();
265 if (result) {
266 LOG(Debug, "You have PlantLoop(s) and design days, and SimulationControl::DoPlantSizingCalculation is defaulted: assuming on.");
267 }
268
269 return result;
270 }
271
272 bool SimulationControl_Impl::isDoPlantSizingCalculationDefaulted() const {
273 return isEmpty(OS_SimulationControlFields::DoPlantSizingCalculation);

Callers 3

TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 3

istringEqualFunction · 0.85
emptyMethod · 0.45
getMethod · 0.45

Tested by 2

TEST_FFunction · 0.64
TEST_FFunction · 0.64