PyANGKernel.GKSPManager

class GKSPManager

A class with all the shortest paths in a network.

Details

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: - Distance: Length of the object. - Time: Time needed to cross the object using the length and the section speed. - Attribute: One of one attribute of the object. - Function: in progress.

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.

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

class GKSPManagerCostType
__init__()
anyPath(from, to)
Parameters:
Return type:

bool

Returns true if there is a path between from and to.

build(model, filterExperiment)
Parameters:

Calculates the shortest paths.

build(iModel, filterExperiment, iSections)
Parameters:
build(iModel, filterScenario, iSections)
Parameters:
build(model, filterExperiment, vClas[, vehicle=None])
Parameters:

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

buildExistent(iModel, iExistentObjects)
Parameters:
  • iModelGKModel

  • iExistentObjects – .QSetquint32

Build graph using these objects.

buildNonExistent(iModel, iNonExistentObjects)
Parameters:
  • iModelGKModel

  • iNonExistentObjects – .QSetquint32

Build graph using these objects.

calculate(from, to, eventStr)
Parameters:
Return type:

float

Calculates the cost of the path between two bezier curves (either section or turn). If no path is found it returns a -1.

cost(from, to)
Parameters:
Return type:

float

getModel()
Return type:

GKModel

Returns the used GKModel

getPath(from, to)
Parameters:
Return type:

.list of GKSection

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

getPath(from, to)
Parameters:
Return type:

.list of GKSection

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

getPathAndCost(from, to)
Parameters:
Return type:

.std.pairlist of GKSection,double

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

getPathAndCost(from, to)
Parameters:
Return type:

.std.pairlist of GKSection,double

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

getSectionAndTurningCost(section, turn)
Parameters:
Return type:

float

Returns the actual section and turn cost using the associated function cost, if this function is not defined returns 0

getSectionCost(section)
Parameters:

sectionGKSection

Return type:

float

Returns the actual section cost.

getTurningCost(turning)
Parameters:

turningGKTurning

Return type:

float

Returns the actual turn cost.

setAttributeCost(asectionCol, aturningCol)
Parameters:

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

setContext(acontext)
Parameters:

acontextGKContext

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

setCostType(aType)
Parameters:

aTypeGKSPManagerCostType

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

setFunctionCost(function)
Parameters:

functionGKFunctionCost

for eFunction, the cost will be calculated using the function