diff --git a/tools/contributed/traas/src/main/java/de/tudresden/sumo/config/Constants.java b/tools/contributed/traas/src/main/java/de/tudresden/sumo/config/Constants.java index 3f37acbb0f2..f9f3e6fc646 100644 --- a/tools/contributed/traas/src/main/java/de/tudresden/sumo/config/Constants.java +++ b/tools/contributed/traas/src/main/java/de/tudresden/sumo/config/Constants.java @@ -13,7 +13,7 @@ /****************************************************************************/ /// @file Constants.java /// @author generated by "rebuildConstants.py" -/// @date 2023-11-05 15:36:27.935352 +/// @date 2024-04-09 11:14:09.616128 /// // This script contains TraCI constant definitions from /src/libsumo/TraCIConstants.h. /****************************************************************************/ @@ -700,6 +700,18 @@ public class Constants { // last step vehicle halting number (get: e2, e3, lanes, edges) public static final int LAST_STEP_VEHICLE_HALTING_NUMBER = 0x14; + // upstream junction (edges) + public static final int FROM_JUNCTION = 0x7b; + + // downstream junction (edges) + public static final int TO_JUNCTION = 0x7c; + + // incoming edges (junction) + public static final int INCOMING_EDGES = 0x7b; + + // outgoing edges (junction) + public static final int OUTGOING_EDGES = 0x7c; + // last step mean vehicle length (get: induction loops, lanes, edges) public static final int LAST_STEP_LENGTH = 0x15; diff --git a/tools/traci/_edge.py b/tools/traci/_edge.py index 05839f04f68..16d5de5497c 100644 --- a/tools/traci/_edge.py +++ b/tools/traci/_edge.py @@ -202,6 +202,20 @@ def getAngle(self, edgeID, relativePosition=tc.INVALID_DOUBLE_VALUE): """ return self._getUniversal(tc.VAR_ANGLE, edgeID, "d", relativePosition) + def getFromJunction(self, edgeID): + """getFromJunction(string) -> string + + Returns the id of the junction at the start of this edge + """ + return self._getUniversal(tc.FROM_JUNCTION, edgeID) + + def getToJunction(self, edgeID): + """getToJunction(string) -> string + + Returns the id of the junction at the end of this edge + """ + return self._getUniversal(tc.TO_JUNCTION, edgeID) + def adaptTraveltime(self, edgeID, time, begin=None, end=None): """adaptTraveltime(string, double, double, double) -> None diff --git a/tools/traci/_junction.py b/tools/traci/_junction.py index 7b105682216..a61e912d272 100644 --- a/tools/traci/_junction.py +++ b/tools/traci/_junction.py @@ -42,3 +42,17 @@ def getShape(self, junctionID): List of 2D positions (cartesian) describing the geometry. """ return self._getUniversal(tc.VAR_SHAPE, junctionID) + + def getIncomingEdges(self, junctionID): + """getIncomingEdges(string) -> list(string) + + Returns the ids of the edges that end at this junction + """ + return self._getUniversal(tc.INCOMING_EDGES, junctionID) + + def getOutgoingEdges(self, junctionID): + """getOutgoingEdges(string) -> list(string) + + Returns the ids of the edges that start at this junction + """ + return self._getUniversal(tc.OUTGOING_EDGES, junctionID) diff --git a/tools/traci/constants.py b/tools/traci/constants.py index 6d6c6e6a27c..47df7645b08 100644 --- a/tools/traci/constants.py +++ b/tools/traci/constants.py @@ -12,7 +12,7 @@ # @file constants.py # @author generated by "rebuildConstants.py" -# @date 2023-11-05 15:36:27.935352 +# @date 2024-04-09 11:14:09.616128 """ This script contains TraCI constant definitions from /src/libsumo/TraCIConstants.h. @@ -700,6 +700,18 @@ # last step vehicle halting number (get: e2, e3, lanes, edges) LAST_STEP_VEHICLE_HALTING_NUMBER = 0x14 +# upstream junction (edges) +FROM_JUNCTION = 0x7b + +# downstream junction (edges) +TO_JUNCTION = 0x7c + +# incoming edges (junction) +INCOMING_EDGES = 0x7b + +# outgoing edges (junction) +OUTGOING_EDGES = 0x7c + # last step mean vehicle length (get: induction loops, lanes, edges) LAST_STEP_LENGTH = 0x15