GCBM
|
Encapsulates a timeseries of data. Normal usage allows modules to retrieve the most relevant data for the current timestep of the simulation. More...
#include <timeseries.h>
Classes | |
class | TimeSeriesPrep |
Public Member Functions | |
TimeSeries () | |
TimeSeries (int yr0, int dataPerYr, int nYrs, bool subSame, const std::vector< boost::optional< double >> raw, DateOrigin origin=DateOrigin::StartSim, int extraSteps=0) | |
Constructs a TimeSeries with the specified parameters. More... | |
~TimeSeries ()=default | |
void | setTiming (const flint::ITiming *timing) |
Sets the simulation timing for the TimeSeries. The value returned by the TimeSeries will be the most appropriate for the current timestep in the timing object and the configuration of the TimeSeries; for example, if the TimeSeries is set up for yearly data, and the timing object is also in yearly steps and is currently on timestep 5, value() will return the timestep 5 value. More... | |
void | setTiming (DateTime start, DateTime end) |
Alternate way to set the timing for the TimeSeries. The most often used method is to use the setTiming(const ITiming*) version. More... | |
const std::vector< double > & | series () const |
Gets the values for all timesteps in the entire TimeSeries. More... | |
double | value () const |
Gets the most current value for this point in time in the simulation. More... | |
int | yr0 () const |
The first year or timestep of data for the TimeSeries. More... | |
int | nYrs () const |
The number of years in the TimeSeries. More... | |
int | dataPerYr () const |
The number of data points per year in the TimeSeries. More... | |
bool | subSame () const |
True means that sub-timesteps get the full year value; false means the yearly value will be divided evenly among sub-timesteps. More... | |
const std::vector< boost::optional< double > > | raw () const |
The raw data for the TimeSeries. More... | |
DateOrigin | origin () const |
The origin of the TimeSeries. More... | |
ExtrapType | extrap () const |
Private Attributes | |
std::shared_ptr< TimeSeriesPrep > | _impl |
Encapsulates a timeseries of data. Normal usage allows modules to retrieve the most relevant data for the current timestep of the simulation.
TimeSeries | ( | ) |
TimeSeries | ( | int | yr0, |
int | dataPerYr, | ||
int | nYrs, | ||
bool | subSame, | ||
const std::vector< boost::optional< double >> | raw, | ||
DateOrigin | origin = DateOrigin::StartSim , |
||
int | extraSteps = 0 |
||
) |
Constructs a TimeSeries with the specified parameters.
yr0 | The first timestep of data in the TimeSeries. Must be a multiple of dataPerYr for origin=DateOrigin::StartSim; for example, data starting in the second year of a monthly simulation would have yr0=12. |
dataPerYr | The number of data points per year in the TimeSeries. |
nYrs | The number of years of data in the TimeSeries. |
subSame | If true, values are divided between the sub-timesteps. False means that the value for sub-timesteps is the same as for the full timestep. |
raw | The raw data making up the TimeSeries. |
origin | (Optional) The units of the TimeSeries origin (yr0), most commonly either StartSim (timestep - the default) or Calendar (year). |
extraSteps | (Optional) the extra steps. |
|
default |
int dataPerYr | ( | ) | const |
The number of data points per year in the TimeSeries.
ExtrapType extrap | ( | ) | const |
int nYrs | ( | ) | const |
The number of years in the TimeSeries.
DateOrigin origin | ( | ) | const |
The origin of the TimeSeries.
const std::vector< boost::optional< double > > raw | ( | ) | const |
The raw data for the TimeSeries.
const std::vector< double > & series | ( | ) | const |
Gets the values for all timesteps in the entire TimeSeries.
void setTiming | ( | const flint::ITiming * | timing | ) |
Sets the simulation timing for the TimeSeries. The value returned by the TimeSeries will be the most appropriate for the current timestep in the timing object and the configuration of the TimeSeries; for example, if the TimeSeries is set up for yearly data, and the timing object is also in yearly steps and is currently on timestep 5, value() will return the timestep 5 value.
timing | The timing. |
void setTiming | ( | DateTime | start, |
DateTime | end | ||
) |
Alternate way to set the timing for the TimeSeries. The most often used method is to use the setTiming(const ITiming*) version.
start | The start Date/Time. |
end | The end Date/Time. |
bool subSame | ( | ) | const |
True means that sub-timesteps get the full year value; false means the yearly value will be divided evenly among sub-timesteps.
double value | ( | ) | const |
Gets the most current value for this point in time in the simulation.
int yr0 | ( | ) | const |
The first year or timestep of data for the TimeSeries.
|
private |