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