PyANGKernel.GKSPManager¶
- class GKSPManager¶
A class with all the shortest paths in a network.
Details
The
GKSPManagerholds 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¶
def
__init__()def
anyPath()def
build()def
buildExistent()def
calculate()def
cost()def
getModel()def
getPath()def
getPathAndCost()def
getSectionCost()def
getTurningCost()def
setContext()def
setCostType()
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__()¶
Returns true if there is a path between from and to.
- build(model, filterExperiment)¶
- Parameters:
model –
GKModelfilterExperiment –
GKGenericExperiment
Calculates the shortest paths.
- build(iModel, filterExperiment, iSections)
- Parameters:
iModel –
GKModelfilterExperiment –
GKGenericExperimentiSections – .list of GKSection
- build(iModel, filterScenario, iSections)
- Parameters:
iModel –
GKModelfilterScenario –
GKGenericScenarioiSections – .list of GKSection
- build(model, filterExperiment, vClas[, vehicle=None])
- Parameters:
model –
GKModelfilterExperiment –
GKGenericExperimentvClas – .list of GKVehicleClass
vehicle –
GKVehicle
Calculates the shortest paths taking into account only sections in where “vehicle” can circulated.
- buildExistent(iModel, iExistentObjects)¶
- Parameters:
iModel –
GKModeliExistentObjects – .QSetquint32
Build graph using these objects.
- buildNonExistent(iModel, iNonExistentObjects)¶
- Parameters:
iModel –
GKModeliNonExistentObjects – .QSetquint32
Build graph using these objects.
- calculate(from, to, eventStr)¶
- Parameters:
from –
GKBezierCurveto –
GKBezierCurveeventStr – str
- Return type:
Calculates the cost of the path between two bezier curves (either section or turn). If no path is found it returns a -1.
Returns the used
GKModel- getPath(from, to)¶
- Parameters:
from –
GKCentroidto –
GKCentroid
- Return type:
.list of GKSection
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.
- getPathAndCost(from, to)¶
- Parameters:
from –
GKCentroidto –
GKCentroid
- 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)
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)¶
Returns the actual section and turn cost using the associated function cost, if this function is not defined returns 0
Returns the actual section cost.
Returns the actual turn cost.
- setAttributeCost(asectionCol, aturningCol)¶
For eAttribute cost type set the attributes to use for sections and turns
Set the time context (the Now) when using Time Series
- setCostType(aType)¶
- Parameters:
aType –
GKSPManagerCostType
Set the type of the cost. This function must be call before function “build”.
- setFunctionCost(function)¶
- Parameters:
function –
GKFunctionCost
for eFunction, the cost will be calculated using the function