PyANGKernel.GKTurning¶
- class GKTurning¶
-
Synopsis¶
Methods¶
def
__init__()def
addStopLine()def
attractiveness()def
calculateSpeed()def
canUse()def
canUseVehicle()def
capacity()def
curve()def
getCapacity()def
getDestination()def
getMaximumGap()def
getMinimumGap()def
getNode()def
getOrigin()def
getPolygon()def
getSegment()def
getSpeed()def
getStopLines()def
isAutoSpeed()def
__lt__()def
removeStopLine()def
selectStopLine()def
setAutoSpeed()def
setCapacity()def
setMaximumGap()def
setMinimumGap()def
setNode()def
setOriginLanes()def
setSpeed()def
updatePath()
Virtual methods¶
def
setConnection()def
setDestination()def
setOrigin()
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:
stopLine –
GKStopLine
Sets the stop line distance relative to the start of the turn (in m)
- addTurningEntity(_turningEntity)¶
- Parameters:
_turningEntity –
GKTurningEntity
Adds a turning entity to the turn
Gets the turn attractiveness
See also
If true (the default) the capacity is calculated automatically. Otherwise, is defined by the user.
See also
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
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:
aModelConnection –
GKModelConnection- Return type:
Calculates automatically the turn capacity considering the Model Connection (Attr. Overrides, Geom. Configurations, etc).
- calculateDestinationCapacity(destinationCapacity)¶
- Parameters:
destinationCapacity – float
- Return type:
Calculates the turn capacity taking into account the destination section only, using destinationCapacity as the capacity of the destination section.
- calculateOriginCapacity(originCapacity, scenario)¶
- Parameters:
originCapacity – float
scenario –
GKGenericScenario
- Return type:
Calculates the turn capacity taking into account the origin section only, using originCapacity as the capacity of the origin section.
Calculates automatically the turn speed based on the turn geometry and the sections involved.
- calculateSpeed(originSpeed, destinationSpeed)
- Parameters:
originSpeed – float
destinationSpeed – float
- Return type:
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:
v –
GKVehicleClass- Return type:
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.
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.
- 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.
Returns the Additional Volume
Gets the turn capacity, in PCUs/h.
- getClosestDestinationLane(originLane[, closestDistance=None])¶
- Parameters:
originLane – int
closestDistance –
double
- Return type:
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
closestDistance –
double
- Return type:
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.
Returns the destination of the turn.
Gets the left most lane number (from 0 to N-1) used in the destination section by this turn.
Gets the right most lane number (from 0 to N-1) used in the destination section by this turn.
Returns the look-ahead.
Returns the critical look-ahead.
- getDynamicFunction()¶
- Return type:
Get the Dynamic Cost Function for the turn.
- getJunctionDelayFunction()¶
- Return type:
Get the Junction Delay Function for the turn.
- getKInitialsFunction()¶
- Return type:
Get the K-Initials Cost Function for the turn.
Returns the meso look-ahead distance.
Gets the manual turn attractiveness (ignores
useCapacityAsAttractiveness). Not recommended.Gets the manual turn capacity (ignores
automaticCapacity). Not recommended.Gets the node of this turn.
Returns the origin of the turn.
Gets the left most lane number (from 0 to N-1) used in the origin section by this turn.
Gets the right most lane number (from 0 to N-1) used in the origin section by this turn.
Returns a detailed polygon (including and end arrow) for this turn
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:
It returns the segment, that is, the center line, between a pair of origin lanes and a pair of destination lanes
Gets the turn speed in km/h
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)
Returns the polygon for the shape of this turn taking into account the origin and destination lanes involved.
Calculates the leftLine or rightLine that will define the turn surrounding polygon
- getTurnPenaltyFunction()¶
- Return type:
Get the Turn Penalty Function for the turn.
- getTurningEntities()¶
- Return type:
Gets the list of all the turning entities related with this turn.
Gets the length (in meters) of all the turning entities related with this turn.
Returns the User-Defined Cost 1
Returns the User-Defined Cost 2
Returns the User-Defined Cost 3
- getWarningIndicator()¶
- Return type:
Gets the warning indicator
Returns if the Node in which this turn is has CrossWalks
Return if this turn has any pedestrian crossings, it might have either at the beginning or at the end
The speed of this turn is calculated automatically?
True if the turn is part of a roundabout node and it’s not an entrance/exit to/from the roundabout
Is the geometry of this turn manual (user modified)?
Returns true if the stop line is selected.
returns whether the turn is using its own look-ahead values or it is using the origin section look-ahead values
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
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:
stopLine –
GKStopLine
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
- setAutoSpeed(value)¶
- Parameters:
value – bool
The speed of this turn is calculated automatically?
See also
- setAutomaticCapacity(value)¶
- Parameters:
value – bool
If true (the default) the capacity is calculated automatically. Otherwise, is defined by the user.
See also
- setCapacity(value)¶
- Parameters:
value – float
Sets the turn capacity, in PCUs/h.
Sets the origin and destination objects that this turn links. This function calculates an initial shape for the connection.
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:
fc –
GKFunctionCost
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
See also
- setJunctionDelayFunction(fc)¶
- Parameters:
fc –
GKFunctionCost
Sets the Junction Delay Function for the turn.
- setKInitialsFunction(fc)¶
- Parameters:
fc –
GKFunctionCost
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).See also
- setMaximumGap(aValue)¶
- Parameters:
aValue – float
- setMaximumGiveWayTimeFactor(aValue)¶
- Parameters:
aValue – float
- setMinimumGap(aValue)¶
- Parameters:
aValue – float
- setMinimumGiveWayTimeFactor(aValue)¶
- Parameters:
aValue – float
Sets, when creating the turn, the node. It cannot be changed later on.
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:
fc –
GKFunctionCost
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.
See also
- 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:
givewayIndicator –
GKWarningIndicator
Sets the warning indicator
Returns true if the current turn and the specified turn share a destination lane
Returns true if the current turn and the specified turn share an origin lane
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).
If true (the default) the capacity is used as attractiveness. Otherwise, uses the attractiveness defined by the user.
See also