PyANGKernel.GKTurning

class GKTurning

Inheritance diagram of PyANGKernel.GKTurning

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

Detailed Description

It connects some (or all) lanes between two sections.

class GKWarningIndicator

Warning indicator

__init__()
addStopLine(stopLine)
Parameters:

stopLineGKStopLine

Sets the stop line distance relative to the start of the turn (in m)

addTurningEntity(_turningEntity)
Parameters:

_turningEntityGKTurningEntity

Adds a turning entity to the turn

attractiveness()
Return type:

float

Gets the turn attractiveness

automaticCapacity()
Return type:

bool

If true (the default) the capacity is calculated automatically. Otherwise, is defined by the user.

calcAngleBridge()
Return type:

float

Returns the angle, in degrees, between the last segment of the origin section and the turn line. When going clockwise the angle will be negative and when going counterclockwise the angle will be positive

calcAngleSections()
Return type:

float

Returns the angle, in degrees, between the last segment of the origin section and the first segment of the destination section. When going clockwise the angle will be negative and when going counterclockwise the angle will be positive

calculateAndGetCapacity([aModelConnection=None])
Parameters:

aModelConnectionGKModelConnection

Return type:

float

Calculates automatically the turn capacity considering the Model Connection (Attr. Overrides, Geom. Configurations, etc).

calculateDestinationCapacity(destinationCapacity)
Parameters:

destinationCapacity – float

Return type:

float

Calculates the turn capacity taking into account the destination section only, using destinationCapacity as the capacity of the destination section.

calculateOriginCapacity(originCapacity, scenario)
Parameters:
Return type:

float

Calculates the turn capacity taking into account the origin section only, using originCapacity as the capacity of the origin section.

calculateSpeed()
Return type:

float

Calculates automatically the turn speed based on the turn geometry and the sections involved.

calculateSpeed(originSpeed, destinationSpeed)
Parameters:
  • originSpeed – float

  • destinationSpeed – float

Return type:

float

Calculates automatically the turn speed based on the turn geometry and the sections involved.

This variants receives as a parameter the speeds assigned to the origin and destination sections, and it’s used when dealing with overriden values.

canUse(v)
Parameters:

vGKVehicleClass

Return type:

bool

Returns true if this vehicle class can use this turn. It looks at the lanes involved in the turn, both in the origin and the destination sections, to see if they are reserved and cannot be used.

canUseVehicle(vehicle)
Parameters:

vehicleGKVehicle

Return type:

bool

Returns true if this vehicle type can use this turn. It looks at the lanes involved in the turn, both in the origin and the destination sections, to see if they are reserved and cannot be used.

capacity()
Return type:

float

clearTurningEntities()

Clears all the turning entities

curve()

Gives the turn a default curve. It marks the geometry as automatic.

deselectAllStopLines()

Deselects all stop lines.

deselectStopLine(iStopLine)
Parameters:

iStopLine – int

Deselects a stop line.

getAdditionalVolume()
Return type:

float

Returns the Additional Volume

getCapacity()
Return type:

float

Gets the turn capacity, in PCUs/h.

getClosestDestinationLane(originLane[, closestDistance=None])
Parameters:
  • originLane – int

  • closestDistancedouble

Return type:

int

Gets the closest lane (from 0 to N-1) to originLane in the destination section of this turn. If closestDistance is given then the distance between both lanes is also returned.

getClosestOriginLane(destinationLane[, closestDistance=None])
Parameters:
  • destinationLane – int

  • closestDistancedouble

Return type:

int

Gets the closest lane (from 0 to N-1) to destinationLane in the origin section of this turn. If closestDistance is given then the distance between both lanes is also returned.

getDestination()
Return type:

GKSection

Returns the destination of the turn.

getDestinationFromLane()
Return type:

int

Gets the left most lane number (from 0 to N-1) used in the destination section by this turn.

getDestinationToLane()
Return type:

int

Gets the right most lane number (from 0 to N-1) used in the destination section by this turn.

getDistanceZone1()
Return type:

float

Returns the look-ahead.

getDistanceZone2()
Return type:

float

Returns the critical look-ahead.

getDynamicFunction()
Return type:

GKFunctionCost

Get the Dynamic Cost Function for the turn.

getFinalSafetyMarginMeso()
Return type:

float

getInitialGiveWayTimeFactorMeso()
Return type:

float

getInitialSafetyMarginMeso()
Return type:

float

getJunctionDelayFunction()
Return type:

GKFunctionCost

Get the Junction Delay Function for the turn.

getKInitialsFunction()
Return type:

GKFunctionCost

Get the K-Initials Cost Function for the turn.

getLookaheadDistance()
Return type:

float

Returns the meso look-ahead distance.

getManualAttractiveness()
Return type:

float

Gets the manual turn attractiveness (ignores useCapacityAsAttractiveness ). Not recommended.

getManualCapacity()
Return type:

float

Gets the manual turn capacity (ignores automaticCapacity ). Not recommended.

getMaximumGap()
Return type:

float

getMaximumGiveWayTimeFactor()
Return type:

float

