PyANGKernel.GKCentroid¶
- class GKCentroid¶
A centroid is an origin and/or destination of trips.
Details
It is connected to a set of sections and/or nodes. There are two types of connections: - From: from the object to the centroid. Vehicles will exit the network when they reach the centroid via the end of the connected object. - To: to the object from the centroid. Vehicles will be injected in the object (that is, in the network).
A centroid is, based on the type of connections that it has, an origin, a destination or both. If all the connections are To it is an origin. If all the connections are From it is a destination. If it has From and To connections it is an origin and a destination.
Information for each connection is stored in
GKCenConnection.Centroids are both in the catalog, sorted by
GKCentroidtype, and in its corresponding Centroid Configuration (GKCentroidConfiguration). To access the centroids of a matrix, never look in the catalog as it will list all the centroids no matter the configuration, use the configuration instead (to look in the centroids for a particular configuration).Synopsis¶
Methods¶
def
__init__()def
isAStation()def
isActive()def
isLessThan()def
objectODType()def
setUseInMatrix()def
useInMatrix()
Virtual methods¶
def
getPosition()def
isDestination()def
isOrigin()
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 GKCentroidPercentages¶
- class GKCentroidTraversalTypes¶
- __init__()¶
GKCentroidconstructor- changeConnectionType(connection, atype)¶
- Parameters:
connection –
GKObjectConnectionatype –
ConnectionType
Changes the type of one centroid connection. It calls GKCenConnection::setConnectionType and recomputes the percentages and the centroid type.
- getCentroidConfiguration()¶
- Return type:
Gets the centroid configuration this centroid belongs to.
- getCentroidTraversalType()¶
- Return type:
Gets the centroid traversal type
Returns the type of the centroid based on its connections.
- getConsideredPercentages()¶
- Return type:
Returns the considered percentages type.
- getGeneratedFrom()¶
- Return type:
Returns the number of sections that have this centroid as destination.
Returns the number of sections that have this centroid as origin.
Gets the park and ride capacity.
- getParkAndRideFunction()¶
- Return type:
Gets the park and ride function.
Gets the park and ride price.
Returns the center of the zone.
Returns the Use Best Entrance value.
Returns if the polygon was defined by the user.
Returns true if this centroid is connected to Transit Stops.
Returns true if a centroid is active, that is, if the centroid configuration it belongs to is active.
Returns if CentroidCentered is activated or not.
Returns true if the centroid is a destination.
- isLessThan(cen)¶
- Parameters:
cen –
GKCentroid- Return type:
Returns true if the identifier of this centroid is lower than identifier of centroid ‘cen’.
Returns true if the centroid is an origin.
- objectODType([object=None])¶
- Parameters:
object –
GKGeoObject- Return type:
Convience function. Alias to
ToODType(objectConnectionType(object) ).- recalculateCentroidType()¶
After adding or removing a connection or restoring this centroid, recalculates the type of the centroid.
- recalculatePercentages([scenario=None])¶
- Parameters:
scenario –
GKGenericScenario
Recalculates the percentages of each connection when: - Using auto percentages - If no From percentages are used then it calculates the From percentages automatically. - If no To percentages are used then it calculates the To percentages automatically. In particular, it’s always automatically called when a new connection is added/removed.
- setCentroidCentered(isCentered)¶
- Parameters:
isCentered – bool
Sets the position of the centroid (as a point in the polygon) automatically, that is, in the center of the polygon.
See also
- setCentroidConfiguration(cenConf)¶
- Parameters:
cenConf –
GKCentroidConfiguration
Sets the centroid configuration this centroid belongs to.
- setCentroidTraversalType(_type)¶
- Parameters:
_type –
GKCentroidTraversalTypes
Sets the centroid traversal type: - eNoTraversal : the centroid has no traversal type - eInTraversal : the centroid is inside of a traversal - eOutTraversal : the centroid is outside of a traversal
- setConsideredPercentages(p)¶
- Parameters:
Sets the way percentages are considered for meso and micro simulations among the different options: - eNothing: the simulator is in charge of assigning the usage percentage of each connection based on the route choice model used, they are not user-defined. - eOrigin: consider the percentages defined for the entrances of the network connected to the centroid - eDestination: consider the percentages defined for the exits of the network connected to the centroid - eBoth: consider the percentages defined for both entrances and exits of the network connected to the centroid - eSame: use the same percentage for all the entrance connections (that is, 100.0/nbentrances per entrance) and all the exits connections (that is, 100.0/nbexits per exit)
Sets the coordinates of the centroid from a single point.
- setGeneratedFrom(from)¶
- Parameters:
from –
GKCentroid
Sets the position of the centroid independently of the polygon.
- setParkAndRideCapacity(capacity)¶
- Parameters:
capacity – float
Sets the park and ride capacity.
- setParkAndRideFunction(function)¶
- Parameters:
function –
GKFunctionCost
Sets the park and ride function.
- setParkAndRidePrice(price)¶
- Parameters:
price – float
Sets the park and ride price.
- setPositionByConnections()¶
Sets the position of this centroid using the position of the objects it is attached with.
- setSplitCentroidDestinationTripsPercentage(value)¶
- Parameters:
value – float
- setSplitCentroidOriginTripsPercentage(value)¶
- Parameters:
value – float
- setSplitCentroidParkAndRideCapacityPercentage(value)¶
- Parameters:
value – float
- setUseBestEntrance(value)¶
- Parameters:
value – bool
The Use Best Entrance parameter sets whether the route choice algorithm will take into account, for each origin centroid and for each calculation, only the one shortest path from the entrance with the lowest cost (Use Best Entrance checked) or one shortest path from each entrance section (Use Best Entrance not checked). It only makes sense to set it to true when the connection percentages are set to eNothing.
- setUseInMatrix(value)¶
- Parameters:
value – bool
Set the
useInMatrixattribute.See also
Returns true if a centroid is used in an OD matrix.
See also