Search code examples
loopssimulationsumo

Bus stops in SUMO


I recently started using SUMO 1.5.0. I am simulating a simple bus route. I was able to add bus stops and get vehicles to loop in a route using reRouter. Before the bus reaches the rerouter, the bus stops at bus stops, but on the second loop or after reaching the rerouter, the bus no longer stops at the bus stops. Can you please help me with this. Here is the code of the additional file and vehicle stop definition in the route file

<additional>
<rerouter id="Rerouter_0" edges="8" probablity="1">
        <interval begin="0.00" end="3600.00">
                <destProbReroute id="4"/>
        </interval>
</rerouter>
<rerouter id="Rerouter_2" edges="4" probablity="1">
        <interval begin="0.00" end="3600.00">
            <destProbReroute id="8"/>
        </interval>
</rerouter>
<busStop id="BusStop1" lane="3_0" startPos="45" endPos="55"/>
<busStop id="BusStop2" lane="7_0" startPos="45" endPos="55"/>
</additional>

<routes>
<route id="Route_1" edges="1 2 3 4 5 6 7 8"/>
    <vType accel="1.1176" decel="0.89" id="Bus" length="14" maxSpeed="25" color="1,0,0"/>
    <vType accel="3" decel="1.3" id="Car" length="5" maxSpeed="30" sigma="0.5" color="0,1,0"/>
        <vehicle depart="0" id="Bus_1" route="Route_1" type="Bus">
            <stop busStop="BusStop1" duration="10"/>
            <stop busStop="BusStop2" duration="10"/>
        </vehicle>
        <vehicle depart="5" id="Bus_2" route="Route_1" type="Bus">
            <stop busStop="BusStop1" duration="10"/>
            <stop busStop="BusStop2" duration="10"/>
        </vehicle>
        <vehicle depart="10" id="Car_1" route="Route_1" type="Car"/>
        <vehicle depart="15" id="Car_2" route="Route_1" type="Car"/>
        <vehicle depart="20" id="Car_3" route="Route_1" type="Car"/>
        <vehicle depart="25" id="Car_4" route="Route_1" type="Car"/>
 </routes>

Solution

  • You need to make the stops part of the route and not part of the vehicle and let the rerouter assign that route not just choose a new destination.

    <additional>
        <busStop id="BusStop1" lane="3_0" startPos="45" endPos="55"/>
        <busStop id="BusStop2" lane="7_0" startPos="45" endPos="55"/>
        <route id="reroute_0" edges="8 1 2 3 4">
            <stop busStop="BusStop1" duration="10"/>
        </route>
        <route id="reroute_2" edges="4 5 6 7 8">
            <stop busStop="BusStop2" duration="10"/>
        </route>
        <rerouter id="Rerouter_0" edges="8" probablity="1">
            <interval begin="0.00" end="3600.00">
                <routeProbReroute id="reroute_0"/>
            </interval>
        </rerouter>
        <rerouter id="Rerouter_2" edges="4" probablity="1">
            <interval begin="0.00" end="3600.00">
                <routeProbReroute id="reroute_2"/>
            </interval>
        </rerouter>
    </additional>