A time series is an object of the class GKTimeSerie and it is stored in an attribute, a GKColumn, of the object it refers to. You can read the standard deviation, Max, Min, Mean and RMS from the GKTimeSerie object.
Each GKTimeSerie has an associated description object (GKTSDescription). This contains information about the duration, start and end time, interval of the time series it applies to.
The GKTimeSerieIndex object is used to access a specific interval for a time series for which you want to read or write a value. To specify the 5th interval, you would use GKTimeSerieIndex(4) as the numbering starts at 0.
How to read data from a time series
To get a time series from an object you can call the method getDataValueTS(), passing as argument the GKColumn that stores it.
If you want to get directly the value for an interval from a time series of an object, you can call the method getDataValueInTS() instead, passing as argument the GKTimeSerieIndex in addition to the GKColumn that stores the time series.
Note that getDataValueInTS() returns a tuple, in which the first item is the value of the time series and the second is the deviation.
To find a column name, you can look in the types window after you have either retrieved a database or run the model. For instance here are the outputs for GKSection.
The name is made up of:
- STATIC or DYNAMIC
- Object type
- Output name
- Replication ID
- Vehicle type ID (or 0 for all vehicles)
- Lane number (or 0 for all lanes)