getMinimumGap()
Return type:

float

getMinimumGiveWayTimeFactor()
Return type:

float

getNode()
Return type:

GKNode

Gets the node of this turn.

getOrigin()
Return type:

GKSection

Returns the origin of the turn.

getOriginFromLane()
Return type:

int

Gets the left most lane number (from 0 to N-1) used in the origin section by this turn.

getOriginToLane()
Return type:

int

Gets the right most lane number (from 0 to N-1) used in the origin section by this turn.

getPolygon()
Return type:

GKPoints

Returns a detailed polygon (including and end arrow) for this turn

getReactionTimeFactor()
Return type:

float

Gets the reaction time factor for the turn (Meso).

getSegment(originFromLane, originToLane, destFromLane, destToLane)
Parameters:
  • originFromLane – int

  • originToLane – int

  • destFromLane – int

  • destToLane – int

Return type:

GKSegment

It returns the segment, that is, the center line, between a pair of origin lanes and a pair of destination lanes

getSpeed()
Return type:

float

Gets the turn speed in km/h

getStopLineByPoint(p)
Parameters:

pGKPoint

Return type:

float

Returns the stop line under a point or -1.0f if no stop line exists.

getStopLines()
Return type:

.list of GKStopLine

Gets the stop line distance relative to the start of the turn (in m)

getSurroundingPolygon()
Return type:

GKPoints

Returns the polygon for the shape of this turn taking into account the origin and destination lanes involved.

getSurroundingPolygonLine(leftLine)
Parameters:

leftLine – bool

Return type:

GKPoints

Calculates the leftLine or rightLine that will define the turn surrounding polygon

getTurnPenaltyFunction()
Return type:

GKFunctionCost

Get the Turn Penalty Function for the turn.

getTurningEntities()
Return type:

GKTurningEntities

Gets the list of all the turning entities related with this turn.

getTurningEntitiesLength()
Return type:

float

Gets the length (in meters) of all the turning entities related with this turn.

getUserDefinedCost()
Return type:

float

Returns the User-Defined Cost 1

getUserDefinedCost2()
Return type:

float

Returns the User-Defined Cost 2

getUserDefinedCost3()
Return type:

float

Returns the User-Defined Cost 3

getVisibilityDistance()
Return type:

float

getVisibilityDistanceMainStream()
Return type:

float

getVisibilityDistanceMainStreamMeso()
Return type:

float

getWaitingTimeBeforeLosingTurn()
Return type:

float

getWarningIndicator()
Return type:

GKWarningIndicator

Gets the warning indicator

hasCrossWalkArea()
Return type:

bool

Returns if the Node in which this turn is has CrossWalks

hasPedestrianCrossing()
Return type:

bool

Return if this turn has any pedestrian crossings, it might have either at the beginning or at the end

isAutoSpeed()
Return type:

bool

The speed of this turn is calculated automatically?

isInternalRoundaboutTurning()
Return type:

bool

True if the turn is part of a roundabout node and it’s not an entrance/exit to/from the roundabout

isManualGeometry()
Return type:

bool

Is the geometry of this turn manual (user modified)?

isStopLineSelected(iStopLine)
Parameters:

iStopLine – int

Return type:

bool

Returns true if the stop line is selected.

isUsingRoadTypeDistanceZones()
Return type:

bool

returns whether the turn is using its own look-ahead values or it is using the origin section look-ahead values

length3DWithPedestrianCrossings()
Return type:

float

Return the length of this turn considering also the lengths of the pedestrian crossings it might have either at the beginning or at the end

__lt__(item)
Parameters:

itemGKTurning

Return type:

bool

Test if this is smaller than item. It compares first the origin section id and then (if both have the same origin) the destination section id.

recalculateTurningEntities()

Forces a recalculation of the turning entities.

removeAllStopLines()

Removes all the stop lines

removeStopLine(stopLine)
Parameters:

stopLineGKStopLine

Removes the stop line distance relative to the start of the turn (in m)

selectStopLine(iStopLine)
Parameters:

iStopLine – int

Selects a stop line.

setAdditionalVolume(value)
Parameters:

value – float

setAttractiveness(value)
Parameters:

value – float

Sets the turn attractiveness

See also

attractiveness()

setAutoSpeed(value)
Parameters:

value – bool

The speed of this turn is calculated automatically?

See also

isAutoSpeed()

setAutomaticCapacity(value)
Parameters:

value – bool

If true (the default) the capacity is calculated automatically. Otherwise, is defined by the user.

setCapacity(value)
Parameters:

value – float

Sets the turn capacity, in PCUs/h.

setConnection(aorigin, adestination)
Parameters:

Sets the origin and destination objects that this turn links. This function calculates an initial shape for the connection.

setDestination(adestination)
Parameters:

adestinationGKSection

Changes the destination of this turn. This function DON’T change the connection shape

setDestinationLanes(fromLane, toLane)
Parameters:
  • fromLane – int

  • toLane – int

Sets the lanes (from 0 to N-1) used in the destination section by this turn.

setDistanceZone1(aValue)
Parameters:

aValue – float

