PyANGKernel.GKDestinationChange

class GKDestinationChange

A traffic management action to change the destination

Details

Changes the destination of a vehicle to a new centroid. Valid only when using OD matrices.

Inheritance diagram of PyANGKernel.GKDestinationChange

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__()
addNewDestinationCentroid(aCentroid, aPercentage)
Parameters:

If ‘aCentroid’ is not amongst the destination centroids and is not null, it will be added with ‘aPercentage’ assigned

clearNewDestinationCentroids()

Erases all destination centroids and their stored percentage [Used in Editor]

containsNewDestinationCentroid(centroid)
Parameters:

centroidGKCentroid

Return type:

bool

Helper to know if the centroid is already in the list of destination centroids or not

getCentroidConfiguration()
Return type:

GKCentroidConfiguration

The centroid configuration

getDestinationCentroidOrGroup()
Return type:

GKPolygon

Gets the destination centroid or centroid grouping of the affected car. Can be NULL, means ANY.

getNewDestinationCentroidAt(i)
Parameters:

i – int

Return type:

GKCentroid

Returns the destination centroid stored at the i-th position. Precondition i: [0, size)

getNewDestinationCentroidPercentage(aCentroid)
Parameters:

aCentroidGKCentroid

Return type:

float

Returns the percentage assigned to the destination centroid ‘aCentroid’, if ‘aCentroid’ is not amongst the destination centroids, returns 0.0

getNewDestinationCentroidPercentageAt(pos)
Parameters:

pos – int

Return type:

float

Returns the percentage assigned to the destination centroid at position ‘pos’

getOriginCentroidOrGroup()
Return type:

GKPolygon

Gets the origin centroid or centroid grouping of the affected car. Can be NULL, means ANY.

joinNewDestinationCentroids(masterCentroid, otherCentroid)
Parameters:

If masterCentroid and otherCentroid are amongst the destination centroids, it removes otherCentroid and sums its percentage to masterCentroid’s assigned percentage

numberOfNewDestinationCentroids()
Return type:

int

Returns de number of destination centroids stored in this Destination Change

removeNewDestinationCentroid(aCentroid)
Parameters:

aCentroidGKCentroid

If ‘aCentroid’ is amongst the destination centroids, it will be removed

removeNewDestinationCentroidAt(pos)
Parameters:

pos – int

Removes the destination centroid at position ‘pos’. Precondition pos: [0, size)

revertJoinNewDestinationCentroids(masterCentroid, otherCentroid, otherCentroidPercentage)
Parameters:

If masterCentroid is amongst the destination centroids and otherCentroid is not, it adds otherCentroid with ‘otherCentroidPercentage’ assigned and the remaining percentage to masterCentroid

setCentroidConfiguration(config)
Parameters:

configGKCentroidConfiguration

The centroid configuration

setDestinationCentroidOrGroup(centroidOrGroup)
Parameters:

centroidOrGroupGKPolygon

Sets the destination centroid or centroid grouping of the affected car. Can be NULL, means ANY.

setNewDestinationCentroidPercentage(aCentroid, aPercentage)
Parameters:

If ‘aCentroid’ is among the destination centroids: Modifies the percentage assigned to the destination centroid ‘aCentroid’

setNewDestinationCentroidPercentageAt(pos, aPercentage)
Parameters:
  • pos – int

  • aPercentage – float

Modifies the percentage assigned to the destination centroid at position ‘pos’

setOriginCentroidOrGroup(centroidOrGroup)
Parameters:

centroidOrGroupGKPolygon

Sets the origin centroid or centroid grouping of the affected car. Can be NULL, means ANY.

sortByCentroidID()

Keeps structure sorted by centroid ID.

totalPercentage()
Return type:

float

Returns the sum of the percentages of the destination centroids