Aimsun Next Scripting  22
Public Member Functions | List of all members
GKTrafficState Class Reference
Inheritance diagram for GKTrafficState:
GKTrafficDemandItem GKObject GKBaseObject

Public Member Functions

 GKTrafficState ()
 
void clear ()
 
GKObjectclone (bool addItToModel=true) const
 
float getEntranceFlow (GKSection *section, GKSection *fromSection) const
 
void setEntranceFlow (GKSection *section, GKSection *fromSection, float flow)
 
float getKeepFlowPercentage (GKSection *section, GKSection *fromSection) const
 
void setKeepFlowPercentage (GKSection *section, GKSection *fromSection, float flowPercentage)
 
float getTurningPercentage (GKSection *section, GKSection *toSection, GKSection *fromSection) const
 
void setTurningPercentage (GKSection *section, GKSection *toSection, GKSection *fromSection, float value)
 
float getExitFlow (GKSection *section, GKSection *toSection, GKSection *fromSection) const
 
void setExitFlow (GKSection *section, GKSection *toSection, GKSection *fromSection, float value)
 
void clearUseInputTurnings ()
 
void clearUseInputTurnings (GKSection *section)
 
bool useInputTurnings (GKSection *section) const
 
void setUseInputTurnings (GKSection *section, bool useit)
 
bool isUseInputTurningDefined (GKSection *section) const
 
bool use (GKSection *section) const
 
virtual GKObjectDelCmd * getDelCmd ()
 
virtual GKObjectConnectionDelCmd * getDelConnectionCmd (GKObject *)
 
void calculateTurnPercentagesFromExitFlows ()
 
- Public Member Functions inherited from GKTrafficDemandItem
 GKTrafficDemandItem ()
 
GKProblemNetgetProblemNet () const
 
void setProblemNet (GKProblemNet *)
 
GKUserClassgetUserClass () const
 
void setUserClass (GKUserClass *userClass)
 
GKMobileAgentgetVehicle () const
 
void setVehicle (GKMobileAgent *avehicle)
 
void setInterval (const QTime &, const GKTimeDuration &)
 
void setFrom (const QTime &)
 
void setDuration (const GKTimeDuration &)
 
const QTime & getFrom () const
 
const GKTimeDurationgetDuration () const
 
bool equivalent (const GKTrafficDemandItem &) const
 
bool equivalent (const GKUserClass *uc, const QTime &, const GKTimeDuration &) const
 
QString getNameAutomatically (bool) const
 
- Public Member Functions inherited from GKObject
 GKObject ()
 
 GKObject (const GKObject &o)
 
virtual void addedToCatalog ()
 
virtual void removedFromCatalog ()
 
uint getTick () const
 
virtual void increaseTick ()
 
void setTick (uint t)
 
virtual GKObjectclone (bool addItToModel=true) const
 
virtual GKObjectcloneAsTemporary (bool addItToModel=true) const
 
GKFoldergetCreateRootFolder ()
 
GKFoldergetRootFolder () const
 
void setRootFolder (GKFolder *afolder)
 
GKFolderfindFolder (const QString &byName) const
 
QVector< GKFolder * > getParentFolders () const
 
bool isDataValueNull (const GKColumn *attr) const
 
virtual QVariant * getDataValue (const GKColumn *attr, bool *deleteit, const GKContext &context=GKContext::anyContext) const
 
QVariant * getDataValueByID (uint attrId, bool *deleteit, const GKContext &context=GKContext::anyContext) const
 
virtual void setDataValue (const GKColumn *attr, const QVariant &v)
 
void setDataValueByID (uint attrId, const QVariant &v)
 
virtual void setDataValueObject (const GKColumn *attr, const GKObject *obj)
 
void setDataValueObjectByID (uint attrId, const GKObject *obj)
 
virtual void setDataValueDouble (const GKColumn *attr, double v)
 
void setDataValueDoubleByID (uint attrId, double v)
 
virtual double getDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double *deviation=NULL) const
 
double getDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double *deviation=NULL) const
 
bool hasAnyTSWithData () const
 
virtual GKTimeSeriegetDataValueTS (const GKColumn *attr) const
 
GKTimeSeriegetDataValueTSByID (uint attrId) const
 
