Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repeating public transit routes #7127

Closed
cweinhaupl opened this issue Jun 8, 2020 · 7 comments
Closed

repeating public transit routes #7127

cweinhaupl opened this issue Jun 8, 2020 · 7 comments
Labels

Comments

@cweinhaupl
Copy link

@namdre

For clarification regarding repeating PT.
I am wanting to have the same type vehicle repeat its route.

I tried repeating edges and stops in router and flow.
I think I misunderstood your comments regarding this question:
#6550

    <flow id="f1" color="1,1,0"  begin="0" end= "3600" period="30" type="12passenger">
        <route edges="north gneE0 city gneE1 north gneE0 city gneE1 north gneE0 city gneE1 north gneE0 city gneE1"/>
        <stop busStop="busStop_north_0_1" duration="10"/>
        <stop busStop="busStop_city_0_0" duration="10"/>
        <stop busStop="busStop_north_0_1" duration="10"/>
        <stop busStop="busStop_city_0_0" duration="10"/>
        <stop busStop="busStop_north_0_1" duration="10"/>
        <stop busStop="busStop_city_0_0" duration="10"/>
        <stop busStop="busStop_north_0_1" duration="10"/>
        <stop busStop="busStop_city_0_0" duration="10"/>
    </flow>
    <route id="r_north_to_city" edges="north gneE0 city gneE1 north gneE0 city gneE1 north gneE0 city gneE1 north gneE0 city gneE1">
        <stop busStop="busStop_north_0_1" duration="10"/>
        <stop busStop="busStop_city_0_0" duration="10"/>
        <stop busStop="busStop_north_0_1" duration="10"/>
        <stop busStop="busStop_city_0_0" duration="10"/>
        <stop busStop="busStop_north_0_1" duration="10"/>
        <stop busStop="busStop_city_0_0" duration="10"/>
    </route>
@namdre namdre added the question label Jun 8, 2020
@namdre
Copy link
Contributor

namdre commented Jun 8, 2020

I'm not sure what your question is.

  • if you want to keep the same vehicle circulation (vehicle id stays the same) then you can either
    • define a vehicle or trip with lots of repeating stops
    • define a route that loops back to the start once and uses attribute 'repeat'. then assign that route to a vehicle
  • if you want to keep sending a new vehicle on the same route repeatedly you can use a flow.

Of course, both things can be combined if you want multiple vehicles running the same repeating loop.

@namdre namdre closed this as completed Jun 8, 2020
@pearlahajjar
Copy link

pearlahajjar commented Feb 1, 2022

hello @namdre,

I am still facing the same problem.

I have a circle like route with stops along the route. In the first run of the buses, they stop at assigned stops, but in the following runs, the buses stop at every stop and passengers do not board.

The additional file:
`

<busStop id="busStop_0" lane="2_0" startPos="4.58" endPos="14.58"/>
<busStop id="busStop_2" lane="6_0" startPos="5.52" endPos="15.52"/>
<busStop id="busStop_1" lane="9_0" startPos="7.49" endPos="17.49"/>
<busStop id="busStop_3" lane="11_0" startPos="6.74" endPos="16.74"/>

<route id="reroute1" edges="12 1 2 3">
<stop busStop="busStop_0" duration="10"/>
</route>

<route id="reroute2" edges="3 4 5 6 7">
<stop busStop="busStop_2" duration="10"/>
</route>

<route id="reroute3" edges="7 8 9 10">
<stop busStop="busStop_1" duration="10"/>
</route>

<route id="reroute4" edges="10 11 12">
<stop busStop="busStop_3" duration="10"/>
</route>
<rerouter id="rerouter_1" edges="3" probablity="1">
    <interval begin="0.00" end="3600.00">
        <routeProbReroute id="reroute2"/>
    </interval>
</rerouter>

 <rerouter id="rerouter_2" edges="7" probablity="1">
    <interval begin="0.00" end="3600.00">
        <routeProbReroute id="reroute3"/>
    </interval>
</rerouter>

<rerouter id="rerouter_3" edges="10" probablity="1">
    <interval begin="0.00" end="3600.00">
        <routeProbReroute id="reroute4"/>
    </interval>
</rerouter>
`

and the route xml file:
`


<vehicle id="Bus_1" type="Bus" depart="0.00" route="route_0" color="red">
    <stop busStop="busStop_0" duration="10.00"/>
    <stop busStop="busStop_2" duration="10.00"/>
</vehicle>

<person id="person0" depart="0.00">
    <walk from="1" busStop="busStop_0" arrivalPos="55.00"/>
    <ride busStop="busStop_1" lines="Bus_2"/>
    <walk to="10" arrivalPos="30.00"/>
</person>

<personFlow id="personf" begin="0" probability="0.1" departPos="10">
   <walk from="1" busStop="busStop_0" arrivalPos="55.00"/>
   <ride busStop="busStop_1" lines="Bus_2"/>
   <walk from="9" to="11" arrivalPos="15"/>
<vehicle id="Bus_2" type="Bus" depart="0.00" route="route_0" color="yellow">
    <stop busStop="busStop_0" duration="10.00"/>
    <stop busStop="busStop_1" duration="10.00"/>
</vehicle>

<person id="person1" depart="5.00" >
<walk from="1" busStop="busStop_0" departPos="21" arrivalPos="55"/>
<ride busStop="busStop_3" lines="ANY" />
<walk to="10" arrivalPos="30" />
 </person>

 <vehicle id="Bus_3" type="Bus" depart="10.00" route="route_0" color="blue">
    <stop busStop="busStop_2" duration="10.00"/>
    <stop busStop="busStop_1" duration="10.00"/>
 </vehicle>

 <vehicle id="Bus_4" type="Bus" depart="15.00" route="route_0" color="green">
    <stop busStop="busStop_0" duration="10.00"/>
    <stop busStop="busStop_2" duration="10.00"/>
    <stop busStop="busStop_1" duration="10.00"/>
    <stop busStop="busStop_3" duration="10.00"/>
 </vehicle>

`

Thank you for your help.

@namdre
Copy link
Contributor

namdre commented Feb 1, 2022

Rerouters are not recommended for modelling looped public transport routes.

  • if you have busses that service different stops you would need to define a different rerouter for each bus and make them specific to a particular bus by using vTypes filtering (difficult and error prone)
  • rerouters cannot handle public transport schedules ('until'-times)

Instead, define a route for each bus that includes the stops and use the 'repeat' attribute for looping.

@pearlahajjar
Copy link

Can I still change the route stops using traci throughout the simulation in this way?

@namdre
Copy link
Contributor

namdre commented Feb 1, 2022

Yes. When using 'repeat', all stops the vehicle will ever take can be retrieved with traci.vehicle.getStops. They can be replaced or removed using traci.vehicle.replaceStop

@pearlahajjar
Copy link

Thank you so much for your help. It was very useful. I managed to let the buses stop at desired stops the whole simulation.

If I want to let a bus skip the next stop in the simulation dynamically, can it be done? I don't want to remove it from the road, just this bus do not stop on it now.

@namdre
Copy link
Contributor

namdre commented Feb 3, 2022

You can use replaceStop with an empty string for the edgeID argument to remove the stop at the specified index in the stop list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants