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.49k stars 1.41k forks source link

NEMA traffic light stays red #14287

Open Nifemi954 opened 7 months ago

Nifemi954 commented 7 months ago

I have an issue with a simulation I am running, where the last vehicle does not complete the route but stops at a particular TLS. The simulation just keeps running afterwards.

Attached below is the config file;

<?xml version='1.0' encoding='UTF-8'?>
<configuration><input><net-file value="osm2.net.xml" /><route-files value="rsampler_trips900.xml" /><no-step-log value="True" /><time-to-teleport value="0" /></input></configuration>
m-kro commented 7 months ago

The config file does not contain any interesting setting regarding your problem. Does the vehicle enter the intersection or does it stop in front of the stop line? Sometimes a vehicle gets blocked when it does not have enough time to clear the intersection while other vehicles already enter it. If this does not match your case, we might need the complete scenario files to watch the problem ourselves.

Nifemi954 commented 7 months ago

Thanks for the reply. The last vehicle stops at the stop line before the TLS on red and the light doesn't change to green again.

Attached to this is the zip file containing a video showing the situation alongside the net, route and config file.

sumo.zip

m-kro commented 7 months ago

The problematic traffic light is cluster_181776620_8123131286_8893732102_8893737926_#3more (NEMA type). The last phase is not shown (traffic light doesn't switch states at all) although there is only one vehicle waiting for several minutes.

@qichaow @mschrader15 You know this code base best. Do you know the reason?

mschrader15 commented 7 months ago

Had a look. The problem actually occurs more frequently than just the end of simulation.

Basically, because the NEMA controller only has phase 2, 6, 4 and 8, the detectors for the permissive left turn (phase 3, where the car waits) are not also being mapped to the corresponding main phase (phase 8).

The NEMALogic code only looks for detectors that correspond to lanes with "G" in the light string.

I'm not sure what the actual standard in this situation is, so as to encode in network autogeneration.

I will make a PR supporting defining multiple detectors per-phase, but might take some time

Nifemi954 commented 7 months ago

Thanks for the reply, what would be the ideal way to write the Logic?

mschrader15 commented 7 months ago

Below is how I would do it for the time-being. It serves 4 (controlling straight and left turn) and then 8.

Another option is to a put a minRecall on phases 4 and 8, so that they get served regardless of detection or not.

    <tlLogic id="cluster_181776620_8123131286_8893732102_8893737926_#3more" type="NEMA" programID="New" offset="0">
        <phase duration="90" state="srrGGgsrrsrr" minDur="10" maxDur="35" vehext="2.50" yellow="3" red="2" name="2"/>
        <phase duration="90" state="srrsrrsrrGGg" minDur="10" maxDur="35" vehext="2.50" yellow="3" red="2" name="6"/>
        <phase duration="90" state="GGGsrrsrrsrr" minDur="5" maxDur="15" vehext="2.50" yellow="3" red="2" name="4"/>
        <phase duration="90" state="srrsrrGGGsrr" minDur="5" maxDur="15" vehext="2.50" yellow="3" red="2" name="8"/>

        <param key="barrier2Phases" value="2,6"/>
        <param key="barrierPhases" value="8,8"/>
        <param key="detector-length" value="20"/>
        <param key="detector-length-leftTurnLane" value="10"/>
        <param key="minRecall" value="2,6, "/>
        <param key="ring1" value="0,2,4,8"/>
        <param key="ring2" value="0,6,4,8"/>
        <param key="show-detectors" value="true"/>
        <param key="total-cycle-length" value="80"/>

    </tlLogic>
Nifemi954 commented 7 months ago

Thanks, I have made both changes and they worked.

namdre commented 1 month ago

Root problem remains to be fixed

qichaow commented 1 month ago

Hi Jakob,

I just want to share that I’m taking a leave to take care of a family emergency. I won’t be able to get to this soon. Just wanted to give you a heads up.

Thanks, Qichao

On Tue, Jul 30, 2024 at 1:38 AM Jakob Erdmann @.***> wrote:

Root problem remains to be fixed

— Reply to this email directly, view it on GitHub https://github.com/eclipse-sumo/sumo/issues/14287#issuecomment-2257679345, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYWAWD6ROUAU3NZWTP6XWLZO47HJAVCNFSM6AAAAABCS7UR62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXGY3TSMZUGU . You are receiving this because you were mentioned.Message ID: @.***>