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

Method peakDemandMeter

src/model/UtilityBill.cpp:700–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

modelPeakDemandMethod · 0.80
TEST_FFunction · 0.80
translateModelPrivateMethod · 0.80

Calls 15

fuelTypeMethod · 0.95
meterInstallLocationMethod · 0.95
meterEndUseCategoryMethod · 0.95
meterSpecificEndUseMethod · 0.95
istringEqualFunction · 0.85
valueNameMethod · 0.80
setEndUseTypeMethod · 0.80
setSpecificEndUseMethod · 0.80
EndUseTypeClass · 0.70

Tested by 1

TEST_FFunction · 0.64