OpenStudioCore:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
List of all members
openstudio::TimeSeries Class Reference

#include <TimeSeries.hpp>

Public Member Functions

Constructors
 TimeSeries ()
 default constructor More...
 
 TimeSeries (const Date &startDate, const Time &intervalLength, const Vector &values, const std::string &units)
 constructor from start date, interval length, values, and units first reporting interval ends at Date + Time(0) + intervalLength More...
 
 TimeSeries (const DateTime &startDateTime, const Time &intervalLength, const Vector &values, const std::string &units)
 constructor from start date and time, interval length, values, and units More...
 
 TimeSeries (const DateTime &firstReportDateTime, const Vector &daysFromFirstReport, const Vector &values, const std::string &units)
 constructor from first report date and time, days from first report vector, values, and units More...
 
 TimeSeries (const DateTime &firstReportDateTime, const std::vector< double > &daysFromFirstReport, const std::vector< double > &values, const std::string &units)
 constructor from first report date and time, days from first report , values, and units More...
 
 TimeSeries (const DateTimeVector &dateTimes, const Vector &values, const std::string &units)
 constructor from date times, values, and units More...
 
 TimeSeries (const DateTime &firstReportDateTime, const std::vector< long > &secondsFromFirstReport, const Vector &values, const std::string &units)
 constructor from first report date and time, seconds from first report vector, values, and units More...
 
 ~TimeSeries ()
 virtual destructor More...
 
Getters
openstudio::OptionalTime intervalLength () const
 interval length if any More...
 
openstudio::DateTimeVector dateTimes () const
 date and times at which values are reported, these are the end of each reporting interval More...
 
openstudio::DateTime firstReportDateTime () const
 date and time of first report value More...
 
openstudio::Vector daysFromFirstReport () const
 time in days from end of the first reporting interval More...
 
double daysFromFirstReport (const unsigned &i) const
 time in days from end of the first reporting interval at index i to prevent implicit vector copy for single value More...
 
std::vector< long > secondsFromFirstReport () const
 time in seconds from end of the first reporting interval More...
 
long secondsFromFirstReport (const unsigned &i) const
 time in seconds from end of the first reporting interval at index i to prevent implicit vector copy for single value More...
 
openstudio::Vector values () const
 values More...
 
double values (const unsigned &i) const
 values at index i to prevent implicit vector copy for single value More...
 
const std::string units () const
 units More...
 
double value (double daysFromFirstReport) const
 get value at number of days from first report date and time More...
 
double value (const Time &timeFromFirstReport) const
 get value at time from first report date and time More...
 
double value (const DateTime &dateTime) const
 get value at date and time More...
 
Vector values (const DateTime &startDateTime, const DateTime &endDateTime) const
 get values between start and end date times More...
 
double outOfRangeValue () const
 get the value used for out of range data More...
 
Setters
void setOutOfRangeValue (double value)
 set the value used for out of range data, defaults to 0 More...
 
Operators
TimeSeries operator+ (const TimeSeries &other) const
 add timeseries More...
 
TimeSeries operator- (const TimeSeries &other) const
 subtract timeseries More...
 
TimeSeries operator* (double d) const
 TimeSereis * double. More...
 
TimeSeries operator/ (double d) const
 TimeSeries / double. More...
 

Detailed Description

TimeSeries is a series of values each reported at a single time.

We follow the EnergyPlus convention that the time reported for each value is at the end of the reporting interval. For example, if a value is measured over the interval from hour 1 (non-inclusive) to hour 2 (inclusive), that is 1 < t <= 2, and the reported value (either the average, median, min, max, etc) is determined to be 7, then the value 7 is reported at hour 2. One of the primary tasks of the TimeSeries class is to get the value of the series at an arbitrary time. For the example above, any time in the interval 1 < t <= 2 will return 7.

Todo: add calendar to deal with Daylight Savings

Constructor & Destructor Documentation

openstudio::TimeSeries::TimeSeries ( )

default constructor

openstudio::TimeSeries::TimeSeries ( const Date startDate,
const Time intervalLength,
const Vector &  values,
const std::string &  units 
)

constructor from start date, interval length, values, and units first reporting interval ends at Date + Time(0) + intervalLength

openstudio::TimeSeries::TimeSeries ( const DateTime startDateTime,
const Time intervalLength,
const Vector &  values,
const std::string &  units 
)

constructor from start date and time, interval length, values, and units

openstudio::TimeSeries::TimeSeries ( const DateTime firstReportDateTime,
const Vector &  daysFromFirstReport,
const Vector &  values,
const std::string &  units 
)

constructor from first report date and time, days from first report vector, values, and units

openstudio::TimeSeries::TimeSeries ( const DateTime firstReportDateTime,
const std::vector< double > &  daysFromFirstReport,
const std::vector< double > &  values,
const std::string &  units 
)

constructor from first report date and time, days from first report , values, and units

openstudio::TimeSeries::TimeSeries ( const DateTimeVector &  dateTimes,
const Vector &  values,
const std::string &  units 
)

constructor from date times, values, and units

openstudio::TimeSeries::TimeSeries ( const DateTime firstReportDateTime,
const std::vector< long > &  secondsFromFirstReport,
const Vector &  values,
const std::string &  units 
)

constructor from first report date and time, seconds from first report vector, values, and units

openstudio::TimeSeries::~TimeSeries ( )
inline

virtual destructor

Member Function Documentation

openstudio::DateTimeVector openstudio::TimeSeries::dateTimes ( ) const

date and times at which values are reported, these are the end of each reporting interval

openstudio::Vector openstudio::TimeSeries::daysFromFirstReport ( ) const

time in days from end of the first reporting interval

double openstudio::TimeSeries::daysFromFirstReport ( const unsigned &  i) const

time in days from end of the first reporting interval at index i to prevent implicit vector copy for single value

openstudio::DateTime openstudio::TimeSeries::firstReportDateTime ( ) const

date and time of first report value

openstudio::OptionalTime openstudio::TimeSeries::intervalLength ( ) const

interval length if any

TimeSeries openstudio::TimeSeries::operator* ( double  d) const

TimeSereis * double.

TimeSeries openstudio::TimeSeries::operator+ ( const TimeSeries other) const

add timeseries

TimeSeries openstudio::TimeSeries::operator- ( const TimeSeries other) const

subtract timeseries

TimeSeries openstudio::TimeSeries::operator/ ( double  d) const

TimeSeries / double.

double openstudio::TimeSeries::outOfRangeValue ( ) const

get the value used for out of range data

std::vector<long> openstudio::TimeSeries::secondsFromFirstReport ( ) const

time in seconds from end of the first reporting interval

long openstudio::TimeSeries::secondsFromFirstReport ( const unsigned &  i) const

time in seconds from end of the first reporting interval at index i to prevent implicit vector copy for single value

void openstudio::TimeSeries::setOutOfRangeValue ( double  value)

set the value used for out of range data, defaults to 0

const std::string openstudio::TimeSeries::units ( ) const

units

double openstudio::TimeSeries::value ( double  daysFromFirstReport) const

get value at number of days from first report date and time

double openstudio::TimeSeries::value ( const Time timeFromFirstReport) const

get value at time from first report date and time

double openstudio::TimeSeries::value ( const DateTime dateTime) const

get value at date and time

openstudio::Vector openstudio::TimeSeries::values ( ) const

values

double openstudio::TimeSeries::values ( const unsigned &  i) const

values at index i to prevent implicit vector copy for single value

Vector openstudio::TimeSeries::values ( const DateTime startDateTime,
const DateTime endDateTime 
) const

get values between start and end date times