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.

Inheritance diagram of PyMacroToolPlugin.MacroTraversal

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

__init__(scenario)
Parameters:

scenarioMacroScenario

addTraversalMatrixToModel(_userClass, scenario[, travName=""])
Parameters:
  • _userClassGKUserClass

  • scenarioGKGenericScenario

  • travName – 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

getErrorMessage()
Return type:

str

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:

_parsMacroTraversalPars

setTypeOfPercentageInInternalCentroids([value=MacroTraversalPars.eAssignment])
Parameters:

valueMacroTraversalPercentagesTypes

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:
  • _treeNSPTreeData

  • iUserIndex – int

  • _originGKCentroid

  • _destinationGKCentroid

  • _volume – float

  • iInOutTrips – Dictionary with keys of type .std.pairGKCentroid and values of type GKCentroid.

traversal(_pNet, _forest, _demand, _ptPlan, model, taskId, scenario)
Parameters:
  • _pNetGKProblemNet

  • _forestBaseForest

  • _demandGKTrafficDemand

  • _ptPlanGKPublicLinePlan

  • modelGKModel

  • taskId – str

  • scenarioGKGenericScenario

Return type:

bool

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.