Aimsun Next Scripting: GKTimeSerie Class Reference
Aimsun Next Scripting  22
Public Types | Public Member Functions | List of all members
GKTimeSerie Class Reference

Public Types

enum  ExtraInfo { eNone , eDeviation , eBands }
 

Public Member Functions

 GKTimeSerie ()
 
 GKTimeSerie (GKTSDescription *)
 
virtual ~GKTimeSerie ()
 
int size () const
 
int dimensions () const
 
void clear ()
 
void setDescription (GKTSDescription *aDescription)
 
const GKTSDescriptiongetDescription () const
 
ExtraInfo getExtraInfo () const
 
virtual void setValue (GKTimeSerieIndex index, double value, double deviation=-1.0, double lowerValue=-1.0)
 
virtual double getValue (GKTimeSerieIndex index, bool *=NULL) const
 
virtual double getValue (const GKContext &, bool *=NULL) const
 
virtual double getDeviation (GKTimeSerieIndex index, bool *=NULL) const
 
virtual double getDeviation (const GKContext &, bool *=NULL) const
 
virtual QPair< double, double > getBand (GKTimeSerieIndex index, bool *valid=NULL) const
 
virtual QPair< double, double > getBand (const GKContext &context, bool *valid=NULL) const
 
double getMean (int dimension, const QDateTime &from=QDateTime(), const QDateTime &to=QDateTime(), bool useDate=true) const
 
double getSum (int dimension, const QDateTime &from=QDateTime(), const QDateTime &to=QDateTime(), bool useDate=true) const
 
double getMax (int dimension, const QDateTime &from=QDateTime(), const QDateTime &to=QDateTime(), bool useDate=true) const
 
double getMin (int dimension=0, const QDateTime &from=QDateTime(), const QDateTime &to=QDateTime(), bool useDate=true) const
 
void setCustomAggregatedValue (int dimension, double value, double deviation=-1.0)
 
double getCustomAggregatedValue (int dimension=0) const
 
double getCustomAggregatedDeviation (int dimension=0) const
 
double getAggregatedValue (int dimension=0) const
 
double getAggregatedDeviation (int dimension=0) const
 
double getStdDev (int dimension=0) const
 
double getSEMean (const GKTimeSerie &) const
 
double getTheilU (const GKTimeSerie &) const
 
void getTheilUmUcUs (const GKTimeSerie &, double, double *, double *, double *) const
 
double getRMS (const GKTimeSerie &) const
 

Detailed Description

The description contains either a calendar (non-periodic) or information about the time range, the interval between each value, units... This description is shared among all the TS that uses it.

It can have, optionally, either a deviation for each value or a band (high and low values).

A time series can be multi dimensional (for example, speed by different lanes or vehicle types). Use the GKTimeSerie::dimensions to know the number of dimensions available.

Use a suitable dimension (from 0 to GKTimeSerie::dimensions - 1) to set or get the data.

A time series has at least one dimension.

See also
GKTSDescription

Member Enumeration Documentation

◆ ExtraInfo

It has a deviation for each value or a band or none?.

Enumerator
eNone 
eDeviation 
eBands 

Constructor & Destructor Documentation

◆ GKTimeSerie() [1/2]

GKTimeSerie::GKTimeSerie ( )

◆ GKTimeSerie() [2/2]

GKTimeSerie::GKTimeSerie ( GKTSDescription )

◆ ~GKTimeSerie()

virtual GKTimeSerie::~GKTimeSerie ( )
virtual

Member Function Documentation

◆ clear()

void GKTimeSerie::clear ( )

Removes all the values in this attribute.

◆ dimensions()

int GKTimeSerie::dimensions ( ) const

Return the number of dimensions in this attribute.

◆ getAggregatedDeviation()

double GKTimeSerie::getAggregatedDeviation ( int  dimension = 0) const

Returns the aggregated deviation corresponding to the description's aggregationType:

◆ getAggregatedValue()

double GKTimeSerie::getAggregatedValue ( int  dimension = 0) const

According to the description's aggregationType, returns getMean(), getSum() or getAggregatedValue(), or -1.0f.

◆ getBand() [1/2]

virtual QPair< double, double > GKTimeSerie::getBand ( const GKContext context,
bool *  valid = NULL 
) const
virtual

Returns the band for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then -1 is returned and valid will be set to false.

If the TS contains only deviations it returns a band calculated using the deviation [Value+DEV,Value-DEV]

◆ getBand() [2/2]

virtual QPair< double, double > GKTimeSerie::getBand ( GKTimeSerieIndex  index,
bool *  valid = NULL 
) const
virtual

Returns the band for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then -1 is returned and valid will be set to false.

