EPANET-RTX  1.1
real-time extension for the EPANET toolkit
Public Types | Public Member Functions | Protected Member Functions | List of all members
RTX::StatsTimeSeries Class Reference

A modular timeseries class for delivering statistical information. More...

#include <StatsTimeSeries.h>

Inheritance diagram for RTX::StatsTimeSeries:
[legend]
Collaboration diagram for RTX::StatsTimeSeries:
[legend]

Public Types

enum  StatsTimeSeriesType {
  StatsTimeSeriesMean = 0, StatsTimeSeriesStdDev = 1, StatsTimeSeriesMedian = 2, StatsTimeSeriesQ25 = 3,
  StatsTimeSeriesQ75 = 4, StatsTimeSeriesInterQuartileRange = 5, StatsTimeSeriesMax = 6, StatsTimeSeriesMin = 7,
  StatsTimeSeriesCount = 8, StatsTimeSeriesVar = 9, StatsTimeSeriesRMS = 10
}
 
typedef boost::shared_ptr
< StatsTimeSeries
sharedPointer
 
- Public Types inherited from RTX::BaseStatsTimeSeries
enum  StatsSamplingMode_t { StatsSamplingModeLeading = 0, StatsSamplingModeLagging = 1, StatsSamplingModeCentered = 2 }
 sampling window mode (lead, lag, center) More...
 
typedef std::pair< Point,
Statistics
pointSummaryPair_t
 
typedef boost::shared_ptr
< BaseStatsTimeSeries
sharedPointer
 
- Public Types inherited from RTX::ModularTimeSeries
typedef boost::shared_ptr
< ModularTimeSeries
sharedPointer
 
- Public Types inherited from RTX::TimeSeries
typedef boost::shared_ptr
< TimeSeries
sharedPointer
 

Public Member Functions

StatsTimeSeriesType statsType ()
 Get the statistic type. More...
 
void setStatsType (StatsTimeSeriesType type)
 Set the statistic type. More...
 
virtual void setSource (TimeSeries::sharedPointer source)
 Set the upstream TimeSeries object. More...
 
virtual void setUnits (Units newUnits)
 
- Public Member Functions inherited from RTX::BaseStatsTimeSeries
void setWindow (Clock::sharedPointer window)
 Set the moving statistical window. More...
 
Clock::sharedPointer window ()
 Get the statistical sampling window clock. More...
 
void setSamplingMode (StatsSamplingMode_t mode)
 
StatsSamplingMode_t samplingMode ()
 
bool summaryOnly ()
 
void setSummaryOnly (bool summaryOnly)
 
- Public Member Functions inherited from RTX::ModularTimeSeries
virtual TimeSeries::sharedPointer source ()
 Get the source of this time series. More...
 
virtual bool doesHaveSource ()
 Does this Modular time series have an upstream source? More...
 
virtual TimeSeries::sharedPointer rootTimeSeries ()
 
virtual Point point (time_t time)
 option to add lots of (un)ordered points all at once. More...
 
virtual Point pointBefore (time_t time)
 
virtual Point pointAfter (time_t time)
 
virtual std::vector< Pointpoints (time_t start, time_t end)
 Get a vector of Points within a specific time range. More...
 
virtual void resetCache ()
 
virtual std::ostream & toStream (std::ostream &stream)
 
- Public Member Functions inherited from RTX::TimeSeries
virtual void insert (Point aPoint)
 
virtual void insertPoints (std::vector< Point >)
 
virtual Point pointAtOrBefore (time_t time)
 
virtual Point interpolatedPoint (time_t time)
 
virtual std::pair< Point, PointadjacentPoints (time_t time)
 
virtual time_t period ()
 
virtual std::string name ()
 1/frequency (# seconds between data points)
 
PointRecord::sharedPointer record ()
 
TimeSeries::Statistics summary (time_t start, time_t end)
 
TimeSeries::Statistics gapsSummary (time_t start, time_t end)
 
std::vector< Pointgaps (time_t start, time_t end)
 
virtual void setName (const std::string &name)
 
void setRecord (PointRecord::sharedPointer record)
 
virtual void setClock (Clock::sharedPointer clock)
 
Clock::sharedPointer clock ()
 
Units units ()
 
void setFirstTime (time_t time)
 
void setLastTime (time_t time)
 
time_t firstTime ()
 
time_t lastTime ()
 

Protected Member Functions

virtual bool canAlterDimension ()
 
virtual bool canAlterClock ()
 
virtual std::vector< PointfilteredPoints (TimeSeries::sharedPointer sourceTs, time_t fromTime, time_t toTime)
 
- Protected Member Functions inherited from RTX::BaseStatsTimeSeries
virtual std::vector
< pointSummaryPair_t > 
filteredSummaryPoints (TimeSeries::sharedPointer sourceTs, time_t fromTime, time_t toTime)
 
- Protected Member Functions inherited from RTX::ModularTimeSeries
virtual bool isCompatibleWith (TimeSeries::sharedPointer withTimeSeries)
 

Detailed Description

A modular timeseries class for delivering statistical information.

The StatsTimeSeries class is designed to provide a moving window (specified by the period length of a Clock in base-class parameter BaseStatsTimeSeries::window ), evaluated at regular intervals (also as a Clock), over which statistical measures are taken. The full list of statistical options is below.

See also
BaseStatsTimeSeries::window

Member Enumeration Documentation

Statistic summary types

Enumerator
StatsTimeSeriesMean 

Mean value of population.

StatsTimeSeriesStdDev 

Std Deviation of population.

StatsTimeSeriesMedian 

A 2nd quartile estimate. Low populations may result in bad estimates.

StatsTimeSeriesQ25 

A 1st quartile estimate.

StatsTimeSeriesQ75 

A 3rd quartile estimate.

StatsTimeSeriesInterQuartileRange 

IQR == Q75 - Q25

StatsTimeSeriesMax 

Maximum value in a population.

StatsTimeSeriesMin 

Minimum value in a population.

StatsTimeSeriesCount 

The number of points in the stats window.

StatsTimeSeriesVar 

The variance of the values in the population.

StatsTimeSeriesRMS 

Root mean squared.

Member Function Documentation

void StatsTimeSeries::setSource ( TimeSeries::sharedPointer  source)
virtual

Set the upstream TimeSeries object.

Parameters
sourceA shared pointer to the intended upstream TimeSeries object.

Reimplemented from RTX::ModularTimeSeries.

void RTX::StatsTimeSeries::setStatsType ( StatsTimeSeriesType  type)

Set the statistic type.

Parameters
typeThe type of statistic to calculate.
See also
StatsTimeSeries::statsType
StatsTimeSeries::StatsTimeSeriesType RTX::StatsTimeSeries::statsType ( )

Get the statistic type.

Returns
The type of statistic that this object is configured to return.
See also
StatsTimeSeries::setStatsType

The documentation for this class was generated from the following files: