NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
505 stars 192 forks source link

Informative Schedule Methods #4965

Open mdahlhausen opened 1 year ago

mdahlhausen commented 1 year ago

Enhancement Request

Add several methods to the Schedule object that report useful schedule information

Detailed Description

There are several methods in the extension gem and openstudio-standards that require gathering information about a schedule, such as the schedule runtime minimum and maximum values, the design day(s) minimum and maximum values, equivalent full load hours, and a vector of runtime hourly values.

A short list:

Other fields welcome, but the above are the most common.

There are already methods in openstudio-standards that provide this functionality, so perhaps it isn't necessary in OpenStudio SDK. But there may be other developers who would make use of the fields in the OpenStudio SDK.

Possible Implementation

I suggest implementing this method as part of the base Schedule class, which will need to be defined for each kind of schedule child object.

jmarrec commented 1 year ago

This file for eg ?

https://github.com/NREL/openstudio-standards/blob/9e6bdf751baedfe73567f532007fefe6656f5abf/lib/openstudio-standards/standards/Standards.ScheduleRuleset.rb#L696

So you want these methods reimplemented in C++?

jmarrec commented 1 year ago

schedule_ruleset_design_day_min_max_value is kinda pointless in C++ (see Note) IMHO, you'll get the same functionality with this one liner.

min, max = schedule_ruleset.winterDesignDaySchedule.values.minmax

Note: Yes, I do recognize you return a hash {'min': min, 'max': max} in os-standards and that has value, but the return would likely be a std::pair<double, double> in C++. Otherwise we'd have to create a struct MinMaxReturn or something, but that feels annoying and overly complex

mdahlhausen commented 1 year ago

I agree that the min max and other values are kinda pointless to include as long as .values is present. I think this mostly comes up with the ScheduleRuleset object, where you don't necessarily know if or when the ScheduleDay objects apply. It'd be nice to have a .values method for the ScheduleRuleset overall. The rest is pretty straightforward.