| 698 | } |
| 699 | |
| 700 | boost::optional<OutputMeter> UtilityBill_Impl::peakDemandMeter() const { |
| 701 | FuelType fuelType = this->fuelType(); |
| 702 | InstallLocationType meterInstallLocation = this->meterInstallLocation(); |
| 703 | boost::optional<std::string> meterSpecificInstallLocation = this->meterSpecificInstallLocation(); |
| 704 | boost::optional<EndUseCategoryType> meterEndUseCategory = this->meterEndUseCategory(); |
| 705 | boost::optional<EndUseType> meterEndUse; |
| 706 | if (meterEndUseCategory) { |
| 707 | meterEndUse = EndUseType(meterEndUseCategory->valueName()); |
| 708 | } |
| 709 | boost::optional<std::string> meterSpecificEndUse = this->meterSpecificEndUse(); |
| 710 | |
| 711 | if (fuelType != FuelType::Electricity) { |
| 712 | return boost::none; |
| 713 | } |
| 714 | |
| 715 | std::string meterName = OutputMeter::getName(meterSpecificEndUse, meterEndUse, fuelType, meterInstallLocation, meterSpecificInstallLocation); |
| 716 | |
| 717 | boost::optional<OutputMeter> result; |
| 718 | for (const OutputMeter& meter : this->model().getConcreteModelObjects<OutputMeter>()) { |
| 719 | if ((istringEqual(meter.name(), meterName)) && (istringEqual("Timestep", meter.reportingFrequency()))) { |
| 720 | return meter; |
| 721 | } |
| 722 | } |
| 723 | |
| 724 | result = OutputMeter(this->model()); |
| 725 | result->setReportingFrequency("Timestep"); |
| 726 | result->setFuelType(fuelType); |
| 727 | result->setInstallLocationType(meterInstallLocation); |
| 728 | if (meterSpecificInstallLocation) { |
| 729 | result->setSpecificInstallLocation(*meterSpecificInstallLocation); |
| 730 | } |
| 731 | if (meterEndUse) { |
| 732 | result->setEndUseType(*meterEndUse); |
| 733 | } |
| 734 | if (meterSpecificEndUse) { |
| 735 | result->setSpecificEndUse(*meterSpecificEndUse); |
| 736 | } |
| 737 | |
| 738 | return result; |
| 739 | } |
| 740 | |
| 741 | std::vector<BillingPeriod> UtilityBill_Impl::billingPeriods() const { |
| 742 | IdfExtensibleGroupVector egs = extensibleGroups(); |