Aimsun Next Scripting
22
|
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 |
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.
GKSPManager::GKSPManager | ( | ) |
void GKSPManager::build | ( | GKModel * | , |
const GKGenericExperiment * | filterExperiment | ||
) |
Calculates the shortest paths.
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.
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.
returns the actual cost of the path beetwen two sections. If no path is found it returns a -1.
QVector< GKSection * > GKSPManager::getPath | ( | GKCentroid * | , |
GKCentroid * | |||
) |
Get the Path between two centroids. If no path is found an empty vector will be returned.
Get the Path between two sections. If no path is found an empty vector will be returned.
For eAttribute cost type set the attributes to use for sections and turns.
void GKSPManager::setContext | ( | const GKContext & | ) |
Set the time context (the Now) when using Time Series.
void GKSPManager::setCostType | ( | const | GKSPManagerCostType | ) |
Set the type of the cost. This function must be call before function "build".