Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScheduleDay: new timeseries method and interpolation options #5111

Merged
merged 73 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
76f4f41
Introduce new getValues method on ScheduleDay.
joseph-robertson Mar 13, 2024
48ac02d
Stub model test for new method.
joseph-robertson Mar 13, 2024
0242a8c
Formatting.
joseph-robertson Mar 13, 2024
389f6cb
Typo.
joseph-robertson Mar 13, 2024
6e075a3
Update scheduleday files and get new tests passing.
joseph-robertson Mar 14, 2024
27865fa
Return timeseries instead of separate getTimes and getValues.
joseph-robertson Mar 18, 2024
80ef75b
Clean up and try again.
joseph-robertson Mar 18, 2024
f01fba7
Update idd for new interpolation method keys.
joseph-robertson Mar 19, 2024
a365a99
Update model files and tests.
joseph-robertson Mar 19, 2024
d96338a
Update ft and rt files and tests.
joseph-robertson Mar 19, 2024
9fa369a
Get interpolation working on timeseries.
joseph-robertson Mar 19, 2024
3282bda
Stub new AverageInterp in vector files.
joseph-robertson Mar 19, 2024
47d03f3
Take a cut at the average interpolation.
joseph-robertson Mar 21, 2024
aed3dea
One more typo.
joseph-robertson Mar 21, 2024
7bee45b
Move average interp code into AverageInterp.
joseph-robertson Mar 22, 2024
8f1aed5
Formatting.
joseph-robertson Mar 22, 2024
81cfbd0
Cache timeseries results and clear when object changes.
joseph-robertson Mar 25, 2024
07992ed
Add AverageInterp no-op case to matrix cpp.
joseph-robertson Mar 25, 2024
b178a6b
Update docs for new timeseries method.
joseph-robertson Mar 25, 2024
f9a2eae
Set left endpoint of getvalue.
joseph-robertson Mar 25, 2024
d1d7708
Update left endpoint per method and update tests.
joseph-robertson Mar 26, 2024
6c7198e
Merge branch 'develop' into dayschedule-getvalues
joseph-robertson Mar 27, 2024
160585a
Interpolate using seconds instead of days.
joseph-robertson Mar 27, 2024
686b725
Need ti in seconds and not days.
joseph-robertson Mar 27, 2024
e742966
Try updating timestep with cache clear.
joseph-robertson Mar 27, 2024
2ded730
New protected method for clearing ts, and friend timestep.
joseph-robertson Mar 27, 2024
bfb876f
Updates for vt and deprecating interp setter.
joseph-robertson Mar 27, 2024
dd39ffd
Building but tests failing.
joseph-robertson Mar 28, 2024
4af6ee3
Fix the new vt.
joseph-robertson Mar 28, 2024
9be8c90
Remove deprecation of old setter.
joseph-robertson Mar 28, 2024
bb57a4d
Add one more test showing change in getValue for small enough timestep.
joseph-robertson Mar 28, 2024
9b82fed
Merge branch 'develop' into dayschedule-getvalues
joseph-robertson Apr 15, 2024
f8fcada
Merge branch 'develop' into dayschedule-getvalues
jmarrec Apr 18, 2024
6c33a6b
Update comments and release notes.
joseph-robertson Apr 18, 2024
e8b0015
Update ti default to -9999, add assert, update comments.
joseph-robertson Apr 18, 2024
c74f8b6
Few more updates to release notes.
joseph-robertson Apr 18, 2024
d2c195d
Introduce new getValues method on ScheduleDay.
joseph-robertson Mar 13, 2024
5037966
Stub model test for new method.
joseph-robertson Mar 13, 2024
96e9514
Formatting.
joseph-robertson Mar 13, 2024
d55dc20
Typo.
joseph-robertson Mar 13, 2024
a58faef
Update scheduleday files and get new tests passing.
joseph-robertson Mar 14, 2024
94685d5
Return timeseries instead of separate getTimes and getValues.
joseph-robertson Mar 18, 2024
1549488
Clean up and try again.
joseph-robertson Mar 18, 2024
a75a333
Update idd for new interpolation method keys.
joseph-robertson Mar 19, 2024
838df44
Update model files and tests.
joseph-robertson Mar 19, 2024
2b919ab
Update ft and rt files and tests.
joseph-robertson Mar 19, 2024
8eede82
Get interpolation working on timeseries.
joseph-robertson Mar 19, 2024
8da8085
Stub new AverageInterp in vector files.
joseph-robertson Mar 19, 2024
85da8ef
Take a cut at the average interpolation.
joseph-robertson Mar 21, 2024
065d022
One more typo.
joseph-robertson Mar 21, 2024
1104600
Move average interp code into AverageInterp.
joseph-robertson Mar 22, 2024
4af64a0
Formatting.
joseph-robertson Mar 22, 2024
dc202f1
Cache timeseries results and clear when object changes.
joseph-robertson Mar 25, 2024
30fd11d
Add AverageInterp no-op case to matrix cpp.
joseph-robertson Mar 25, 2024
8d50877
Update docs for new timeseries method.
joseph-robertson Mar 25, 2024
825b270
Set left endpoint of getvalue.
joseph-robertson Mar 25, 2024
bbd26f8
Update left endpoint per method and update tests.
joseph-robertson Mar 26, 2024
e257209
Interpolate using seconds instead of days.
joseph-robertson Mar 27, 2024
a22dbb2
Need ti in seconds and not days.
joseph-robertson Mar 27, 2024
1389577
Try updating timestep with cache clear.
joseph-robertson Mar 27, 2024
805f14c
New protected method for clearing ts, and friend timestep.
joseph-robertson Mar 27, 2024
740a0b2
Updates for vt and deprecating interp setter.
joseph-robertson Mar 27, 2024
f20d840
Building but tests failing.
joseph-robertson Mar 28, 2024
881d27c
Fix the new vt.
joseph-robertson Mar 28, 2024
1794d58
Remove deprecation of old setter.
joseph-robertson Mar 28, 2024
e4cef89
Add one more test showing change in getValue for small enough timestep.
joseph-robertson Mar 28, 2024
138cbad
Update comments and release notes.
joseph-robertson Apr 18, 2024
4572fc0
Update ti default to -9999, add assert, update comments.
joseph-robertson Apr 18, 2024
ceba909
Few more updates to release notes.
joseph-robertson Apr 18, 2024
012f076
Missing include
jmarrec Apr 25, 2024
90e86c6
Merge branch 'dayschedule-getvalues' of github.com:NREL/OpenStudio in…
joseph-robertson Apr 25, 2024
fddbc7d
Update assert and get optional timestep object.
joseph-robertson Apr 25, 2024
7493115
Merge branch 'develop' into dayschedule-getvalues
joseph-robertson Apr 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ For a list of deprecated and removed methods, please refer to [deprecated_method
* A number of methods have been renamed (and the old ones deprecated) to conform to the API for other `SpaceLoadInstance` / `SpaceLoadDefinition` objects
* Mostly `getWattsperUnit` is changed to `getDesignLevel` and `getWattsperZoneFloorArea` is changed to `getPowerPerFloorArea`
* Refer to [deprecated_methods.csv](../../ruby/deprecated_methods.csv) for the complete list
* [#5111](https://github.com/NREL/OpenStudio/pull/5111) - ScheduleDay: new timeseries method and interpolation options
* The `ScheduleDay` has API-breaking changes related to setters and getters for its `Interpolate To Timestep` field. They now use `string` rather than `bool` to conform to the IDD type `\choice`
* The forward translator for `ScheduleDay` replaces always setting "Average" with the interpolation method stored in `Interpolate to Timestep` field
* A new `timeseries()` method is introduced for returning vectors of times and (interpolated) values for the given number of timesteps per hour established by the `Timestep` object; `getValue` references this vector for an interpolated value at a given time

## Minor changes and bug fixes

Expand Down
9 changes: 5 additions & 4 deletions resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -4594,12 +4594,13 @@ OS:Schedule:Day,
\type object-list
\object-list ScheduleTypeLimitsNames
A4, \field Interpolate to Timestep
\note when the interval does not match the user specified timestep a Yes choice will average between the intervals request (to
\note timestep resolution. a No choice will use the interval value at the simulation timestep without regard to if it matches
\note the boundary or not.
\note when the interval does not match the user specified timestep a Average choice will average between the intervals request (to
\note timestep resolution. A No choice will use the interval value at the simulation timestep without regard to if it matches
\note the boundary or not. A Linear choice will interpolate linearly between successive values.
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved
\type choice
\default No
\key Yes
\key Average
\key Linear
\key No
N1, \field Hour
\type integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ namespace energyplus {
}
}

if (modelObject.interpolatetoTimestep()) {
scheduleDay.setString(Schedule_Day_IntervalFields::InterpolatetoTimestep, "Average");
} else {
scheduleDay.setString(Schedule_Day_IntervalFields::InterpolatetoTimestep, "No");
}
scheduleDay.setString(Schedule_Day_IntervalFields::InterpolatetoTimestep, modelObject.interpolatetoTimestep());
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved

std::vector<double> values = modelObject.values();
std::vector<openstudio::Time> times = modelObject.times();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ namespace energyplus {

s = workspaceObject.getString(Schedule_Day_IntervalFields::InterpolatetoTimestep);
if (s) {
if (openstudio::istringEqual(*s, "No")) {
scheduleDay.setInterpolatetoTimestep(false);
} else if (openstudio::istringEqual(*s, "Linear")) {
scheduleDay.setInterpolatetoTimestep(true);
} else if (openstudio::istringEqual(*s, "Average")) {
scheduleDay.setInterpolatetoTimestep(true);
}
scheduleDay.setInterpolatetoTimestep(*s);
}

//get extensible groups
Expand Down
14 changes: 7 additions & 7 deletions src/energyplus/Test/ScheduleRuleset_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ TEST_F(EnergyPlusFixture, ReverseTranslator_ScheduleYearWeekDailyToRulesetSimple
EXPECT_EQ(0, scheduleRule.ruleIndex());
ScheduleDay daySchedule = scheduleRule.daySchedule();
EXPECT_EQ(daySchedule.nameString(), "occupants schedule allday1 1");
EXPECT_FALSE(daySchedule.interpolatetoTimestep());
EXPECT_EQ("No", daySchedule.interpolatetoTimestep());
EXPECT_EQ(8u, daySchedule.values().size());
EXPECT_TRUE(scheduleRule.applySunday());
EXPECT_TRUE(scheduleRule.applyMonday());
Expand Down Expand Up @@ -864,7 +864,7 @@ TEST_F(EnergyPlusFixture, ReverseTranslator_ScheduleYearWeekDailyToRulesetComple
EXPECT_EQ(2, scheduleRule1.ruleIndex());
ScheduleDay daySchedule1 = scheduleRule1.daySchedule();
EXPECT_EQ(daySchedule1.nameString(), "occupants schedule allday1 1");
EXPECT_FALSE(daySchedule1.interpolatetoTimestep());
EXPECT_EQ("No", daySchedule1.interpolatetoTimestep());
EXPECT_EQ(8u, daySchedule1.values().size());
EXPECT_TRUE(scheduleRule1.applySunday());
EXPECT_TRUE(scheduleRule1.applyMonday());
Expand All @@ -888,7 +888,7 @@ TEST_F(EnergyPlusFixture, ReverseTranslator_ScheduleYearWeekDailyToRulesetComple
EXPECT_EQ(1, scheduleRule2.ruleIndex());
ScheduleDay daySchedule2 = scheduleRule2.daySchedule();
EXPECT_EQ(daySchedule2.nameString(), "occupants schedule allday1 2");
EXPECT_FALSE(daySchedule2.interpolatetoTimestep());
EXPECT_EQ("No", daySchedule2.interpolatetoTimestep());
EXPECT_EQ(8u, daySchedule2.values().size());
EXPECT_TRUE(scheduleRule2.applySunday());
EXPECT_TRUE(scheduleRule2.applyMonday());
Expand All @@ -912,7 +912,7 @@ TEST_F(EnergyPlusFixture, ReverseTranslator_ScheduleYearWeekDailyToRulesetComple
EXPECT_EQ(0, scheduleRule3.ruleIndex());
ScheduleDay daySchedule3 = scheduleRule3.daySchedule();
EXPECT_EQ(daySchedule3.nameString(), "occupants schedule allday2 1");
EXPECT_FALSE(daySchedule3.interpolatetoTimestep());
EXPECT_EQ("No", daySchedule3.interpolatetoTimestep());
EXPECT_EQ(8u, daySchedule3.values().size());
EXPECT_FALSE(scheduleRule3.applySunday());
EXPECT_FALSE(scheduleRule3.applyMonday());
Expand Down Expand Up @@ -1220,7 +1220,7 @@ TEST_F(EnergyPlusFixture, ReverseTranslator_ScheduleYearWeekCompactToRulesetComp
EXPECT_EQ(2, scheduleRule1.ruleIndex());
ScheduleDay daySchedule1 = scheduleRule1.daySchedule();
EXPECT_EQ(daySchedule1.nameString(), "occupants schedule allday1 1");
EXPECT_FALSE(daySchedule1.interpolatetoTimestep());
EXPECT_EQ("No", daySchedule1.interpolatetoTimestep());
EXPECT_EQ(8u, daySchedule1.values().size());
EXPECT_TRUE(scheduleRule1.applySunday());
EXPECT_TRUE(scheduleRule1.applyMonday());
Expand All @@ -1244,7 +1244,7 @@ TEST_F(EnergyPlusFixture, ReverseTranslator_ScheduleYearWeekCompactToRulesetComp
EXPECT_EQ(1, scheduleRule2.ruleIndex());
ScheduleDay daySchedule2 = scheduleRule2.daySchedule();
EXPECT_EQ(daySchedule2.nameString(), "occupants schedule allday1 2");
EXPECT_FALSE(daySchedule2.interpolatetoTimestep());
EXPECT_EQ("No", daySchedule2.interpolatetoTimestep());
EXPECT_EQ(8u, daySchedule2.values().size());
EXPECT_TRUE(scheduleRule2.applySunday());
EXPECT_TRUE(scheduleRule2.applyMonday());
Expand All @@ -1268,7 +1268,7 @@ TEST_F(EnergyPlusFixture, ReverseTranslator_ScheduleYearWeekCompactToRulesetComp
EXPECT_EQ(0, scheduleRule3.ruleIndex());
ScheduleDay daySchedule3 = scheduleRule3.daySchedule();
EXPECT_EQ(daySchedule3.nameString(), "occupants schedule allday2 1");
EXPECT_FALSE(daySchedule3.interpolatetoTimestep());
EXPECT_EQ("No", daySchedule3.interpolatetoTimestep());
EXPECT_EQ(8u, daySchedule3.values().size());
EXPECT_FALSE(scheduleRule3.applySunday());
EXPECT_FALSE(scheduleRule3.applyMonday());
Expand Down
155 changes: 129 additions & 26 deletions src/model/ScheduleDay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "ScheduleRuleset_Impl.hpp"
#include "ScheduleRule.hpp"
#include "ScheduleRule_Impl.hpp"
#include "Timestep.hpp"
#include "Timestep_Impl.hpp"

#include "../utilities/idf/IdfExtensibleGroup.hpp"
#include <utilities/idd/OS_Schedule_Day_FieldEnums.hxx>
Expand All @@ -25,6 +27,7 @@
#include "../utilities/core/Assert.hpp"

#include "../utilities/time/Time.hpp"
#include "../utilities/data/TimeSeries.hpp"
#include "../utilities/data/Vector.hpp"

namespace openstudio {
Expand Down Expand Up @@ -115,8 +118,10 @@ namespace model {
return !getObject<ScheduleDay>().getModelObjectTarget<ScheduleTypeLimits>(OS_Schedule_DayFields::ScheduleTypeLimitsName);
}

bool ScheduleDay_Impl::interpolatetoTimestep() const {
return getBooleanFieldValue(OS_Schedule_DayFields::InterpolatetoTimestep);
std::string ScheduleDay_Impl::interpolatetoTimestep() const {
boost::optional<std::string> value = getString(OS_Schedule_DayFields::InterpolatetoTimestep, true);
OS_ASSERT(value);
return value.get();
}

bool ScheduleDay_Impl::isInterpolatetoTimestepDefaulted() const {
Expand Down Expand Up @@ -176,42 +181,132 @@ namespace model {
return 0.0;
}

std::vector<double> values = this->values(); // these are already sorted
std::vector<openstudio::Time> times = this->times(); // these are already sorted
// We'll calculate the entire day when we request a single value but that's on purpose:
// * We're talking about max 60 timesteps * 24 hours = 1440 points,
// but realistically more often than not you'll have a timestep of 6 (our default) or 4 so 96 to 144 points. So not a lot of points
// * We cache the timeSeries, and,
// * More often than not, the use case is to do it for the entire day anyways (eg: openstudio-standards to determine occupancy schedules)
TimeSeries ts = this->timeSeries();
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved

unsigned N = times.size();
DateTimeVector dateTimes = ts.dateTimes();
Vector values = ts.values();

const unsigned N = dateTimes.size();
OS_ASSERT(values.size() == N);

if (N == 0) {
return 0.0;
}

openstudio::Vector x(N + 2);
openstudio::Vector y(N + 2);

x[0] = -0.000001;
y[0] = 0.0;
Vector x(N + 2);
Vector y(N + 2);

x[0] = 0.0;
std::string interpolatetoTimestep = this->interpolatetoTimestep();
if (istringEqual("No", interpolatetoTimestep)) {
y[0] = values[0];
} else if (istringEqual("Average", interpolatetoTimestep)) {
y[0] = values[0];
} else if (istringEqual("Linear", interpolatetoTimestep)) {
y[0] = 0.0;
}

for (unsigned i = 0; i < N; ++i) {
x[i + 1] = times[i].totalDays();
openstudio::Time t = dateTimes[i].time();
if (t.totalDays() == 0.0) { // this is 00:00:00 from the next day
t = openstudio::Time(0, 24, 0);
}

x[i + 1] = t.totalDays();
y[i + 1] = values[i];
}

x[N + 1] = 1.000001;
y[N + 1] = 0.0;
x[N + 1] = 1.0;
y[N + 1] = values[N - 1];

InterpMethod interpMethod;
if (this->interpolatetoTimestep()) {
interpMethod = LinearInterp;
} else {
interpMethod = HoldNextInterp;
}

double result = interp(x, y, time.totalDays(), interpMethod, NoneExtrap);
double result = interp(x, y, time.totalDays(), HoldNextInterp, NoneExtrap);
Copy link
Collaborator

@jmarrec jmarrec Apr 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really feel like you ever need to pass two values to that call...

As I wrote on #5001 (comment)

doesn't the getValues routine look inefficient? If I'm understanding correctly, you only need to find the time before and the time after and the corresponding, you can break early. I know, this is a scheduleday, so we're talking about 60 (timestep max in E+ If I recall correctly) * 24 hours datapoints max, so it's not noticeable, but still

And you should probably just do that on values & times, not on timeSeries (which is interpolated already, and contains the entire day)


return result;
}

openstudio::TimeSeries ScheduleDay_Impl::timeSeries() const {
Copy link
Collaborator Author

@joseph-robertson joseph-robertson Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returns timeseries with timestamps (i.e., a DateTimeVector) that align with the Timestep object. The values returned (i.e., a Vector) correspond to the "Interpolate to Timestep" choice.

if (!m_cachedTimeSeries) {

int numberOfTimestepsPerHour;
if (boost::optional<Timestep> timestep = this->model().getOptionalUniqueModelObject<Timestep>()) {
numberOfTimestepsPerHour = timestep->numberOfTimestepsPerHour();
} else {
numberOfTimestepsPerHour = 6;
}

Date startDate(Date(MonthOfYear(MonthOfYear::Jan), 1)); // this is arbitrary
int minutes = 60 / numberOfTimestepsPerHour;
DateTime startDateTime(startDate, Time(0, 0, 0));

DateTimeVector tsDateTimes;
for (size_t hour = 0; hour < 24; ++hour) {
for (size_t minute = minutes; minute <= 60; minute += minutes) {
if (minute == 60) {
openstudio::Time t(0, hour + 1, 0);
tsDateTimes.push_back(startDateTime + t);
} else {
openstudio::Time t(0, hour, minute);
tsDateTimes.push_back(startDateTime + t);
}
}
}

std::vector<double> values = this->values(); // these are already sorted
std::vector<openstudio::Time> times = this->times(); // these are already sorted

const unsigned N = times.size();
OS_ASSERT(values.size() == N);

TimeSeries result;
if (N == 0) {
return result;
}

Vector x(N + 2);
Vector y(N + 2);

x[0] = -0.000001;
y[0] = 0.0;

for (unsigned i = 0; i < N; ++i) {
x[i + 1] = times[i].totalSeconds();
y[i + 1] = values[i];
}

x[N + 1] = 86400.000001;
y[N + 1] = 0.0;

std::string interpolatetoTimestep = this->interpolatetoTimestep();
Vector tsValues(tsDateTimes.size());
for (unsigned j = 0; j < tsDateTimes.size(); ++j) {
openstudio::Time t = tsDateTimes[j].time();
if (t.totalDays() == 0.0) { // this is 00:00:00 from the next day
t = openstudio::Time(0, 24, 0);
}

if (istringEqual("No", interpolatetoTimestep)) {
tsValues[j] = interp(x, y, t.totalSeconds(), HoldNextInterp, NoneExtrap);
} else if (istringEqual("Average", interpolatetoTimestep)) {
double minutes = 60.0 / numberOfTimestepsPerHour;
double ti = minutes * 60.0; // total seconds of the timestep interval
tsValues[j] = interp(x, y, t.totalSeconds(), AverageInterp, NoneExtrap, ti);
} else if (istringEqual("Linear", interpolatetoTimestep)) {
tsValues[j] = interp(x, y, t.totalSeconds(), LinearInterp, NoneExtrap);
}
}

result = TimeSeries(tsDateTimes, tsValues, "");
m_cachedTimeSeries = result;
}

return m_cachedTimeSeries.get();
}

bool ScheduleDay_Impl::setScheduleTypeLimits(const ScheduleTypeLimits& scheduleTypeLimits) {
if (scheduleTypeLimits.model() != model()) {
return false;
Expand All @@ -229,9 +324,8 @@ namespace model {
return false;
}

bool ScheduleDay_Impl::setInterpolatetoTimestep(bool interpolatetoTimestep) {
return setBooleanFieldValue(OS_Schedule_DayFields::InterpolatetoTimestep, interpolatetoTimestep);
;
bool ScheduleDay_Impl::setInterpolatetoTimestep(const std::string& interpolatetoTimestep) {
return setString(OS_Schedule_DayFields::InterpolatetoTimestep, interpolatetoTimestep);
}

void ScheduleDay_Impl::resetInterpolatetoTimestep() {
Expand Down Expand Up @@ -369,6 +463,11 @@ namespace model {
void ScheduleDay_Impl::clearCachedVariables() {
m_cachedTimes.reset();
m_cachedValues.reset();
m_cachedTimeSeries.reset();
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved
}

void ScheduleDay_Impl::clearCachedTimeSeries() {
m_cachedTimeSeries.reset();
}

} // namespace detail
Expand All @@ -394,7 +493,7 @@ namespace model {
return getImpl<detail::ScheduleDay_Impl>()->isScheduleTypeLimitsDefaulted();
}

bool ScheduleDay::interpolatetoTimestep() const {
std::string ScheduleDay::interpolatetoTimestep() const {
return getImpl<detail::ScheduleDay_Impl>()->interpolatetoTimestep();
}

Expand All @@ -414,7 +513,11 @@ namespace model {
return getImpl<detail::ScheduleDay_Impl>()->getValue(time);
}

bool ScheduleDay::setInterpolatetoTimestep(bool interpolatetoTimestep) {
openstudio::TimeSeries ScheduleDay::timeSeries() const {
return getImpl<detail::ScheduleDay_Impl>()->timeSeries();
}

bool ScheduleDay::setInterpolatetoTimestep(const std::string& interpolatetoTimestep) {
return getImpl<detail::ScheduleDay_Impl>()->setInterpolatetoTimestep(interpolatetoTimestep);
}

Expand Down
10 changes: 7 additions & 3 deletions src/model/ScheduleDay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace model {
* inherits one from a Schedule. */
bool isScheduleTypeLimitsDefaulted() const;

bool interpolatetoTimestep() const;
std::string interpolatetoTimestep() const;
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved

bool isInterpolatetoTimestepDefaulted() const;

Expand All @@ -66,14 +66,18 @@ namespace model {
/// Returns a vector of values in the same order and with the same number of elements as times.
std::vector<double> values() const;

/// Returns the value in effect at the given time. If time is less than 0 days or greater than 1 day, 0 is returned.
/// Returns the value in effect at the given time.
/// If time is less than 0 days or greater than 1 day, 0 is returned.
double getValue(const openstudio::Time& time) const;

/// Returns the timeseries corresponding to simulation timestep and chosen interpolation method.
openstudio::TimeSeries timeSeries() const;

//@}
/** @name Setters */
//@{

bool setInterpolatetoTimestep(bool interpolatetoTimestep);
bool setInterpolatetoTimestep(const std::string& interpolatetoTimestep);
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved

void resetInterpolatetoTimestep();

Expand Down
Loading
Loading