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

Method alwaysOnContinuousSchedule

src/model/Model.cpp:1203–1247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1201 }
1202
1203 Schedule Model_Impl::alwaysOnContinuousSchedule() const {
1204 std::string alwaysOnName = this->alwaysOnContinuousScheduleName();
1205
1206 std::vector<ScheduleConstant> schedules = model().getConcreteModelObjects<ScheduleConstant>();
1207
1208 for (const auto& schedule : schedules) {
1209 if (boost::optional<std::string> name = schedule.name()) {
1210 if (istringEqual(name.get(), alwaysOnName)) {
1211 // DLM: if a schedule matches the name but not these other properties we should reclaim the name or at least warn
1212
1213 if (equal<double>(schedule.value(), 1.0)) {
1214 if (boost::optional<ScheduleTypeLimits> limits = schedule.scheduleTypeLimits()) {
1215 if (boost::optional<std::string> type = limits->numericType()) {
1216 if (istringEqual(type.get(), "Continuous")) {
1217 return schedule;
1218 }
1219 }
1220 }
1221 }
1222 }
1223 }
1224 }
1225
1226 ScheduleConstant schedule(model());
1227
1228 schedule.setName(alwaysOnName);
1229
1230 ScheduleTypeLimits limits(model());
1231
1232 limits.setName("Fractional");
1233
1234 limits.setNumericType("Continuous");
1235
1236 limits.setUnitType("");
1237
1238 limits.setLowerLimitValue(0.0);
1239
1240 limits.setUpperLimitValue(1.0);
1241
1242 schedule.setScheduleTypeLimits(limits);
1243
1244 schedule.setValue(1.0);
1245
1246 return std::move(schedule);
1247 }
1248
1249 std::string Model_Impl::alwaysOnContinuousScheduleName() const {
1250 return "Always On Continuous";

Callers 15

DistrictCoolingMethod · 0.80
ZoneMixingMethod · 0.80
DistrictHeatingSteamMethod · 0.80
DistrictHeatingWaterMethod · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
translateSchedulesMethod · 0.80
TEST_FFunction · 0.80

Calls 14

istringEqualFunction · 0.85
numericTypeMethod · 0.80
setNumericTypeMethod · 0.80
setLowerLimitValueMethod · 0.80
setUpperLimitValueMethod · 0.80
nameMethod · 0.45
getMethod · 0.45
valueMethod · 0.45
scheduleTypeLimitsMethod · 0.45
setNameMethod · 0.45
setUnitTypeMethod · 0.45

Tested by 9

TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
test_get_scheduleFunction · 0.64