eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.55k stars 1.43k forks source link

"connection" xml elements versus internal lane foes #15394

Closed Sven-Schneider closed 2 months ago

Sven-Schneider commented 2 months ago

My topology.net.xml file contains some connection elements such as

<connection from="-E1" to="-E0" fromLane="0" toLane="0" via=":J1_0_0" dir="r" state="m"/>

Using the java bindings I seem to be unable to obtain such connections.

These connection elements seem to connect edge and junction elements in the xml file specifying 'priorities' among internal lanes of the junction by means of specifying directions dir and states state.

In the java bindings I can use getInternalFoes on such internal lanes.

Does this mean that the descriptively specified 'priorities' from the connection elements in the xml file are resolved upon parsing into explicit foe lists of internal lanes by calculating the traffic rules for that junction?

Sven-Schneider commented 2 months ago

Actually, I believe now that getInternalFoes may simply store lanes due to which collisions may occur when vehicles do not follow traffic rules.

getInternalFoes(self, laneID) getFoes(string) -> list(string) Returns the ids of internal lanes that are in conflict with the given internal lane id.

But then again, how can I obtain the traffic rules defined in the xml file using the java api?

namdre commented 2 months ago

Actually, I believe now that getInternalFoes may simply store lanes due to which collisions may occur when vehicles do not follow traffic rules.

correct

But then again, how can I obtain the traffic rules defined in the xml file using the java api?

You can use use lane.getFoes