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

Pedestrian ignoring red lights at railway crossing #13680

Closed desvelado closed 1 year ago

desvelado commented 1 year ago

Hello,

i try to modify the pedestrian model to ignore a red light at a railway crossing (tram). I tried to modify the vtype pedestrian with attributes jmDriveAfterRedTime jmIgnoreFoeProb jmIgnoreFoeSpeed both for tram and pedestrian. Nothing works. they also stay there until its green.

What is the right way to do this? The following doesnt work for jmIgnoreFoeProb= or 1:

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
    <vType id="ped_kamikaze" vClass="pedestrian" jmIgnoreFoeProb="0" jmIgnoreFoeSpeed="100"/>
    <person id="ped0" type="ped_pedestrian" depart="0.00" speedFactor="1">
        <walk edges="252291183#4 775504599#0 775504599#2 775504600#0"/>
    </person>
    <person id="ped_kami0" color="red" type="ped_kamikaze" depart="0.00" speedFactor="1.0">
        <walk edges="252291183#4 775504599#0 775504599#2 775504600#0"/>
    </person>
</routes>

If somebody could help i would be glad!

Sumo 1.17.0 Win10

m-kro commented 1 year ago

Persons come with their own pedestrian behaviour model (see docs) which does not use the junction model parameters. Read about interaction with other modes here.

desvelado commented 1 year ago

Thanks for your response - but it doesn't help anyway.

I tried several approaches to have a pedestrian not waiting in front of a signal. What i want is: A pedestrian crossing a street / railway at a crossing and IGNORING the red light.

Whats the way to do this? i tried to change the pedestrian model via in the config-file - doesn't help

I tried to add `

    </attributes> `

at a person - no changes for the signal behavior.

i also tried jmDriveAfterRedTime="200" impatience="-2" directly at <person ...> - does also not work

What is the easiest way th reach that a person ignores a traffic light? Please give me an example or pseudo code how to reach this behavior.

thanks in adavance

In my route file i treid some things out:`

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
    <vType id="ped_pedestrian" vClass="pedestrian"/>
    <vType id="ped_kamikaze" vClass="pedestrian" jmDriveAfterRedTime="3" impatience="-2"/>
    <person id="ped0" type="ped_pedestrian" depart="0.00" speedFactor="1">
        <walk edges="252291183#4 775504599#0 775504599#2 775504600#0"/>
    </person>
    <person id="ped_kami0" color="red" type="ped_kamikaze" depart="0.00" speedFactor="1.0">
        <walk edges="252291183#4 775504599#0 775504599#2 775504600#0"/>
    </person>
</routes>

Here's some code from an additional xml-file, loaded in cfg:

<additional>
    <!-- Define the pedestrian 
    https://sumo.dlr.de/docs/Specification/Persons.html#available_vtype_attributes
    -->
    <person id="ped1" depart="0" color="yellow"  departLane="random" speedFactor="1.0" jmDriveAfterRedTime="10" jmIgnoreFoeProb="120" impatience="-2">
        <walk edges="252291183#4 775504599#0 775504599#2 775504600#0"/>
    </person>
    <person id="ped2" depart="0" color="yellow"  departLane="random" jmDriveAfterRedTime="200" impatience="-2">
        <walk edges="252291183#4 157449033#1 108893544#1 "/>
        <attributes>
        <attribute  key="walkBehavior" type="continuous"/>
        </attributes>
    </person>

    <!-- Define the pedestrian behavior -->
    <personDefinition id="ped_kamikaze_behavior" />
</additional>

If it would be helpful i could give some files.

m-kro commented 1 year ago

Actually I was wrong. The junction model parameters jmIgnoreFoeSpeed / jmIgnoreFoeProb have been made usable for pedestrians in #7148 . Please download this test to get a working example to play with. For traffic lights choose jmDriveAfterRedTime value > 0 (even > red time if you want it to happen anytime)

desvelado commented 1 year ago

Thank you very much, not its working as i wanted. Somewhere was an error maybe missing pedestrian model in cfg.