PyANGKernel.GKSection¶
- class GKSection¶
-
Synopsis¶
Methods¶
def
__init__()def
addLane()def
canUse()def
canUseVehicle()def
existLaneAtPos()def
getCapacity()def
getDestination()def
getDetailLevel()def
getDrawMode()def
getEntryLanes()def
getExitAngle()def
getExitHeight()def
getExitLanes()def
getHCMWeaving()def
getIndex()def
getLane()def
getLaneWidth()def
getLanes()def
getLanesAtPos()def
getNbFullLanes()def
getOrigin()def
getRoadType()def
getSpeed()def
getStopLine()def
getSubArea()def
getWaitingArea()def
getWidth()def
isConnected()def
removeLane()def
removeLastLane()def
setCapacity()def
setDestination()def
setDetailLevel()def
setHCMWeaving()def
setLaneWidth()def
setOnRampFIFO()def
setOrigin()def
setRoadType()def
setSpeed()def
setStopLine()def
setUse()def
unsetUse()
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
GKSectionas 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:
lane –
GKSectionLanelanepos – int
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:
objChanged –
GKGeoObject- Return type:
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
segmentsBeginPos –
QList
- Return type:
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
segmentsBeginPos –
QListfull – bool
- Return type:
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]])¶
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:
v –
GKVehicleClass- Return type:
Returns true if this vehicle class can use this section
- canUseVehicle(v)¶
- Parameters:
v –
GKMobileAgent- Return type:
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.
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.
Additional Volume.
Returns the section Applied Speed Limit in km/h.
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.
The section capacity for static assignments in PCUs/h.
- getCapacityForVehicle(v, iModelConnection)¶
- Parameters:
v –
GKVehicleiModelConnection –
GKModelConnection
- Return type:
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.
- getCostFunction([iModelConnection=None])¶
- Parameters:
iModelConnection –
GKModelConnection- Return type:
Gets the cost function of the section
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.
Returns the destination node of this section (contains turns that start at this section). It can be nullptr.
- getDestination(experiment)
- Parameters:
experiment –
GKGenericExperiment- Return type:
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:
scenario –
GKGenericScenario- Return type:
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:
Get the detail level for this object.
Draw mode of this king of sections. Equivalent to: this->
getRoadType()->getDrawMode();- getDynamicFunction()¶
- Return type:
Get the Dynamic Cost Function for the turn.
Returns the angle in radians that the section’s first segment makes with the horizontal. The value will be between (-PI, PI).
Gets the z coordinate of the section’s entrance line.
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)
Returns a vector with the entrance sections, that is the origin sections of all turns arriving to this section.
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.
Returns the angle in radians that the section’s last segment makes with the horizontal. The value will be between (-PI, PI).
Gets the z coordinate of the section’s exit line.
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.
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)
Returns a vector with the exit sections, that is the destination sections of all turns exiting from this section.
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
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.
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:
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:
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:
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
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:
Gets the flow direction of this section based on the flow direction of its lanes.
Returns the z coordinate of the section at distance dist from the beginning.
- getHeightAtPoint2D(p, bezierCurve)¶
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.
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.
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:
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:
line –
GKPublicLine- Return type:
Returns the inherent speed of the section.
- getKInitialsFunction()¶
- Return type:
Get the K-Initials Cost Function for the turn.
- getLane(lanepos)¶
- Parameters:
lanepos – int
- Return type:
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.
- 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.
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:
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.
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:
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.
Default lane width of this section. Note that this information is per section and not per lane.
- getLaneWidth(lanepos)
- Parameters:
lanepos – int
- Return type:
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.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 uselength2D()as position.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:
totalWeight –
doubleweightByLane – .list of double
- getLanesInformationOrigin(totalWeight, weightByLane, nbTurningsByLane, scenario)¶
- Parameters:
totalWeight –
doubleweightByLane – .list of double
nbTurningsByLane – .list of int
scenario –
GKGenericScenario
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).
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).
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.
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
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 uselength2D()as position.- getNbTurningsUsingLane(iLane, iSide)¶
- Parameters:
iLane – int
iSide –
sectionSide
- Return type:
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.
Returns the number of entrance sections, that is the number of sections where a turn arriving to this section starts from.
Returns the number of exit sections, that is the number of sections where a turn exiting from this section goes to.
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.
Returns the origin node of this section (node from where turns will enter). It can be nullptr.
- getOrigin(experiment)
- Parameters:
experiment –
GKGenericExperiment- Return type:
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:
scenario –
GKGenericScenario- Return type:
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:
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:
Crossing at the end of the section? Note that they are section objects and are also available as a list of top objects (
getTopObjects).- Return type:
- getPositionInLane(posInCenterLine, lane)¶
- Parameters:
posInCenterLine – float
lane – int
- Return type:
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
- getRoadType()¶
- Return type:
Gets the road type of the section
- getSectionEntranceOrientation()¶
- Return type:
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:
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.
Returns the section speed in km/h.
Gets the value of a detailed speed.
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
Returns the number of lanes
Get the Mirror section for Two-Way
Get Speed Difference to Overtake Solid line when in Two-Way
Get visibility distance in Two-Way
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.
User-defined cost.
User-defined cost (second one).
User-defined cost (third one).
- getWaitingArea(width, side[, checkCloseSections=false])¶
- Parameters:
width – float
side – int
checkCloseSections – bool
- Return type:
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.
Returns the section width (computed as the sum of all lanes’ width).
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).
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).
V6 models.
Returns whether the section has an entry lateral lane or not.
Returns whether the section has an exit lateral lane or not.
- increaseTickOnlySection()¶
Returns true if the section is not visible during simulation due to its draw mode (
getDrawMode).- isBannedVehicle(vehicle)¶
- Parameters:
vehicle –
GKMobileAgent- Return type:
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:
vehicle –
GKMobileAgent- Return type:
Returns true if the vehicle is banned (considering if needed its Road Type)
- isConnected(nextSection[, scenario=None])¶
- Parameters:
nextSection –
GKSectionscenario –
GKGenericScenario
- Return type:
Returns true is the section is connected to the section “nextSection”.
- static isIn(lateralType)¶
- Parameters:
lateralType –
LateralType- Return type:
Returns true if the lateralType is eRightIn or eLeftIn.
- static isRight(lateralType)¶
- Parameters:
lateralType –
LateralType- Return type:
Returns true if the lateralType is eRightIn or eRightOut.
Length of this section without considering the pedestrian crossings.
- length2DWithoutPedestrianCrossings(scenario)
- Parameters:
scenario –
GKGenericScenario- Return type:
Length of this section without considering the pedestrian crossings.
Length considering also the height (z coordinate) of this section without considering the pedestrian crossings.
- 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
See also
- setBannedVehicle(vehicle, banned)¶
- Parameters:
vehicle –
GKMobileAgentbanned – bool
If banned true, sets vehicle to banned. * If banned false, sets vehicle to not banned.
See also
- 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:
fc –
GKFunctionCost
Set the Volume Delay Cost Function for the section. DP: Named as Cost Function, only here, a refactor is needed.
Sets the destination node of the section
- setDetailLevel(level)¶
- Parameters:
level –
DetailLevel
Set the detail level for this object.
- setDynamicFunction(fc)¶
- Parameters:
fc –
GKFunctionCost
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:
fc –
GKFunctionCost
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
Sets the origin node of the section
- 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:
aroadType –
GKRoadTypeassignValues – bool
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.
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:
line –
GKPublicLine
- 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.
See also
- 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:
line –
GKPublicLine
- 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.
If true (the default) uses the list of non allowed vehicles from the road type. If false, from the section.
See also