PyANGKernel.GKSection

class GKSection

Inheritance diagram of PyANGKernel.GKSection

Synopsis

Methods

Static functions

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

We have to understand GKSection as one of the base building blocks of an Aimsun Network.

A section is a group of contiguous lanes where vehicles move in the same direction. The partition of the traffic network into sections is usually governed by the physical boundaries of the area and the existence of turning movements. In an urban network, a section corresponds closely to the road from one intersection to the next. In a freeway area, a section can be the part of the road between two ramps.

class sectionSide
class LateralType
class GKSectionOrientation
PyANGKernel.GKSection.gcMinSpeed
PyANGKernel.GKSection.gcMaxSpeed
PyANGKernel.GKSection.gcMinCapacity
PyANGKernel.GKSection.gcMaxCapacity
PyANGKernel.GKSection.gcMinZone
PyANGKernel.GKSection.gcMaxZone
PyANGKernel.GKSection.gcMinVisibility
PyANGKernel.GKSection.gcMaxVisibility
PyANGKernel.GKSection.gcMinLookAheadDistance
PyANGKernel.GKSection.gcMaxLookAheadDistance
PyANGKernel.GKSection.gcMinLineAngle
PyANGKernel.GKSection.gcMaxLineAngle
PyANGKernel.GKSection.gcMinLaneWidth
PyANGKernel.GKSection.gcMaxLaneWidth
PyANGKernel.GKSection.gcMaxNumberOfLanes
PyANGKernel.GKSection.gcMinJamDensity
PyANGKernel.GKSection.gcMaxJamDensity
PyANGKernel.GKSection.gkMaxSlope
PyANGKernel.GKSection.gkMinSlope
PyANGKernel.GKSection.gkStopLineMinDistanceToStart
PyANGKernel.GKSection.gkSideLaneMinLength
PyANGKernel.GKSection.gkDefaultSectionColor
PyANGKernel.GKSection.gkDefaultSectionHullColor
PyANGKernel.GKSection.gkDefaultSectionReservedColor
PyANGKernel.GKSection.gkDefaultSectionSignColor
PyANGKernel.GKSection.gkDefaultArrowColor
PyANGKernel.GKSection.gkDefaultTurnColor
__init__()
addLane(lane[, lanepos=-1])
Parameters:

Add a lane to this section at position lanepos. ID lanepos is -1 (the default) the lane will be the last lane (rightmost).

adjustTopObjects([objChanged=None])
Parameters:

objChangedGKGeoObject

Return type:

bool

Adjust geometry of all other objects associated with this section. Used whenever a given section object is added, changes its geometry, etc…, so maybe it’s necessary to adjust the existing ones. UnknownCommand objChanged : object added / edited (it will be skipped) UnknownCommand true if any changes are made, false otherwise

autoCurveTurnings([curveStraightTurnings=true])
Parameters:

curveStraightTurnings – bool

This function recalculates the geometry of all the turnings entering or leaving the current section.

calculateLanePolyline(lane, keepSegments[, nbpoints=0[, segmentsBeginPos=None]])
Parameters:
  • lane – int

  • keepSegments – bool

  • nbpoints – int

  • segmentsBeginPosQList

Return type:

GKPoints

Calculates a polyline that represents the lane desired. Lanes are numbered from 0 (the leftmost one) to number of lanes -1. The polyline is calculated in “points” and “points” is also returned.

If keepSegments is true it will keep at least one point per section segment, if false it will simplify the number of points as most as possible.

If segmentsBeginPos is not nullptr in this vector (one entry by segment) the start position of each segment is returned (start position in the array of calculated points).

If nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

calculateLanePolylineWithoutPedestrianCrossings(lane[, nbpoints=0[, segmentsBeginPos=None[, full=false]]])
Parameters:
  • lane – int

  • nbpoints – int

  • segmentsBeginPosQList

  • full – bool

Return type:

GKPoints

Calculates a polyline that represents the lane desired without considerings the pedestrian crossings that might be at the beginning or end of the section. Lanes are numbered from 0 (the leftmost one) to number of lanes -1. The polyline is calculated in “points” and “points” is also returned.

If segmentsBeginPos is not nullptr in this vector (one entry by segment) the start position of each segment is returned (start position in the array of calculated points).

If nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

If full is true, then it will be assumed that the lane is full ignoring any side lane offsets

calculatePolylineWithoutPedestrianCrossings(points[, nbpoints=0[, segmentsBeginPos=None]])
Parameters:
  • pointsGKPoints

  • nbpoints – int

  • segmentsBeginPosQList

Return type:

GKPoints

Calculates a polyline that represents the center line of this section without considering the pedestrian crossings the section may have at the beginning or end of the section.The polyline is calculated in “points” and “points” is also returned.

If segmentsBeginPos is not nullptr in this vector (one entry by segment) the start position of each segment is returned (start position in the array of calculated points).

If nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

canUse(v)
Parameters:

vGKVehicleClass

Return type:

bool

Returns true if this vehicle class can use this section

