Aimsun Next Scripting  24.0
Public Member Functions | Static Public Member Functions | List of all members
GKTSDescription Class Reference

Public Member Functions

 GKTSDescription (GKColumn *col, const QString &uniqueName, bool aIncludeDeviationValues, bool aIncludeBandsValues, bool aExpandibleTS)
 
 ~GKTSDescription ()
 
void setTime (const QDateTime &, const QDateTime &, const GKTimeDuration &)
 
void setFromTime (const QDateTime &)
 
void setToTime (const QDateTime &)
 
void setIntervalTime (const GKTimeDuration &)
 
void expand (const QDateTime &)
 
void setToTimeKnow (bool)
 
const QDateTime & getFromTime () const
 
const QDateTime & getToTime () const
 
const GKTimeDurationgetIntervalTime () const
 
QDateTime getTimeFromInterval (int pos) const
 
const GKTimeDuration getDuration (const GKTimeSerie *) const
 
int getInterval (const QDateTime &) const
 
int getInterval (const QTime &) const
 
GKContext toContext () const
 
const QString & getTypeName () const
 
void setTypeName (const QString &)
 
void setAggregationType (GK::AggregationType type)
 
GK::AggregationType getAggregationType () const
 
void setConversion (const GK::Conversion)
 
const GK::Conversion getConversion () const
 
void setNullValue (double)
 
bool hasNullValue () const
 
double getNullValue () const
 
bool isNull (double) const
 
void setMinMax (double, double)
 
void expandMaxMin (double)
 
void resetMinMax ()
 
double getMinimum () const
 
double getMaximum () const
 
const QString & getUniqueName () const
 

Static Public Member Functions

static GKTSDescriptiongetCreateDescription (GKColumn *col, const QString &uniqueName, GKScenario &scenario, GK::AggregationType aggType, bool aIncludeDeviation=false, bool aIncludeBands=false)
 
static GKTSDescriptiongetCreateDescription (GKColumn *col, const QString &uniqueName, bool aIncludeDeviation=false, bool aIncludeBands=false)
 
static GKTSDescriptiongetCreateDescription (GKColumn *col, const QString &uniqueName, const QDateTime &aFrom, const QDateTime &aTo, const GKTimeDuration &anInterval, GK::AggregationType aggType, bool aIncludeDeviation=false, bool aIncludeBands=false)
 
static void findCommonDates (const GKTSDescription *t1, const GKTSDescription *t2, QDateTime &from, QDateTime &to)
 
static void findCommonTimes (const GKTSDescription *t1, const GKTSDescription *t2, QTime &from, QTime &to)
 

Detailed Description

Each time series (GKTimeSerie) has an associated description. Two (or more) time series can share the same description if their data is compatible (same time intervals and duration, same data type).

Constructor & Destructor Documentation

◆ GKTSDescription()

GKTSDescription::GKTSDescription ( GKColumn col,
const QString &  uniqueName,
bool  aIncludeDeviationValues,
bool  aIncludeBandsValues,
bool  aExpandibleTS 
)

◆ ~GKTSDescription()

GKTSDescription::~GKTSDescription ( )

Member Function Documentation

◆ expand()

void GKTSDescription::expand ( const QDateTime &  )

◆ expandMaxMin()

void GKTSDescription::expandMaxMin ( double  )

Recalculates the maximum and minimum values taking into account value (that is a value in that has been added to a time series).

◆ findCommonDates()

static void GKTSDescription::findCommonDates ( const GKTSDescription t1,
const GKTSDescription t2,
QDateTime &  from,
QDateTime &  to 
)
static

Find common dates (from, to) in to Timeseries that have a common interval.

◆ findCommonTimes()

static void GKTSDescription::findCommonTimes ( const GKTSDescription t1,
const GKTSDescription t2,
QTime &  from,
QTime &  to 
)
static

Find common times (from, to) in to Timeseries that have a common interval. The date in the date and time information is not used.

◆ getAggregationType()

GK::AggregationType GKTSDescription::getAggregationType ( ) const

When aggregating data, gives what is relevant: the mean or the sum.

◆ getConversion()

const GK::Conversion GKTSDescription::getConversion ( ) const

Units of this TS.

◆ getCreateDescription() [1/3]

static GKTSDescription * GKTSDescription::getCreateDescription ( GKColumn col,
const QString &  uniqueName,
bool  aIncludeDeviation = false,
bool  aIncludeBands = false 
)
static

Find (and create a new one if none is found) a TS description by uniqueName.

◆ getCreateDescription() [2/3]

