Hi,
no, it is not the same. Your second option is not right. If you already defined a route, then you only need to add the “route” attribute to your vehicle element.
<routes>
<route
id="route0"
color="1,1,0"
edges="beg
middle end rend"/>
<vehicle
id="0"
route="route0"
depart="0"
color="1,0,0"/>
</routes>
Your second example would be possible, if you are defining a new route as a child of your vehicle, like this:
<routes>
<vehicle
id="0"
depart="0"
color="1,0,0">
<route
edges="beg
middle end rend"/>
</vehicle>
</routes>
See
https://sumo.dlr.de/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#vehicles_and_routes
With routeDistribution, the definition of the routes according to the docu would be:
<routes>
<routeDistribution id="routedist1">
<route id="route_0" edges="beg middle end rend" probability="0.1" />
<route id="route_1" edges="beg middle2 end rend" probability="0.9" />
</routeDistribution>
<vehicle id="0" depart="0" route="routedist1"/>
</routes>
Regards,
Giuliana
Von: sumo-user-bounces@xxxxxxxxxxx <sumo-user-bounces@xxxxxxxxxxx>
Im Auftrag von Theophile Cabannes
Gesendet: Montag, 9. November 2020 15:10
An: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] Use predefined routes in route distribution
Thank you Giuliana,
If I can do what I have suggested, then I guess that the two following route files will be understand the same way:
<routes>
<route
id="route0"
color="1,1,0"
edges="beg
middle end rend"/>
<vehicle
id="0"
route="route0"
depart="0"
color="1,0,0"/>
</routes>
<routes>
<route
id="route0"
color="1,1,0"
edges="beg
middle end rend"/>
<vehicle
id="0"
depart="0"
color="1,0,0">