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

Method withinPeriodicRunPeriod

src/model/UtilityBill.cpp:1021–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019 }
1020
1021 bool BillingPeriod::withinPeriodicRunPeriod() const {
1022 model::Model model = getImpl<detail::UtilityBill_Impl>()->model();
1023
1024 bool withinRunPeriod = this->withinRunPeriod();
1025 if (withinRunPeriod) {
1026 return true;
1027 }
1028
1029 bool overlapsRunPeriod = this->overlapsRunPeriod();
1030 if (!overlapsRunPeriod) {
1031 return false;
1032 }
1033
1034 boost::optional<RunPeriod> runPeriod = model.runPeriod();
1035 if (!runPeriod) {
1036 return false;
1037 }
1038
1039 boost::optional<model::YearDescription> yd = model.yearDescription();
1040 if (!yd) {
1041 return false;
1042 }
1043
1044 boost::optional<int> calendarYear = yd->calendarYear();
1045 if (!calendarYear) {
1046 return false;
1047 }
1048
1049 Date runPeriodStartDatePeriodic = Date(runPeriod->getBeginMonth(), runPeriod->getBeginDayOfMonth(), *calendarYear + 1);
1050 Date runPeriodEndDate = Date(runPeriod->getEndMonth(), runPeriod->getEndDayOfMonth(), *calendarYear);
1051 Time time = runPeriodStartDatePeriodic - runPeriodEndDate;
1052
1053 bool result = (time.days() == 1);
1054
1055 return result;
1056 }
1057
1058 bool BillingPeriod::overlapsRunPeriod() const {
1059 model::Model model = getImpl<detail::UtilityBill_Impl>()->model();

Callers

nothing calls this directly

Calls 12

withinRunPeriodMethod · 0.95
overlapsRunPeriodMethod · 0.95
runPeriodMethod · 0.80
yearDescriptionMethod · 0.80
getBeginMonthMethod · 0.80
getBeginDayOfMonthMethod · 0.80
getEndMonthMethod · 0.80
getEndDayOfMonthMethod · 0.80
daysMethod · 0.80
DateClass · 0.70
modelMethod · 0.45
calendarYearMethod · 0.45

Tested by

no test coverage detected