PyMacroToolPlugin.MacroTraversal¶
- class MacroTraversal¶
Matrix static traversal calculation for a sub-area
Details
Class for calculating a traversal matrix for a sub-area. It contains all the input data needed for the traversal and the output data obtained once the traversal has been calculated.
Synopsis¶
Methods¶
def
__init__()def
getMatrix()def
setPars()def
trackPath()def
traversal()
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
- __init__(scenario)¶
- Parameters:
scenario –
MacroScenario
- addTraversalMatrixToModel(_userClass, scenario[, travName=""])¶
- Parameters:
_userClass –
GKUserClassscenario –
GKGenericScenariotravName – str
- Return type:
GKODMatrix
Once the traversal algorithm has been executed, by calling this function the traversal matrix is added to the
GKModel. An optional name for this traversal matrix can be provided. The new matrix created is returned- getMatrix()¶
- Return type:
.list of GKODMatrix
- setOuputMessagesOn(value)¶
- Parameters:
value – bool
It sets whether to write messages (related to the assignment process) in the console or not, depending on ‘value’
- setPars(_pars)¶
- Parameters:
_pars –
MacroTraversalPars
- setTypeOfPercentageInInternalCentroids([value=MacroTraversalPars.eAssignment])¶
- Parameters:
value –
MacroTraversalPercentagesTypes
Sets whether to keep original percentages in the internal centroids (eOriginal), to set to these internal centroids the percentages given from the assignment (eAssignment) or to not assign any percentage (eNone)
- trackPath(_tree, iUserIndex, _origin, _destination, _volume, iInOutTrips)¶
- Parameters:
_tree –
NSPTreeDataiUserIndex – int
_origin –
GKCentroid_destination –
GKCentroid_volume – float
iInOutTrips – Dictionary with keys of type .std.pairGKCentroid and values of type GKCentroid.
- traversal(_pNet, _forest, _demand, _ptPlan, model, taskId, scenario)¶
- Parameters:
_pNet –
GKProblemNet_forest –
BaseForest_demand –
GKTrafficDemand_ptPlan –
GKPublicLinePlanmodel –
GKModeltaskId – str
scenario –
GKGenericScenario
- Return type:
It applies the algorithm to calculate a traversal matrix receiving as input a subnetwork, an initial matrix and the desired parameters to be used in the internal assignments the algorithm calculates. It returns true if the traversal has been successfully calculated and false if any error has occurred.