Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Ego vehicle route loop


The 'repeat' attribute is what I needed indeed (had trouble finding it with Google but for reference it's at ).
I can skip the additional files now and just use a repeat of 10,000 which is good enough.


On Mon, Feb 20, 2023 at 12:48 PM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
- if you don't need an "infinite" loop you can also use the 'repeat' attribute within a route
- you can add the additional file with <additional-files value="FILE"/>
- the <route> should go into the same file as the rerouter that references it.  The vehicle can go into either file
- to load additional files either put them into the sumocfg or add option --additional-file when starting sumo-gui (you cannot load them separately after the simulation has launched).

Am Mo., 20. Feb. 2023 um 12:23 Uhr schrieb Ruud van Gaal <r.vangaal@xxxxxxxxxx>:

I'm try to make an ego vehicle loop over a route. For this I seem to need a rerouter.
My .sumocfg file looks like this:

    <net-file value=""/>
    <route-files value="my_world.rou.xml"/>
    <begin value="0"/>
    <end value="-1"/>
    <step-length value="0.01"/>

The .rou.xml contains the ego vehicle:

    <route id="r_1" edges="-41304#0 -41304#1 41299...-41304#0"  />
    <vehicle id="ego" type="Ego_Car" route="r_1" depart="0.00" departLane="free" color="blue"/>

Then according to I need to add a rerouter in an 'additional' file. So I added '--additional-files additional.xml' to my startup and put this in the XML file to restart route 'r_1':

  <rerouter id="r_1_loop" edges="-41304#0" probability="1">
    <interval begin="0" end="0">
      <routeProbReroute id="r_1" probability="1"/>

However, SUMO reads the additional file before the route file (by design according to ). I get this in the log file:

***Starting server on port 50485 ***
Loading net-file from '' ... done (323ms).
Loading additional-files from 'additional.xml' ...
Error: MSTriggeredRerouter r_1_loop: Route 'r_1' does not exist.
Loading of additional-files failed.
Quitting (on error).

- can I add additional files in the .sumocfg file as well?
- must I forget about the .rou.xml and put all the information in the .rou.xml in the additional file (to get the ordering correct)?
- can I load additional files in sumo-gui to check errors there without going through my own startup procedure? (I'm spawning sumo-gui from a C++ app with libtraci)


sumo-user mailing list
To unsubscribe from this list, visit
sumo-user mailing list
To unsubscribe from this list, visit

Back to the top