Sets the look-ahead (Micro) with the specified value<b> only if isUsingRoadTypeDistanceZones() is false.</b> If not, does nothing.

setDistanceZone2(aValue)
Parameters:

aValue – float

Sets the critical look-ahead (Micro) with the specified value<b> only if isUsingRoadTypeDistanceZones() is false.</b> If not, does nothing.

setDynamicFunction(fc)
Parameters:

fcGKFunctionCost

Set the Dynamic Cost Function for the turn.

setFinalSafetyMarginMeso(aValue)
Parameters:

aValue – float

setInitialGiveWayTimeFactorMeso(aValue)
Parameters:

aValue – float

setInitialSafetyMarginMeso(aValue)
Parameters:

aValue – float

setInternalRoundaboutTurning(value)
Parameters:

value – bool

True if the turn is part of a roundabout node and it’s not an entrance/exit to/from the roundabout

setJunctionDelayFunction(fc)
Parameters:

fcGKFunctionCost

Sets the Junction Delay Function for the turn.

setKInitialsFunction(fc)
Parameters:

fcGKFunctionCost

Set the K-Initials Cost Function for the turn.

setLookaheadDistance(aValue)
Parameters:

aValue – float

Sets the look-ahead distance (Meso) with the specified value<b> only if isUsingRoadTypeDistanceZones() is false.</b> If not, does nothing.

setManualGeometry(value)
Parameters:

value – bool

Mark the geometry of this turn as manual (user modified). By default is automatic. Marking it as automatic using this function will not recalculate the geometry (it will happen in the next restore or when calling curve ).

setMaximumGap(aValue)
Parameters:

aValue – float

setMaximumGiveWayTimeFactor(aValue)
Parameters:

aValue – float

setMinimumGap(aValue)
Parameters:

aValue – float

setMinimumGiveWayTimeFactor(aValue)
Parameters:

aValue – float

setNode(anode)
Parameters:

anodeGKNode

Sets, when creating the turn, the node. It cannot be changed later on.

setOrigin(aorigin)
Parameters:

aoriginGKSection

Changes the origin of this turn. This function DON’T change the connection shape

setOriginLanes(fromLane, toLane)
Parameters:
  • fromLane – int

  • toLane – int

Sets the lanes (from 0 to N-1) used in the origin section by this turn.

setReactionTimeFactor(reactionTimeFactor)
Parameters:

reactionTimeFactor – float

Set the reaction time factor for the turn (Meso).

setSpeed(aspeed)
Parameters:

aspeed – float

Sets the turn speed in km/h

setStopLineLength(p, length)
Parameters:
  • p – int

  • length – float

Set the stop line distance of the pth stop line.

setStopLineMark(p, mark)
Parameters:
  • p – int

  • mark – int

Set the stop line mark like a GKGeoObject .

setStopLinePosition(p, position)
Parameters:
  • p – int

  • position – float

Set the stop line position of the pth stop line.

setTurnPenaltyFunction(fc)
Parameters:

fcGKFunctionCost

Sets the Turn Penalty Function for the turn.

setTurningEntitiesProps(_of, _ot, _df, _dt)
Parameters:
  • _of – int

  • _ot – int

  • _df – int

  • _dt – int

Sets the lanes info of the turning entities

setUseCapacityAsAttractiveness(value)
Parameters:

value – bool

If true (the default) the capacity is used as attractiveness. Otherwise, uses the attractiveness defined by the user.

setUseRoadTypeDistanceZones(value)
Parameters:

value – bool

if true, the turn will take look-ahead values from origin section, otherwise, it will use its own values

setUserDefinedCost(value)
Parameters:

value – float

setUserDefinedCost2(value)
Parameters:

value – float

setUserDefinedCost3(value)
Parameters:

value – float

setVisibilityDistance(aValue)
Parameters:

aValue – float

setVisibilityDistanceMainStream(aValue)
Parameters:

aValue – float

setVisibilityDistanceMainStreamMeso(aValue)
Parameters:

aValue – float

setWaitingTimeBeforeLosingTurn(aValue)
Parameters:

aValue – float

setWarningIndicator(givewayIndicator)
Parameters:

givewayIndicatorGKWarningIndicator

Sets the warning indicator

shareDestinationLane(_turning)
Parameters:

_turningGKTurning

Return type:

bool

Returns true if the current turn and the specified turn share a destination lane

shareOriginLane(_turning)
Parameters:

_turningGKTurning

Return type:

bool

Returns true if the current turn and the specified turn share an origin lane

translatedByNode(delta)
Parameters:

deltaGKPoint

Translates a turn (due to a node translation). Don’t call this function.

updatePath(updateSpeedIfAuto)
Parameters:

updateSpeedIfAuto – bool

Recalculates the turn path after a change in the origin and/or destination section geometry.

If the speed is automatic it will evaluate it unless the updateSpeedIfAuto is false (and will be false true the updatePath comes from a restore operation).

useCapacityAsAttractiveness()
Return type:

bool

If true (the default) the capacity is used as attractiveness. Otherwise, uses the attractiveness defined by the user.