| 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); |