static GKTSDescription * GKTSDescription::getCreateDescription ( GKColumn col,
const QString &  uniqueName,
const QDateTime &  aFrom,
const QDateTime &  aTo,
const GKTimeDuration anInterval,
GK::AggregationType  aggType,
bool  aIncludeDeviation = false,
bool  aIncludeBands = false 
)
static

Find (and create a new one if none is found) a TS description by uniqueName.

◆ getCreateDescription() [3/3]

static GKTSDescription * GKTSDescription::getCreateDescription ( GKColumn col,
const QString &  uniqueName,
GKScenario scenario,
GK::AggregationType  aggType,
bool  aIncludeDeviation = false,
bool  aIncludeBands = false 
)
static

Find (and create a new one if none is found) a TS description by uniqueName. The scenario will be used to assign the GKTSDescription times ( from, to and interval )

◆ getDuration()

const GKTimeDuration GKTSDescription::getDuration ( const GKTimeSerie *  ) const

Calculates the duration of a TS based on its from and to data or the interval.

◆ getFromTime()

const QDateTime & GKTSDescription::getFromTime ( ) const

◆ getInterval() [1/2]

int GKTSDescription::getInterval ( const QDateTime &  ) const

Returns the interval (the position in the time series array of value) in where time is truncated to the nearest integer.

If time is not in the interval -1 is returned.

◆ getInterval() [2/2]

int GKTSDescription::getInterval ( const QTime &  ) const

Returns the interval (the position in the time series array of value) in where time is truncated to the nearest integer. QDate info is not used in the from and to times, only the QTime part.

If time is not in the interval -1 is returned.

◆ getIntervalTime()

const GKTimeDuration & GKTSDescription::getIntervalTime ( ) const

◆ getMaximum()

double GKTSDescription::getMaximum ( ) const

Returns the maximum value of all the TS that uses this description.

◆ getMinimum()

double GKTSDescription::getMinimum ( ) const

Returns the minimum value of all the TS that uses this description.

◆ getNullValue()

double GKTSDescription::getNullValue ( ) const

Returns the NULL value for this TS description. Test first if a NULL has been defined using GKTSDescription::hasNullValue

◆ getTimeFromInterval()

QDateTime GKTSDescription::getTimeFromInterval ( int  pos) const

Returns the time for a given interval position (based on from time and interval time)

◆ getToTime()

const QDateTime & GKTSDescription::getToTime ( ) const

◆ getTypeName()

const QString & GKTSDescription::getTypeName ( ) const

◆ getUniqueName()

const QString & GKTSDescription::getUniqueName ( ) const

◆ hasNullValue()

bool GKTSDescription::hasNullValue ( ) const

Returns true if a NULL value for this TS description has been set.

◆ isNull()

bool GKTSDescription::isNull ( double  ) const

Returns true if "value" is a NULL (as defined with GKTSDescription::setNullValue).

◆ resetMinMax()

void GKTSDescription::resetMinMax ( )

Resets the maximum and minimum values

◆ setAggregationType()

void GKTSDescription::setAggregationType ( GK::AggregationType  type)

When aggregating data, sets what is relevant: the mean or the sum.

◆ setConversion()

void GKTSDescription::setConversion ( const GK::Conversion  )

Units of this TS.

◆ setFromTime()

void GKTSDescription::setFromTime ( const QDateTime &  )

◆ setIntervalTime()

void GKTSDescription::setIntervalTime ( const GKTimeDuration )

◆ setMinMax()

void GKTSDescription::setMinMax ( double  ,
double   
)

Sets the maximum and minimum values of the time series.

◆ setNullValue()

void GKTSDescription::setNullValue ( double  )

Sets the valuev to be used as NULL (no value)

◆ setTime()

void GKTSDescription::setTime ( const QDateTime &  ,
const QDateTime &  ,
const GKTimeDuration  
)

◆ setToTime()

void GKTSDescription::setToTime ( const QDateTime &  )

◆ setToTimeKnow()

void GKTSDescription::setToTimeKnow ( bool  )

If true the end time will be used (even if no data is found) when computing the duration (in GKTSDescription::getDuration). If false the duration will be computed using the the interval time and the data in the TS.

Set it to true (the default) when the end time is well known, to false when the TS is dynamic and the end time is not known.

◆ setTypeName()

void GKTSDescription::setTypeName ( const QString &  )

◆ toContext()

GKContext GKTSDescription::toContext ( ) const

Returns the time information of this description as a GKContext.

© Aimsun SLU
Aimsun ®