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 GKCentroid type, 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).

Inheritance diagram of PyANGKernel.GKCentroid

Synopsis

Methods

Virtual 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

class GKCentroidPercentages
class GKCentroidTraversalTypes
__init__()

GKCentroid constructor

changeConnectionType(connection, atype)
Parameters:

Changes the type of one centroid connection. It calls GKCenConnection::setConnectionType and recomputes the percentages and the centroid type.

getCentroidConfiguration()
Return type:

GKCentroidConfiguration

Gets the centroid configuration this centroid belongs to.

getCentroidTraversalType()
Return type:

GKCentroidTraversalTypes

Gets the centroid traversal type

getCentroidType()
Return type:

ODType

Returns the type of the centroid based on its connections.

getConsideredPercentages()
Return type:

GKCentroidPercentages

Returns the considered percentages type.

getGeneratedFrom()
Return type:

GKCentroid

getNumberConnectionsFrom()
Return type:

int

Returns the number of sections that have this centroid as destination.

getNumberConnectionsTo()
Return type:

int

Returns the number of sections that have this centroid as origin.

getParkAndRideCapacity()
Return type:

float

Gets the park and ride capacity.

getParkAndRideFunction()
Return type:

GKFunctionCost

Gets the park and ride function.

getParkAndRidePrice()
Return type:

float

Gets the park and ride price.

getPosition()
Return type:

GKPoint

Returns the center of the zone.

getSplitCentroidDestinationTripsPercentage()
Return type:

float

getSplitCentroidOriginTripsPercentage()
Return type:

float

getSplitCentroidParkAndRideCapacityPercentage()
Return type:

float

getUseBestEntrance()
Return type:

bool

Returns the Use Best Entrance value.

hasDefinedPolygon()
Return type:

bool

Returns if the polygon was defined by the user.

isAStation()
Return type:

bool

Returns true if this centroid is connected to Transit Stops.

isActive()
Return type:

bool

Returns true if a centroid is active, that is, if the centroid configuration it belongs to is active.

isCentroidCentered()
Return type:

bool

Returns if CentroidCentered is activated or not.

isDestination()
Return type:

bool

Returns true if the centroid is a destination.

isLessThan(cen)
Parameters:

cenGKCentroid

Return type:

bool

Returns true if the identifier of this centroid is lower than identifier of centroid ‘cen’.

isOrigin()
Return type:

bool

Returns true if the centroid is an origin.

objectODType([object=None])
Parameters:

objectGKGeoObject

Return type:

ODType

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:

scenarioGKGenericScenario

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.

setCentroidConfiguration(cenConf)
Parameters:

cenConfGKCentroidConfiguration

Sets the centroid configuration this centroid belongs to.

setCentroidTraversalType(_type)
Parameters:

_typeGKCentroidTraversalTypes

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:

pGKCentroidPercentages

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)

setFromPosition(p)
Parameters:

pGKPoint

Sets the coordinates of the centroid from a single point.

setGeneratedFrom(from)
Parameters:

fromGKCentroid

setManualPosition(p)
Parameters:

pGKPoint

Sets the position of the centroid independently of the polygon.

setParkAndRideCapacity(capacity)
Parameters:

capacity – float

Sets the park and ride capacity.

setParkAndRideFunction(function)
Parameters:

functionGKFunctionCost

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 useInMatrix attribute.

See also

useInMatrix()

useInMatrix()
Return type:

bool

Returns true if a centroid is used in an OD matrix.

See also

setUseInMatrix()