Skip to content

Commit

Permalink
improving docs for lanechangestate #2 fix #13981
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Jan 19, 2024
1 parent fca9ac2 commit 1ae7bce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/web/docs/TraCI/Vehicle_Value_Retrieval.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ Some further messages require additional parameters.
<td><p>change lane information (0x13)</p></td>
<td><p>compound , <a href="#change_lane_information_0x13" title="wikilink">see below</a></p></td>
<td><p>int, int <a href="#change_lane_information_0x13" title="wikilink">see below</a></p></td>
<td><p>Return whether the vehicle could change lanes in the specified direction (right: -1, left: 1. sublane-change within current lane: 0).<br />
<td><p>Return whether the vehicle could change lanes in the specified direction in the previous step (right: -1, left: 1. sublane-change within current lane: 0).<br />
Return the lane change state for the vehicle.</p></td>
<td><p><a href="https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-getLaneChangeState">getLaneChangeState</a> <a href="https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-couldChangeLane">couldChangeLane</a> <a href="https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-wantsAndCouldChangeLane">wantsAndCouldChangeLane</a></p></td>
</tr>
Expand Down
8 changes: 7 additions & 1 deletion tools/traci/_vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,10 @@ def prettifyBitstring(intval):

def couldChangeLane(self, vehID, direction, state=None):
"""couldChangeLane(string, int) -> bool
Return whether the vehicle could change lanes in the specified direction
Return whether the vehicle could change lanes in the specified direction.
This reflects the state after the last try to change lanes.
If you want to execute changeLane as a result of the evaluation of this function
it is not guaranteed to work because vehicle movements occur first.
"""
if state is None:
state, stateTraCI = self.getLaneChangeState(vehID, direction)
Expand All @@ -952,6 +955,9 @@ def couldChangeLane(self, vehID, direction, state=None):
def wantsAndCouldChangeLane(self, vehID, direction, state=None):
"""wantsAndCouldChangeLane(string, int) -> bool
Return whether the vehicle wants to and could change lanes in the specified direction
This reflects the state after the last try to change lanes.
If you want to execute changeLane as a result of the evaluation of this function
it is not guaranteed to work because vehicle movements occur first.
"""
if state is None:
state, stateTraCI = self.getLaneChangeState(vehID, direction)
Expand Down

0 comments on commit 1ae7bce

Please sign in to comment.