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

Public Types

enum  GKSPManagerCostType { eDistance , eTime , eAttribute , eFunction }
 

Public Member Functions

 GKSPManager ()
 
void setCostType (const GKSPManagerCostType)
 
void setAttributeCost (GKColumn *, GKColumn *)
 
void setContext (const GKContext &)
 
void build (GKModel *, const GKGenericExperiment *filterExperiment)
 
void build (GKModel *model, const GKGenericExperiment *filterExperiment, const QVector< GKVehicleClass * > &vClas, GKVehicle *vehicle=nullptr)
 
QVector< GKSection * > getPath (GKSection *, GKSection *)
 
QVector< GKSection * > getPath (GKCentroid *, GKCentroid *)
 
float calculate (GKBezierCurve *from, GKBezierCurve *to, QString &eventStr) const
 
float cost (GKSection *from, GKSection *to) const
 

Detailed Description

The GKSPManager holds all the shortest paths in a network. It calculates the shortest path using the cost of each object (section and turn). The cost can be:

The user of this class must first create an instance, then assign the cost type to be used, then the time context (if selected and attribute with Time Series as they depends of the time), then the attribute (if the type was Attribute). After setting the class call the build function. Then calls to the class can be done to get the shortest path between two sections.

Member Enumeration Documentation

◆ GKSPManagerCostType

Enumerator
eDistance 
eTime 
eAttribute 
eFunction 

Constructor & Destructor Documentation

◆ GKSPManager()

GKSPManager::GKSPManager ( )

Member Function Documentation

◆ build() [1/2]

void GKSPManager::build ( GKModel ,
const GKGenericExperiment filterExperiment 
)

Calculates the shortest paths.

◆ build() [2/2]

void GKSPManager::build ( GKModel model,
const GKGenericExperiment filterExperiment,
const QVector< GKVehicleClass * > &  vClas,
GKVehicle vehicle = nullptr 
)

Calculates the shortest paths taking into account only sections in where "vehicle" can circulated.

◆ calculate()

float GKSPManager::calculate ( GKBezierCurve from,
GKBezierCurve to,
QString &  eventStr 
) const

Calculates the cost of the path beetwen two sections. If no path is found it returns a -1.

◆ cost()

float GKSPManager::cost ( GKSection from,
GKSection to 
) const

returns the actual cost of the path beetwen two sections. If no path is found it returns a -1.

◆ getPath() [1/2]

QVector< GKSection * > GKSPManager::getPath ( GKCentroid ,
GKCentroid  
)

Get the Path between two centroids. If no path is found an empty vector will be returned.

◆ getPath() [2/2]

QVector< GKSection * > GKSPManager::getPath ( GKSection ,
GKSection  
)

Get the Path between two sections. If no path is found an empty vector will be returned.

◆ setAttributeCost()

void GKSPManager::setAttributeCost ( GKColumn ,
GKColumn  
)

For eAttribute cost type set the attributes to use for sections and turns.

◆ setContext()

void GKSPManager::setContext ( const GKContext )

Set the time context (the Now) when using Time Series.

◆ setCostType()

void GKSPManager::setCostType ( const  GKSPManagerCostType)

Set the type of the cost. This function must be call before function "build".

© Aimsun SLU
Aimsun ®