If the TS contains only deviations it returns a band calculated using the deviation [Value+DEV,Value-DEV]

◆ getCustomAggregatedDeviation()

double GKTimeSerie::getCustomAggregatedDeviation ( int  dimension = 0) const

Returns the external aggregated deviation previously set if any or -1 if not set.

◆ getCustomAggregatedValue()

double GKTimeSerie::getCustomAggregatedValue ( int  dimension = 0) const

Returns the external aggregated value previously set.

◆ getDescription()

const GKTSDescription * GKTimeSerie::getDescription ( ) const

The description fo this TS

◆ getDeviation() [1/2]

virtual double GKTimeSerie::getDeviation ( const GKContext ,
bool *  = NULL 
) const
virtual

Returns the deviation for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then -1 is returned and valid will be set to false.

◆ getDeviation() [2/2]

virtual double GKTimeSerie::getDeviation ( GKTimeSerieIndex  index,
bool *  = NULL 
) const
virtual

Returns the deviation for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then -1 is returned and valid will be set to false.

◆ getExtraInfo()

ExtraInfo GKTimeSerie::getExtraInfo ( ) const

It has a deviation for each value or a band or none?.

◆ getMax()

double GKTimeSerie::getMax ( int  dimension,
const QDateTime &  from = QDateTime(),
const QDateTime &  to = QDateTime(),
bool  useDate = true 
) const

Returns the maximum value among all the values.

◆ getMean()

double GKTimeSerie::getMean ( int  dimension,
const QDateTime &  from = QDateTime(),
const QDateTime &  to = QDateTime(),
bool  useDate = true 
) const

Returns the mean among all the values. If an interval of time [from, to] is specified, only the data in these dates will be considered. If usedate is true then the date in the date/time will be used, otherwise only the time info will be used.

◆ getMin()

double GKTimeSerie::getMin ( int  dimension = 0,
const QDateTime &  from = QDateTime(),
const QDateTime &  to = QDateTime(),
bool  useDate = true 
) const

Returns the minimum value among all the values.

◆ getRMS()

double GKTimeSerie::getRMS ( const GKTimeSerie ) const

Return the RMS (Root Mean Squared) error.

◆ getSEMean()

double GKTimeSerie::getSEMean ( const GKTimeSerie ) const

square error mean

◆ getStdDev()

double GKTimeSerie::getStdDev ( int  dimension = 0) const

standar deviation

◆ getSum()

double GKTimeSerie::getSum ( int  dimension,
const QDateTime &  from = QDateTime(),
const QDateTime &  to = QDateTime(),
bool  useDate = true 
) const

Returns the sum among all the values.If an inetrval of time [from, to] is specified, only the data in these dates will be considered. If usedate is true then the date in the date/time will be used, otherwise only the time info will be used.

◆ getTheilU()

double GKTimeSerie::getTheilU ( const GKTimeSerie ) const

Theil's U_statistic: "this" is the observed series, "serie2" is the forecasted series.

◆ getTheilUmUcUs()

void GKTimeSerie::getTheilUmUcUs ( const GKTimeSerie ,
double  ,
double *  ,
double *  ,
double *   
) const

Theil's statistics: "this" is the observed series, "serie2" is the forecasted series. The SEm is the squared mean returned by function getSEMean.

◆ getValue() [1/2]

virtual double GKTimeSerie::getValue ( const GKContext ,
bool *  = NULL 
) const
virtual

Returns the value for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then -1 is returned and valid will be set to false.

◆ getValue() [2/2]

virtual double GKTimeSerie::getValue ( GKTimeSerieIndex  index,
bool *  = NULL 
) const
virtual

Returns the value for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then -1 is returned and valid will be set to false.

◆ setCustomAggregatedValue()

void GKTimeSerie::setCustomAggregatedValue ( int  dimension,
double  value,
double  deviation = -1.0 
)

Sets the aggregated value in case the type of aggregation is set to eAggregated, what means that it cannot be calculated and it needs to be user-specified

◆ setDescription()

void GKTimeSerie::setDescription ( GKTSDescription aDescription)

The description for this TS

◆ setValue()

virtual void GKTimeSerie::setValue ( GKTimeSerieIndex  index,
double  value,
double  deviation = -1.0,
double  lowerValue = -1.0 
)
virtual

Sets the value and deviation for an interval. If the interval to be set is greater than the current number of intervals, empty intervals are add (values for these intervals will be -1).

If lowerValue is >= 0 then deviation will be use as the higher value of the band (and lowerValue as the lower one).

◆ size()

int GKTimeSerie::size ( ) const

Return the number of values in this attribute.

© Aimsun SLU
Aimsun ®