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
getCentroidsmethod. Note that using the catalog will give you all the centroids no matter the configuration to be used.Synopsis¶
Methods¶
def
__init__()def
addCentroid()def
contains()def
getCentroids()def
getODMatrices()def
getProblemNet()def
getRoutes()def
getVectors()def
orderCentroids()def
removeCentroid()def
removeODMatrix()def
removeRoute()def
removeVector()def
setProblemNet()
Virtual methods¶
def
activate()def
addODMatrix()def
addRoute()def
addVector()def
deactivate()def
isActive()
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__()¶
GKCentroidConfigurationconstructor- activate()¶
Activates this configuration in the geomodel and deactivates the current configuration before.
- addCentroid(obj[, updateMatrices=true[, sortCentroids=false]])¶
- Parameters:
obj –
GKCentroidupdateMatrices – bool
sortCentroids – bool
Adds a centroid to the centroid configuration. Matrices on this configuration will be updated.
- addODMatrix(matrix)¶
- Parameters:
matrix –
GKODMatrix
Adds a matrix to this configuration
Adds a route to this configuration
Adds a vector to this configuration
- contains(obj)¶
- Parameters:
obj –
GKCentroid- Return type:
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:
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:
returns any existing centroid having the entered name. NULL otherwise
- getCentroids()¶
- Return type:
.list of GKCentroid
- getCentroidsConnectedTo(object)¶
- Parameters:
object –
GKGeoObject- 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:
model –
GKModelcreateIt – bool
- Return type:
Returns the current centroid configuration active in the model. To activate a centroid configuration use the
activatemethod.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).
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:
Returns the Subnetwork this centroid configuration belongs to
Gets all the routes from this configuration
Gets all the vectors from this configuration
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:
obj –
GKCentroidupdateMatrices – bool
Removes a centroid from the configuration. Matrices on this configuration will be updated.
- removeODMatrix(matrix)¶
- Parameters:
matrix –
GKODMatrix
Removes a matrix from this configuration
Removes a route from this configuration
Removes a vector from this configuration
- setProblemNet(pn)¶
- Parameters:
pn –
GKProblemNet
Sets the Subnetwork this centroid configuration belongs to