virtual void setDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, double lowerValue, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setDataValueInSingleTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription)
 
void setDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setAggregatedValueInTS (const GKColumn *attr, double value, double deviation, GKTSDescription *aDescription=NULL)
 
void setAggregatedValueInTSByID (uint attrId, double value, double deviation, GKTSDescription *aDescription=NULL)
 
virtual void clearDataValueTS (const GKColumn *attr, GKTSDescription *aDescription=NULL)
 
void clearDataValueTSByID (uint attrId, GKTSDescription *aDescription=NULL)
 
virtual int getDataValueInt (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
int getDataValueIntByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual double getDataValueDouble (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
double getDataValueDoubleByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QString getDataValueString (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QString getDataValueStringByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual bool getDataValueBool (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
bool getDataValueBoolByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual GKObjectgetDataValueObject (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
GKObjectgetDataValueObjectByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QDate getDataValueDate (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QDate getDataValueDateByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QTime getDataValueTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QTime getDataValueTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QDateTime getDataValueDateTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QDateTime getDataValueDateTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
GKTimeDuration getDataValueTimeDuration (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
GKTimeDuration getDataValueTimeDurationByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
void removeDataValue (const GKColumn *attr)
 
void removeDataValueByID (uint attrId)
 
const QString & getDescription () const
 
void setDescription (const QString &adescription)
 
const QString & getExternalId () const
 
void setExternalId (const QString &anId)
 
virtual GKObjectDelCmd * getDelCmd ()
 
virtual GKObjectConnectionDelCmd * getDelConnectionCmd (GKObject *target)
 
virtual void nonCommandObjectRemoved (GKObject *)
 
virtual void init ()
 
virtual void setId (uint aid, GKModel *model)
 
uint getId () const
 
QUuid getUUID () const
 
virtual void setName (const QString &aname)
 
const QString & getName () const
 
QString getExtendedId (IdentifierForm form=eIdentifierDefault) const
 
QString getNameOrExtendedId (IdentifierForm form=eIdentifierDefault) const
 
virtual const QString & getTypeName () const
 
virtual QString getTypeExternalName () const
 
const GKObjectgetMaster () const
 
GKTypegetType () const
 
virtual void setType (GKType *atype)
 
bool isA (const GKType *atype) const
 
bool isA (const QString &typeName) const
 
virtual void setModel (GKModel *amodel)
 
GKModelgetModel () const
 
virtual void setLock (GKLockType atype)
 
GKLockType getLock () const
 
virtual bool canBeDeleted () const
 
virtual bool canBeModified () const
 
virtual bool canBeEdited () const
 
GKObjectStatus getStatus () const
 
virtual void setStatus (const GKObjectStatus astatus)
 
void notifyStatusChange ()
 
bool isTemporary () const
 
void setTemporary (bool value)
 
bool isExternal () const
 
void setExternal (bool value)
 
virtual void preferencesChanged ()
 
void removeColumn (GKColumn *column)
 
void resetColumn (GKColumn *column)
 
- Public Member Functions inherited from GKBaseObject
 GKBaseObject ()
 
 if (base)
 
virtual uint getId () const =0
 
virtual const QString & getTypeName () const =0
 
virtual QString getTypeExternalName () const =0
 
virtual const GKObjectgetMaster () const =0
 
virtual const QString & getName () const =0
 
virtual const QString & getExternalId () const =0
 
virtual const QString & getDescription () const =0
 
virtual GKModelgetModel () const =0
 
virtual QVariant * getDataValue (const GKColumn *attr, bool *deleteit, const GKContext &context=GKContext::anyContext) const =0
 
virtual QVariant * getDataValueByID (uint attrId, bool *deleteit, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double *deviation=NULL) const =0
 
virtual double getDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double *deviation=NULL) const =0
 
virtual GKTimeSeriegetDataValueTS (const GKColumn *attr) const =0
 
virtual GKTimeSeriegetDataValueTSByID (uint attrId) const =0
 
virtual int getDataValueInt (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual int getDataValueIntByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueDouble (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueDoubleByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QString getDataValueString (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QString getDataValueStringByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual bool getDataValueBool (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual bool getDataValueBoolByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKObjectgetDataValueObject (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKObjectgetDataValueObjectByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDate getDataValueDate (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDate getDataValueDateByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QTime getDataValueTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QTime getDataValueTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDateTime getDataValueDateTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDateTime getDataValueDateTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKTimeDuration getDataValueTimeDuration (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKTimeDuration getDataValueTimeDurationByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 

Additional Inherited Members

- Public Types inherited from GKObject
enum  IdentifierFormFlag {
  eIdentifierDefault , eIdentifierId , eIdentifierName , eIdentifierExternalId ,
  eIdentifierTypeExternalName , eIdentifierDescription , eIdentifierStandard , eIdentifierStandardWithType ,
  eIdentifierAll
}
 
enum  GKLockType { eNone , eModification , eDelete , eModificationDelete }
 
enum  GKObjectStatus { eNew , eSaved , eModified , eDeleted }
 
typedef QFlags< GKObject::IdentifierFormFlagIdentifierForm
 
- Public Attributes inherited from GKBaseObject
ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS GKBaseObjectbase = (GKBaseObject*)sipCpp
 
 sipType = 0
 
- Static Public Attributes inherited from GKTrafficDemandItem
static uint weekdayAtt
 
static uint seasonAtt
 
static uint weatherAtt
 
static uint eventAtt
 
static uint methodologyAtt
 
static uint fromAtt
 
static uint durationAtt
 
static uint subnetworkAtt
 
- Static Public Attributes inherited from GKObject
static uint typeNameAtt
 
static uint typeExternalNameAtt
 
static uint revisedAtt
 
- Static Public Attributes inherited from GKBaseObject
Py_END_ALLOW_THREADS static End uint idAtt
 
static uint nameAtt
 
static uint externalIdAtt
 
static uint descriptionAtt
 

Detailed Description

A traffic state codes a Traffic Demand using two separate mechanisms:

For each section on a traffic state the information can be stored aggregated or disaggregated by the input sections of the section from where values are stored. This means that section A can have the information aggregated and section B disaggregated on the same traffic state. This allow the user to add detailed information where it is relevant (or where the data is available).

Example: section C has two input sections (A and B) and two output sections (D and E):

____________________
SECTION A ----> | SECTION C |-----> SECTION D
| -- -- -- -- -- > |
SECTION B ----> |___________________|-----> SECTION E

Disaggregated Information

When editing section C flow values (input flow, keep flow percentage) and turn percentages the input sections A and B can be used. In this case the values will be:

This disaggregated information can be used to specify with great precision a traffic state. But it has two problems:

Aggregated Information

Having no data or no needed for a detailed description of a traffic state it is possible to enter a simplified version. In this case all the entrances are aggregated. Following the example the values to be edited will be:

Constructor & Destructor Documentation

◆ GKTrafficState()

GKTrafficState::GKTrafficState ( )

Member Function Documentation

◆ calculateTurnPercentagesFromExitFlows()

void GKTrafficState::calculateTurnPercentagesFromExitFlows ( )

Calculates the turn percentages for all the sections in the traffic state depending on the defined exit flows

◆ clear()

void GKTrafficState::clear ( )

Removes all the section information stored in this state.

◆ clearUseInputTurnings() [1/2]

void GKTrafficState::clearUseInputTurnings ( )

Disable disaggregated information in all the sections.

◆ clearUseInputTurnings() [2/2]

void GKTrafficState::clearUseInputTurnings ( GKSection section)

Disable disaggregated information in all the sections.

◆ clone()

GKObject * GKTrafficState::clone ( bool  addItToModel = true) const
virtual

It clones the whole traffic state and returns the copy. The cloned traffic state is added to the catalog if "addItToModel" is true.

Reimplemented from GKObject.

◆ getDelCmd()

virtual GKObjectDelCmd * GKTrafficState::getDelCmd ( )
virtual

Object will be deleted. The user must write a suitable GKObjectDelCmd subclass and return it in this method. The implementation in this class returns a GKObjectDelCmd as it is (it removes the object from the GKModel and delete it if needed after command destruction, removes the object from the GKGeoModel and removes connections to it).

Reimplemented from GKObject.

◆ getDelConnectionCmd()

virtual GKObjectConnectionDelCmd * GKTrafficState::getDelConnectionCmd ( GKObject target)
virtual

This object has connections to "target" and "target" will be removed. Create and return a delete command to handle undo and redo of the affected connections. If the object is deleted outside a command (no UNDO) then the model will call GKObject::nonCommandObjectRemoved instead.

If this method returns a None it means that the delete is not possible and the command will not be done. If an object is connected to another but decides that no information is needed in the delete command then it has to return an empty GKObjectConnectionDelCmd instead of a None.

See also GKModel.

Reimplemented from GKObject.

◆ getEntranceFlow()

float GKTrafficState::getEntranceFlow ( GKSection section,
GKSection fromSection 
) const

Returns the entrance flow on "section". If fromSection is not None then the flow is disaggregated by entrance and "fromSection" is used. If fromSection is None then the aggregated value is used. Note that -1 is returned if undefined.

◆ getExitFlow()

float GKTrafficState::getExitFlow ( GKSection section,
GKSection toSection,
GKSection fromSection 
) const

Returns the exit flow that, in section "section", uses turn to section "toSection". When data is stored taking into account input turns (see GKTrafficState::useInputTurnings) and fromSection is not None then the exit flow is disaggregated by entrance and "fromSection" is used. If input turns are not used or fromSection is None then the aggregated value is used. When fromSection is None, the boolean parameter is used to see if you want to use the disaggregated values to get the aggregated value when the aggregated one is not present. Note that -1 is returned if undefined.

◆ getKeepFlowPercentage()

float GKTrafficState::getKeepFlowPercentage ( GKSection section,
GKSection fromSection 
) const

Returns the percentage of vehicles that exits the network on "section". If fromSection is not None then the percentage is disaggregated by entrance and "fromSection" is used. If fromSection is None then the aggregated value is used. Note that -1 is returned if undefined.

◆ getTurningPercentage()

float GKTrafficState::getTurningPercentage ( GKSection section,
GKSection toSection,
GKSection fromSection 
) const

Returns the percentage of vehicles that, in section "section", takes a turn to section "toSection". When data is stored taking into account input turns (see GKTrafficState::useInputTurnings) and fromSection is not None then the turn percentage is disaggregated by entrance and "fromSection" is used. If input turns are not used or fromSection is None then the aggregated value is used. Note that -1 is returned if undefined.

◆ isUseInputTurningDefined()

bool GKTrafficState::isUseInputTurningDefined ( GKSection section) const

Returns true if there is information about whether to use disaggregated information in "section"

◆ setEntranceFlow()

void GKTrafficState::setEntranceFlow ( GKSection section,
GKSection fromSection,
float  flow 
)

Sets the entrance flow on "section". If fromSection is not None then the flow is disaggregated by entrance and "fromSection" is used.

◆ setExitFlow()

void GKTrafficState::setExitFlow ( GKSection section,
GKSection toSection,
GKSection fromSection,
float  value 
)

Sets the exit flow that, in section "section", uses turn to section "toSection". If fromSection is not None then the exit flow is disaggregated by entrance and "fromSection" is used. If fromSection is None then the aggregated value is used.

◆ setKeepFlowPercentage()

void GKTrafficState::setKeepFlowPercentage ( GKSection section,
GKSection fromSection,
float  flowPercentage 
)

Sets the percentage of vehicles that exits the network on "section". If fromSection is not None then the percentage is disaggregated by entrance and "fromSection" is used. If fromSection is None then the aggregated value is used.

◆ setTurningPercentage()

void GKTrafficState::setTurningPercentage ( GKSection section,
GKSection toSection,
GKSection fromSection,
float  value 
)

Sets the percentage of vehicles that, in section "section", takes a turn to section "toSection". If fromSection is not None then the turn percentage is disaggregated by entrance and "fromSection" is used. If fromSection is None then the aggregated value is used.

◆ setUseInputTurnings()

void GKTrafficState::setUseInputTurnings ( GKSection section,
bool  useit 
)

If true disaggregated information in "section" is used, if false aggregated info is used.

◆ use()

bool GKTrafficState::use ( GKSection section) const

Returns true is this section is used in this state (if the state has information associated with it).

◆ useInputTurnings()

bool GKTrafficState::useInputTurnings ( GKSection section) const

Enable or disable disaggregated information in "section"

© Aimsun SLU
Aimsun ®