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

Method peakDemandUnitConversionFactor

src/model/UtilityBill.cpp:385–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383 }
384
385 boost::optional<double> UtilityBill_Impl::peakDemandUnitConversionFactor() const {
386 boost::optional<double> result;
387 boost::optional<std::string> peakDemandUnit = this->peakDemandUnit();
388 if (peakDemandUnit) {
389 FuelType fuelType = this->fuelType();
390
391 if (peakDemandUnit.get() == "kW") {
392 result = 1000;
393 } else if (peakDemandUnit.get() == "MW") {
394 result = 1000000;
395 } else if (peakDemandUnit.get() == "W") {
396 result = 1;
397 } else {
398 LOG(Error, "Unknown peak demand unit '" << peakDemandUnit.get() << "' for fuel type '" << fuelType.valueDescription() << "'");
399 }
400 }
401 return result;
402 }
403
404 boost::optional<unsigned> UtilityBill_Impl::timestepsInPeakDemandWindow() const {
405 if (this->fuelType() == FuelType::Electricity) {

Callers 2

calibrationResultMethod · 0.45
TEST_FFunction · 0.45

Calls 4

peakDemandUnitMethod · 0.95
fuelTypeMethod · 0.95
valueDescriptionMethod · 0.80
getMethod · 0.45

Tested by 1

TEST_FFunction · 0.36