canUseVehicle(v)
Parameters:

vGKMobileAgent

Return type:

bool

Returns true if this vehicle can use this section. First looks if this vehicle is banned for this roadType or section, then looks at the different lanes to see if they are reserved.

clearSpeedDetailed()

Clears all the detailed speed information, if any, defined for this section.

existLaneAtPos(laneNumber, pos)
Parameters:
  • laneNumber – int

  • pos – float

Return type:

bool

Returns true if lane “lane” exists at “pos”. A full lane will always return true (no check will be done for pos to enter inside the [0,length]. A side lane will return false if pos is not in the lane.

getAccelerationVariationFactor()
Return type:

float

getAdditionalVolume()
Return type:

float

Additional Volume.

getAllowImprudentLaneChanging()
Return type:

bool

getAllowNonLaneBasedMovement()
Return type:

bool

getAppliedSpeedLimit()
Return type:

float

Returns the section Applied Speed Limit in km/h.

getAutoIntermediateHeight()
Return type:

bool

Returns true if the height of the intermediate points will be calculated automatically or not using the GKSectionEditor. True by default.

The user can change the heights individually no matter the value of the attribute but they will be overwrite when using the editor.

getCapacity()
Return type:

float

The section capacity for static assignments in PCUs/h.

getCapacityForVehicle(v, iModelConnection)
Parameters:
Return type:

float

Returns the section capacity for this vehicle type. When reserved lanes are defined in the section, if the vehicle is not allowed to use them, then the capacity of the not allowed lanes will not be taken into account. If the section has any lane reserved compulsory or reserved tram for the vehicle type v then the capacity will be the one defined by these reserved compulsory or tram lanes only.

getConsiderTwoLanesCarFollowingModel()
Return type:

bool

getCostFunction([iModelConnection=None])
Parameters:

iModelConnectionGKModelConnection

Return type:

GKFunctionCost

Gets the cost function of the section

getDestTurnings()
Return type:

.list of GKTurning

Returns all turns exiting this section.

getDestTurnings(laneIndex)
Parameters:

laneIndex – int

Return type:

.list of GKTurning

Returns all turns exiting this section and arriving to lane “laneIndex”, where laneIndex goes from 0 to number of lanes - 1. Lane 0 is the leftmost lane in the section’s direction of flow.

getDestination()
Return type:

GKNode

Returns the destination node of this section (contains turns that start at this section). It can be nullptr.

getDestination(experiment)
Parameters:

experimentGKGenericExperiment

Return type:

GKNode

Returns the destination node of this section (contains turns that start at this section) if it exists in the given experiment. It can be nullptr. @remark If the experiment is null it will return the same as getDestination() .

getDestination(scenario)
Parameters:

scenarioGKGenericScenario

Return type:

GKNode

Returns the destination node of this section (contains turns that start at this section) if it exists in the given scenario. It can be nullptr. @remark If the scenario is null it will return the same as getDestination() .

getDetailLevel()
Return type:

DetailLevel

Get the detail level for this object.

getDrawMode()
Return type:

DrawMode

Draw mode of this king of sections. Equivalent to: this-> getRoadType() ->getDrawMode();

getDynamicFunction()
Return type:

GKFunctionCost

Get the Dynamic Cost Function for the turn.

getEntranceAngle()
Return type:

float

Returns the angle in radians that the section’s first segment makes with the horizontal. The value will be between (-PI, PI).

getEntranceHeight()
Return type:

float

Gets the z coordinate of the section’s entrance line.

getEntranceLineAngle()
Return type:

float

Returns the angle in radians that the entrance line makes with the perpendicular in the section’s first segment. The value will be between (-PI/2.0, PI/2.0)

getEntranceSections()
Return type:

.list of GKSection

Returns a vector with the entrance sections, that is the origin sections of all turns arriving to this section.

getEntryLanes()
Return type:

.std.pairint,int

Returns the range of lanes (from 0 to N-1, where N is the number of lanes) that can be used to enter this section. It takes into account the laterals to discard it if needed.

getExitAngle()
Return type:

float

Returns the angle in radians that the section’s last segment makes with the horizontal. The value will be between (-PI, PI).

getExitHeight()
Return type:

float

Gets the z coordinate of the section’s exit line.

getExitLanes()
Return type:

.std.pairint,int

Returns the range of lanes (from 0 to N-1, where N is the number of lanes) that can be used to exit this section. It takes into account the laterals to discard it if needed.

getExitLineAngle()
Return type:

float

Returns the angle in radians that the exit line makes with the perpendicular in the section’s last segment . The value will be between (-PI/2.0, PI/2.0)

getExitSections()
Return type:

.list of GKSection

Returns a vector with the exit sections, that is the destination sections of all turns exiting from this section.

getExtremePointAtPos(pos, atRight)
Parameters:
  • pos – float

  • atRight – bool

Return type:

GKPoint

It returns the parallel point to the one located in the center line at pos from the beginning and at the right contour line of the section when atRight is true and at the left side otherwise. It takes into acount side lanes if any

getExtremePoints()
Return type:

GKPoints

Extreme points for this section: returns an array of four points. 0 is the entrance point at right, 1 is the entrance point at left, 2 is the exit point at left and 3 is the exit point at right. Left and right using the section direction.

getExtremePointsLane(lanepos)
Parameters:

lanepos – int

Return type:

GKPoints

Returns an array of four points: 0 is the left bottom, 1 is the left top, 2 is the right top and 3 is the right bottom. Left and right using the section direction.

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

  • toLane – int

Return type:

GKPoints

Extreme points for this section between fromLane and toLane: returns an array of four points. 0 is the left bottom, 1 is the left top, 2 is the right top and 3 is the right bottom. Left and right using the section direction.

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

  • toLane – int

Return type:

GKPoints

Gets a vector of points with the extreme points of the section from the desired lane to the desired lane including the pedestrian crossing at the beginning of the section if any

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

  • toLane – int

Return type:

GKPoints

Gets a vector of points with the extreme points of the section from the desired lane to the desired lane including the pedestrian crossing at the end of the section if any

getExtremePointsWithoutLaterals()
Return type:

GKPoints

Extreme points for this section considering all side lanes as full lanes: returns an array of four points. 0 is the entrance point at right, 1 is the entrance point at left, 2 is the exit point at left and 3 is the exit point at right. Left and right using the section direction.

getFlowDirection()
Return type:

GKSectionLaneFlowDirection

Gets the flow direction of this section based on the flow direction of its lanes.

getHCMMergeDivergeStartingPoint()
Return type:

bool

getHCMWeaving()
Return type:

bool

getHeightAtDistance(dist)
Parameters:

dist – float

Return type:

float

Returns the z coordinate of the section at distance dist from the beginning.

getHeightAtPoint2D(p, bezierCurve)
Parameters:
Return type:

float

Returns the z coordinate of the section at point p where only the x and y are valid coordinates. Point p must be located in the middle line of lane nbLane, otherwise the result is unknown.

getHeightAtPoint2D(p, nbLane)
Parameters:
Return type:

float

Returns the z coordinate of the section at point p where only the x and y are valid coordinates. Point p must be located in the middle line of lane nbLane, otherwise the result is unknown.

getHullWithoutLaterals()
Return type:

GKPoints

Returns the points that define the contour of this section without taking into account whether the leftmost and rightmost lanes are full or not. The first point will be the left point at the entrance of the section, followed by all the points in the left side, and then the points at right starting from the one located at the section exit and ending in the one at the right in the section entrance

getHullWithoutLateralsWithoutPedestrianCrossings([keepSegmentPoints=false])
Parameters:

keepSegmentPoints – bool

Return type:

GKPoints

Returns the points that define the contour of this section without taking into account whether the leftmost and rightmost lanes are full or not, but removing the points corresponding to the initial and end pedestrian crossings if any. The first point will be the left point at the entrance of the section, followed by all the points in the left side, and then the points at right starting from the one located at the section exit and ending in the one at the right in the section entrance

getIndex(line)
Parameters:

lineGKPublicLine

Return type:

int

getInherentSpeed()
Return type:

float

Returns the inherent speed of the section.

getJamDensityPerLane()
Return type:

float

getKInitialsFunction()
Return type:

GKFunctionCost

Get the K-Initials Cost Function for the turn.

getLane(lanepos)
Parameters:

lanepos – int

Return type:

GKSectionLane

Get lane (by pos). It goes from 0 to N-1 (where N is the number of lanes) 0 is the left most lane, N-1 the right most lane. Left and right using the section direction.

getLaneChangingAggressiveness()
Return type:

float

getLaneChangingChangeLaneCooperation()
Return type:

float

getLaneChangingGapCooperation()
Return type:

float

getLaneExtraLengthAtEntrance()
Return type:

.list of double

Section’s initial and end point are related to the section’s center line. When the section’s entrance line is not perpendicularto the section’s first segment line, each lane can have an additional or a lower length at the beginning. * This length is the one returned in this vector, for each one of the section’s lanes.

getLaneExtraLengthAtExit()
Return type:

.list of double

Section’s initial and end point are related to the section’s center line. When the section’s exit line is not perpendicularto the section’s last segment line, each lane can have an additional or a lower length at the end. * This length is the one returned in this vector, for each one of the section’s lanes.

getLaneLength2D(lanepos)
Parameters:

lanepos – int

Return type:

float

Gets the 2D lane length (by position). The position input can range from 0 to N-1, where N is the number of lanes, 0 the left-most lane position and N-1 the right-most lane according to the section direction. If the position input is greater than or equal to N the function will return 0.

getLaneLength2DWithoutPedestrianCrossings(lanepos[, full=false])
Parameters:
  • lanepos – int

  • full – bool

Return type:

float

Gets the 2D lane length (by position) without considering the pedestrian crossing that might be defined at the beginning or end of the section. The position input can range from 0 to N-1, where N is the number of lanes, 0 the left-most lane position and N-1 the right-most lane according to the section direction. If the position input is greater than or equal to N the function will return 0.

If full is true then the length will be calculated as if the lane was a full one, ignoring any side lane offset values.

getLaneLength3D(lanepos)
Parameters:

lanepos – int

Return type:

float

Gets the 3D lane length (by position). The position input can range from 0 to N-1, where N is the number of lanes, 0 the left-most lane position and N-1 the right-most lane according to the section direction. If the position input is greater than or equal to N the function will return 0.

getLaneLength3DWithoutPedestrianCrossings(lanepos[, full=false])
Parameters:
  • lanepos – int

  • full – bool

Return type:

float

Gets the 3D lane length (by position) without considering the pedestrian crossing that might be defined at the beginning or end of the section. The position input can range from 0 to N-1, where N is the number of lanes, 0 the left-most lane position and N-1 the right-most lane according to the section direction. If the position input is greater than or equal to N the function will return 0.

If full is true then the length will be calculated as if the lane was a full one, ignoring any side lane offset values.

getLanePositions(reservedlanes[, uselaterals=true])
Parameters:
  • reservedlanes – bool

  • uselaterals – bool

Return type:

.list of uint

Returns a vector with the positions of free or reserved lanes depending on the reservedlanes parameter. If reservedlanes is true then returns reserved positions otherwise returns free positions. The returned vector is ordered by positions. If uselaterals is true then takes into account laterals lanes otherwise it does not.

getLanePositionsAtEnd(reservedlanes[, uselaterals=true])
Parameters:
  • reservedlanes – bool

  • uselaterals – bool

Return type:

.list of uint

Returns a vector with the positions of free or reserved lanes depending on the reservedlanes parameter. If reservedlanes is true then returns reserved positions otherwise returns free positions. The returned vector is ordered by positions (from n to 0). If uselaterals is true then takes into account laterals lanes otherwise it does not. It takes into account only the last segment.

getLanePositionsAtOrigin(reservedlanes[, uselaterals=true])
Parameters:
  • reservedlanes – bool

  • uselaterals – bool

Return type:

.list of uint

Returns a vector with the positions of free or reserved lanes depending on the reservedlanes parameter. If reservedlanes is true then returns reserved positions otherwise returns free positions. The returned vector is ordered by positions (from n to 0). If uselaterals is true then takes into account laterals lanes otherwise it does not. It takes into account only the first segment.

getLaneWidth()
Return type:

float

Default lane width of this section. Note that this information is per section and not per lane.

getLaneWidth(lanepos)
Parameters:

lanepos – int

Return type:

float

Get the specified lane’s width. The variable lanepos goes from 0 to N-1 (where N is the number of lanes): 0 is the left most lane, N-1 the right most lane. Left and right are based on the section’s direction.

getLanes()
Return type:

.list of GKSectionLane

Gets all the lanes sorted by position. It goes from 0 to N-1 (where N is the number of lanes) 0 is the left most lane, N-1 the right most lane. Left and right using the section direction. Use this function only to get information about the lanes, not to modify them. Use the “ GKSectionLane & getLane ( uint lanepos );” function if you want to modify any attribute of the lane.

getLanesAtPos(pos)
Parameters:

pos – float

Return type:

.std.pairint,int

Returns the range of lanes (from 0 to N-1, where N is the number of lanes) that exists at position pos (relative to the start of the section, pos = 0.0 means the start point, pos = length2D() means the end point of the section).

Is pos > length2D() then the function will use length2D() as position.

getLanesAtSegment(segment)
Parameters:

segment – int

Return type:

.std.pairint,int

Returns the range of lanes (from 0 to N-1, where N is the number of lanes) that exists at segment ‘segment’ (from 0 to M-1, where M is the number of segments).

getLanesInformationDestination(totalWeight, weightByLane)
Parameters:
  • totalWeightdouble

  • weightByLane – .list of double

getLanesInformationOrigin(totalWeight, weightByLane, nbTurningsByLane, scenario)
Parameters:
  • totalWeightdouble

  • weightByLane – .list of double

  • nbTurningsByLane – .list of int

  • scenarioGKGenericScenario

getLanesLength2D()
Return type:

float

Returns the sum of the section lanes’ 2D length. The output may differ from multiplying the section 2D length by the number of lanes because not all lanes must necessarily have the same 2D length (e.g. lateral lanes or curved section).

getLanesLength3D()
Return type:

float

Returns the sum of the section lanes’ 3D length. The output may differ from multiplying the section 3D length by the number of lanes because not all lanes must necessarily have the same 3D length (e.g. lateral lanes or curved section).

getLastSegmentNbLanes()
Return type:

int

Returns the number of lanes that are present in the last segment of the section. that is, all the main lanes and the laterals that starts or ends in the last segment.

getLeftExtraWidth()
Return type:

float

getMesoLookAheadDistance()
Return type:

float

getMesoOnRampCooperationGap()
Return type:

float

getMesoOnRampMergingGap()
Return type:

float

getMesoReactionTimeFactor()
Return type:

float

getNbFullLanes()
Return type:

int

Returns the range of lanes (from 0 to N-1, where N is the number of lanes) that extends all along the section, that is, they are not side lanes

getNbLanesAtPos(pos)
Parameters:

pos – float

Return type:

int

Returns the number of lanes that exists at position pos (relative to the start of the section, pos = 0.0 means the start point, pos = length2D() means the end point of the section.

Is pos > length2D() then the function will use length2D() as position.

getNbTurningsUsingLane(iLane, iSide)
Parameters:
Return type:

int

Return the number of turns using this lane

getNonAllowedVehicles()
Return type:

.list of const GKMobileAgent

List of vehicles and pedestrian types that are not allowed in this section.

getNumEntranceSections()
Return type:

int

Returns the number of entrance sections, that is the number of sections where a turn arriving to this section starts from.

getNumExitSections()
Return type:

int

Returns the number of exit sections, that is the number of sections where a turn exiting from this section goes to.

getOrigTurnings()
Return type:

.list of GKTurning

Returns all turns entering this section.

getOrigTurnings(laneIndex)
Parameters:

laneIndex – int

Return type:

.list of GKTurning

Returns all turns entering this section and arriving to lane “laneIndex”, where laneIndex goes from 0 to number of lanes - 1. Lane 0 is the leftmost lane in the section’s direction of flow.

getOrigin()
Return type:

GKNode

Returns the origin node of this section (node from where turns will enter). It can be nullptr.

getOrigin(experiment)
Parameters:

experimentGKGenericExperiment

Return type:

GKNode

Returns the origin node of this section (node from where turns will enter) if it exists in the given experiment. It can be nullptr. @remark If the experiment is null it will return the same as getOrigin() .

getOrigin(scenario)
Parameters:

scenarioGKGenericScenario

Return type:

GKNode

Returns the origin node of this section (node from where turns will enter) if it exists in the given scenario. It can be nullptr. @remark If the scenario is null it will return the same as getOrigin() .

getPedestrianCrossingAtBeginning()
Return type:

GKPedestrianCrossing

Crossing at the beginning of the section? Note that they are section objects and are also available as a list of top objects ( getTopObjects ).

getPedestrianCrossingAtEnd()
Return type:

GKPedestrianCrossing

Crossing at the end of the section? Note that they are section objects and are also available as a list of top objects ( getTopObjects ).

getPenalizeSharedLanes()
Return type:

bool

getPenalizeSlowLane()
Return type:

bool

getPositionInLane(posInCenterLine, lane)
Parameters:
  • posInCenterLine – float

  • lane – int

Return type:

float

Given a position in the center line of the section and a section lane, it returns the correponding position in the lane’s polyline.

getPublicLinesUse()
Return type:

.list of QUuid

getReactionTimeAtStop()
Return type:

float

getReactionTimeAtTrafficLight()
Return type:

float

getReservedLanesVisibilityDistance()
Return type:

float

getReturnToInsideLaneAfterOvertaking()
Return type:

bool

getRightExtraWidth()
Return type:

float

getRoadType()
Return type:

GKRoadType

Gets the road type of the section

getSectionEntranceOrientation()
Return type:

GKSectionOrientation

Returns the section orientation taking into account the first segment and the north direction defined in Preferences. Each orientation will have a possible deviation of 45 degrees into each side, that is, all sections will be classified into the closer category.

getSectionExitOrientation()
Return type:

GKSectionOrientation

Returns the section orientation taking into account the last segment and the north direction defined in Preferences. Each orientation will have a possible deviation of 45 degrees into each side, that is, all sections will be classified into the closer category.

getSpeed()
Return type:

float

Returns the section speed in km/h.

getSpeedDetailed(segment, lane)
Parameters:
  • segment – int

  • lane – int

Return type:

float

Gets the value of a detailed speed.

getStopLine()
Return type:

float

Stop Line distance from the beginning of the section (in meters) common for all lanes. Every lane can have an additional value to override it. UnknownCommand getStopLine()

The distance is either 0 that means either at the beginning of the section of just after the crosswalk (if any). If greater than 0 is up to the user to place it after the crosswalk.

getSubArea(from, to, fromLane, toLane[, recalculatePositions=false[, includeChangesInNumberOfLanes=false]])
Parameters:
  • from – float

  • to – float

  • fromLane – int

  • toLane – int

  • recalculatePositions – bool

  • includeChangesInNumberOfLanes – bool

Return type:

.std.pairGKPoints,uint

Gets a polygon enclosed in the section and delimited by the from, to (related to the section length) and fromLane, toLane (0 to NBLanes-1).

If from or to or from+to are bigger than the current section length then from and/or to will be recalculate to fit in the section IF recalculatePositions is true, otherwise the polygon returned will have 0 points (outside of the section) or will be a polygon than ends before from+to.

The order in the points returned is the following: the first point in the array of points is the left point closer to the beginning of the section, followed by all the other points located at the left in the polyline, then the right point that is closer to the end of the section and finally all the other points located at the right ending by the right point closer the beginning of the section.

The uint value also returned is the number of points in the left part (that is, first part) of the returned polygon

If includeChangesInNumberOfLanes is False, then the subarea will take into account the lanes at the from position and calculate a polygon from it. If True and the number of lanes changes between from and to then the polygon returned will follow the shape of the side lane

getSubAreaForLane(lanePos, fromInLane, toInLane)
Parameters:
  • lanePos – int

  • fromInLane – float

  • toInLane – float

Return type:

.std.pairGKPoints,uint

Gets a polygon enclosed in the section lane corresponding to lanePos (0 to NBLanes-1) and delimited by the fromInLane, toInLane (related to the lane length)

The uint value also returned is the number of points in the left part (that is, first part) of the returned polygon

getSubAreaRotatedAtEntrance(from, to, fromLane, toLane)
Parameters:
  • from – float

  • to – float

  • fromLane – int

  • toLane – int

Return type:

.std.pairGKPoints,uint

Gets a polygon enclosed in the section and parallel to the entranceLineAngle and that starts in from, ends in to (related to the section length), and fromLane, toLane (0 to NBLanes-1).

The uint value also returned is the number of points in the left part (that is, first part) of the returned polygon

getSubAreaRotatedAtExit(areaLength, fromLane, toLane)
Parameters:
  • areaLength – float

  • fromLane – int

  • toLane – int

Return type:

.std.pairGKPoints,uint

Gets a polygon enclosed in the section and delimited by the exitLineAngle and that starts ‘areaLength’ from the exitLine.

The uint value also returned is the number of points in the left part (that is, first part) of the returned polygon

getSubAreaRotatedAtExit(from, to, fromLane, toLane)
Parameters:
  • from – float

  • to – float

  • fromLane – int

  • toLane – int

Return type:

.std.pairGKPoints,uint

Gets a polygon enclosed in the section and parallel to the exitLineAngle and that starts in from, ends in to (related to the section length), and fromLane, toLane (0 to NBLanes-1).

The uint value also returned is the number of points in the left part (that is, first part) of the returned polygon

getSubAreaRotatedAtExitWithoutPedestrianCrossing(areaLength, fromLane, toLane)
Parameters:
  • areaLength – float

  • fromLane – int

  • toLane – int

Return type:

.std.pairGKPoints,uint

Gets a polygon enclosed in the section and delimited by the exitLineAngle and that starts ‘areaLength’ from the exitLine.

The uint value also returned is the number of points in the left part (that is, first part) of the returned polygon

getSubAreaRotatedAtExitWithoutPedestrianCrossing(from, to, fromLane, toLane)
Parameters:
  • from – float

  • to – float

  • fromLane – int

  • toLane – int

Return type:

.std.pairGKPoints,uint

Gets a polygon enclosed in the section and delimited by the exitLineAngle and that starts at from m from the exitLine to ‘to’ m from the exit line.

The uint value also returned is the number of points in the left part (that is, first part) of the returned polygon

getTotalNbLanes()
Return type:

int

Returns the number of lanes

getTwoWayMirrorSection()
Return type:

GKSection

Get the Mirror section for Two-Way

getTwoWaySpeedDifferenceToOvertakeSolidLine()
Return type:

float

Get Speed Difference to Overtake Solid line when in Two-Way

getTwoWayVisibilityDistance()
Return type:

float

Get visibility distance in Two-Way

getTwoWayVisibilityFactor()
Return type:

float

Get visibility factor in Two-Way

getUnconnectedEntryLanes()
Return type:

.std.pairlist of uint,uint

Returns a list of all the unconnected entry lanes (if any). Note that a section that is not connected to a node will return all its lane but, in this case, is better first to check for this possibility using the GKPolyline::getOrigin method.

The second item in the pair retuns the number of possible lanes.

getUnconnectedExitLanes()
Return type:

.std.pairlist of uint,uint

Returns a list of all the unconnected exit lanes (if any). Note that a section that is not connected to a node will return all its lanes but, in this case, it is better first to check for this possibility using the GKPolyline::getDestination method.

The second item in the pair returns the number of possible lanes.

getUseOnRampFIFO()
Return type:

bool

getUserDefinedCost()
Return type:

float

User-defined cost.

getUserDefinedCost2()
Return type:

float

User-defined cost (second one).

getUserDefinedCost3()
Return type:

float

User-defined cost (third one).

getWaitingArea(width, side[, checkCloseSections=false])
Parameters:
  • width – float

  • side – int

  • checkCloseSections – bool

Return type:

GKPoints

Returns the waiting area with the specified width and side: if side is 0 the returned area will be at right, if side is 1 the returned area will be at left.

if checkCloseCrossings is true, then “jaywalk” sections at the same node will be considered to calculate the waiting area.

getWidth()
Return type:

float

Returns the section width (computed as the sum of all lanes’ width).

getYRotationAtDistance(dist, degrees)
Parameters:
  • dist – float

  • degrees – bool

Return type:

float

Returns the angle that the section makes with the vertical at distance dist from the beginning. This angle can be expressed in degrees (setting the parameter degrees to true) or in radians (setting degrees to false).

getZRotationAtDistance(dist, degrees)
Parameters:
  • dist – float

  • degrees – bool

Return type:

float

Returns the angle that the section makes with the horizontal at distance dist from the beginning. This angle can be expressed in degrees (setting the parameter degrees to true) or in radians (setting degrees to false).

getonRampCooperationDistance()
Return type:

float

V6 models.

getonRampMergingDistance()
Return type:

float

hasEntryLateralLane()
Return type:

bool

Returns whether the section has an entry lateral lane or not.

hasExitLateralLane()
Return type:

bool

Returns whether the section has an exit lateral lane or not.

increaseTickOnlySection()
invisibleDrawMode()
Return type:

bool

Returns true if the section is not visible during simulation due to its draw mode ( getDrawMode ).

isBannedVehicle(vehicle)
Parameters:

vehicleGKMobileAgent

Return type:

bool

Returns true if the vehicle is banned but without considering the road type. Use it to check the contents of banned vehicles per object. * Probably you want to use isBannedVehicleConsideringRoadType

isBannedVehicleConsideringRoadType(vehicle)
Parameters:

vehicleGKMobileAgent

Return type:

bool

Returns true if the vehicle is banned (considering if needed its Road Type)

isConnected(nextSection[, scenario=None])
Parameters:
Return type:

bool

Returns true is the section is connected to the section “nextSection”.

static isIn(lateralType)
Parameters:

lateralTypeLateralType

Return type:

bool

Returns true if the lateralType is eRightIn or eLeftIn.

static isRight(lateralType)
Parameters:

lateralTypeLateralType

Return type:

bool

Returns true if the lateralType is eRightIn or eRightOut.

length2DWithoutPedestrianCrossings()
Return type:

float

Length of this section without considering the pedestrian crossings.

length2DWithoutPedestrianCrossings(scenario)
Parameters:

scenarioGKGenericScenario

Return type:

float

Length of this section without considering the pedestrian crossings.

length3DWithoutPedestrianCrossings()
Return type:

float

Length considering also the height (z coordinate) of this section without considering the pedestrian crossings.

meetHCMMergeDivergeStartingPoint()
Return type:

bool

recalculateAltitudes()

Recalculate all the altitude coordinates of the section.

removeLane(lanepos)
Parameters:

lanepos – int

Remove a lane by pos (see getLane() )

removeLastLane()

Remove the last lane (rightmost)

setAccelerationVariationFactor(value)
Parameters:

value – float

setAdditionalVolume(value)
Parameters:

value – float

Additional Volume.

setAllowImprudentLaneChanging(allow)
Parameters:

allow – bool

setAllowNonLaneBasedMovement(allow)
Parameters:

allow – bool

setAppliedSpeedLimit(value)
Parameters:

value – float

Sets the section Applied Speed Limit in km/h.

setAutoIntermediateHeight(value)
Parameters:

value – bool

setBannedVehicle(vehicle, banned)
Parameters:

If banned true, sets vehicle to banned. * If banned false, sets vehicle to not banned.

setCapacity(value)
Parameters:

value – float

Sets the section capacity for static assignments in PCUs.. This capacity is for the whole section and not per lane. This capacity is automatically updated when the user changes the number of lanes of a section. In this case side lanes are not considered.

If the user wants to set the section capacity using a lane capacity he/she will:

uint                                                            fullLanes = 0;
GKSectionLanes::const_iterator          iter;

for( iter = section->getLanes().begin(); iter != section->getLanes().end(); iter++ ){
        if( (*iter).isFullLane() ){
                fullLanes++;
        }
}
section->setCapacity( fullLanes * laneCapacity );
setConsiderTwoLanesCarFollowingModel(consider)
Parameters:

consider – bool

setCostFunction(fc)
Parameters:

fcGKFunctionCost

Set the Volume Delay Cost Function for the section. DP: Named as Cost Function, only here, a refactor is needed.

setDestination(adestination)
Parameters:

adestinationGKNode

Sets the destination node of the section

setDetailLevel(level)
Parameters:

levelDetailLevel

Set the detail level for this object.

setDynamicFunction(fc)
Parameters:

fcGKFunctionCost

Set the Dynamic Cost Function for the turn.

setEntranceLineAngle(angle)
Parameters:

angle – float

Sets the angle in radians that the entrance line makes with the perpendicular to the section’s first segment. Taking as x axis the section’s first segment and as y axis its perpendicular line, the angle is positive if the entrance line is located in the first and third quadrant and it is negative if the entrance line is located in the second and fourth quadrant. Correct values are (-PI/2.0, PI/2.0) . Default value is 0.0

setExitLineAngle(angle)
Parameters:

angle – float

Sets the angle in radians that the exit line makes with the perpendicular to the section’s last segment. Taking as x axis the section’s last segment and as y axis its perpendicular line, the angle is positive if the entrance line is located in the first and third quadrant and it is negative if the entrance line is located in the second and fourth quadrant. Correct values are (-PI/2.0, PI/2.0) . Default value is 0.0

setHCMMergeDivergeStartingPoint(value)
Parameters:

value – bool

setHCMWeaving(value)
Parameters:

value – bool

setInherentSpeed(newInherentSpeed)
Parameters:

newInherentSpeed – float

Sets the inherent speed of the section.

setJamDensityPerLane(density)
Parameters:

density – float

setKInitialsFunction(fc)
Parameters:

fcGKFunctionCost

Set the K-Initials Cost Function for the turn.

setLaneChangingAggressiveness(value)
Parameters:

value – float

setLaneChangingChangeLaneCooperation(value)
Parameters:

value – float

setLaneChangingGapCooperation(value)
Parameters:

value – float

setLaneWidth(width)
Parameters:

width – float

Set the default Lane width of this section. Note that this information is per section and not per lane.

setLaneWidth(lanepos, width)
Parameters:
  • lanepos – int

  • width – float

Set the specified lane’s width. lanepos goes from 0 to N-1 (where N is the number of lanes) 0 is the left most lane, N-1 the right most lane. Left and right are based on the section’s direction.

setLeftExtraWidth(width)
Parameters:

width – float

setMesoLookAheadDistance(distance)
Parameters:

distance – float

setMesoOnRampCooperationGap(value)
Parameters:

value – float

setMesoOnRampMergingGap(value)
Parameters:

value – float

setMesoReactionTimeFactor(factor)
Parameters:

factor – float

setNonAllowedVehicles(vehicles)
Parameters:

vehicles – .list of const GKMobileAgent

List of vehicles adn pedestrian types that are not allowed in this section.

setOnRampFIFO(enable)
Parameters:

enable – bool

setOrigin(aorigin)
Parameters:

aoriginGKNode

Sets the origin node of the section

setPenalizeSharedLanes(penalize)
Parameters:

penalize – bool

setPenalizeSlowLane(penalize)
Parameters:

penalize – bool

setReactionTimeAtStop(value)
Parameters:

value – float

setReactionTimeAtTrafficLight(value)
Parameters:

value – float

setReservedLanesVisibilityDistance(distance)
Parameters:

distance – float

setReturnToInsideLaneAfterOvertaking(value)
Parameters:

value – bool

setRightExtraWidth(width)
Parameters:

width – float

setRoadType(aroadType[, assignValues=false])
Parameters:

Set the road type of this section. If assignValues is true the values in the road type will be copied in the section.

setSpeed(value)
Parameters:

value – float

Sets the section speed in km/h.

setSpeedDetailed(segment, lane, speed)
Parameters:
  • segment – int

  • lane – int

  • speed – float

Sets information on detailed speed for a segment and/or lane. A -1 is returned when no speed as been set for the segment/lane combination.

setStopLine(v)
Parameters:

v – float

Stop Line distance from the beginning of the section (in meters) common for all lanes. Every lane can have an additional value to override it. UnknownCommand getStopLine()

The distance is either 0 that means either at the beginning of the section of just after the crosswalk (if any). If greater than 0 is up to the user to place it after the crosswalk.

setTwoWayMirrorSection(section)
Parameters:

sectionGKSection

Set the Mirror section for Two-Way

setTwoWaySpeedDifferenceToOvertakeSolidLine(speedDifference)
Parameters:

speedDifference – float

Set Speed difference to Overtake solid line when in Two-Way

setTwoWayVisibilityDistance(distance)
Parameters:

distance – float

Set visibility distance in Two-Way

setTwoWayVisibilityFactor(factor)
Parameters:

factor – float

Set visibility factor in Two-Way

setUse(line)
Parameters:

lineGKPublicLine

setUseRoadTypeNonAllowedVehicles(value)
Parameters:

value – bool

If true (the default) uses the list of non allowed vehicles from the road type. If false, from the section.

setUserDefinedCost(value)
Parameters:

value – float

User-defined cost.

setUserDefinedCost2(value)
Parameters:

value – float

User-defined cost (second one).

setUserDefinedCost3(value)
Parameters:

value – float

User-defined cost (third one).

setonRampCooperationDistance(value)
Parameters:

value – float

V6 models.

setonRampMergingDistance(value)
Parameters:

value – float

unselectAllSolidLines()

Unselect all the selected solid lines looking in all the lanes.

unsetUse(line)
Parameters:

lineGKPublicLine

updateAltitudeTurnings()

Update the altitude of the Adjoining Turnings by the section extreme points.

updateTurningSpeeds()

Updates turn speed for the origin and destination nodes, in case it’s defined as ‘automatic’. Automatically called whenever the “speed” attribute for the section is changed.

useRoadTypeNonAllowedVehicles()
Return type:

bool

If true (the default) uses the list of non allowed vehicles from the road type. If false, from the section.