PyANGKernel.GKCentroidConfiguration

class GKCentroidConfiguration

Centroid configuration: a collection of centroids.

Details

A network can have several centroid configurations but only one can be active in the view. Any OD matrix, OD route and centroid belongs to only for a particular configuration.

Centroid configurations can be defined either at a global level for the whole network or at a local level for a subnetwork. The internal name of the centroid configuration folder is: - At the global model level: “GKModel::centroidsConf” - When in a subnetwork: “GKProblemNet::centroidsConf” The external name is “Centroid Configurations”

You can access the centroids in a configuration using the getCentroids method. Note that using the catalog will give you all the centroids no matter the configuration to be used.

Inheritance diagram of PyANGKernel.GKCentroidConfiguration

Synopsis

Methods

Virtual methods

Static functions

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__()

GKCentroidConfiguration constructor

activate()

Activates this configuration in the geomodel and deactivates the current configuration before.

addCentroid(obj[, updateMatrices=true[, sortCentroids=false]])
Parameters:
  • objGKCentroid

  • updateMatrices – bool

  • sortCentroids – bool

Adds a centroid to the centroid configuration. Matrices on this configuration will be updated.

addODMatrix(matrix)
Parameters:

matrixGKODMatrix

Adds a matrix to this configuration

addRoute(pn)
Parameters:

pnGKODRoute

Adds a route to this configuration

addVector(pn)
Parameters:

pnGKObject

Adds a vector to this configuration

contains(obj)
Parameters:

objGKCentroid

Return type:

bool

Returns true if the centroid obj is part of this configuration

deactivate()

Deactivates this configuration

getCentroidByExternalId(eid[, origin=true])
Parameters:
  • eid – str

  • origin – bool

Return type:

GKCentroid

Returns the origin or destination centroid (depending on the second parameter) in this centroid configuration having the entered external ID. NULL otherwise. Unconnected centroids will not be found using this function.

getCentroidByName(name[, origin=true])
Parameters:
  • name – str

  • origin – bool

Return type:

GKCentroid

returns any existing centroid having the entered name. NULL otherwise

getCentroids()
Return type:

.list of GKCentroid

getCentroidsConnectedTo(object)
Parameters:

objectGKGeoObject

Return type:

.std.pairlist of GKCentroid,list of GKCentroid

Returns two lists of centroids to where object is connected. The first list in the pair is for origin centroids, the second list is for destination centroids. Note that a centroid can be in both lists (origin and destination centroids).

getCentroidsInOrder()
Return type:

.list of GKCentroid

Sorts by identifier and returns the centroids on this configuration.

static getCreateActiveCentroidConfiguration(model[, createIt=false])
Parameters:
  • modelGKModel

  • createIt – bool

Return type:

GKCentroidConfiguration

Returns the current centroid configuration active in the model. To activate a centroid configuration use the activate method.

If no centroid configuration is active and createIt is false then None is returned. If createIt is true then a new centroid configuration is created and it is set as the active one.

getDestinationCentroids()
Return type:

.list of GKCentroid

Returns a list of all the (possible) destination centroids. It looks at the centroid connection but do not look to see if these connections are used or not (in a matrix).

getODMatrices()
Return type:

GKFolder

Gets all the matrices from this configuration

getOriginCentroids()
Return type:

.list of GKCentroid

Returns a list of all the (possible) origin centroids. It looks at the centroid connection but do not look to see if these connections are used or not (in a matrix).

getProblemNet()
Return type:

GKProblemNet

Returns the Subnetwork this centroid configuration belongs to

getRoutes()
Return type:

GKFolder

Gets all the routes from this configuration

getVectors()
Return type:

GKFolder

Gets all the vectors from this configuration

isActive()
Return type:

bool

Returns true if this configuration is the active one in the model.

markEntrancesAndExits()

Mark all sections (and detectors) connected to centroids as entrance or exit (or both)

orderCentroids()

Sorts by identifier the centroids on this configuration.

removeCentroid(obj[, updateMatrices=true])
Parameters:

Removes a centroid from the configuration. Matrices on this configuration will be updated.

removeODMatrix(matrix)
Parameters:

matrixGKODMatrix

Removes a matrix from this configuration

removeRoute(pn)
Parameters:

pnGKODRoute

Removes a route from this configuration

removeVector(pn)
Parameters:

pnGKObject

Removes a vector from this configuration

setProblemNet(pn)
Parameters:

pnGKProblemNet

Sets the Subnetwork this centroid configuration belongs to