Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] When a vehicle can leave the simulation?

I you want to retain a vehicle in the simulation you have exactly two options:
- you can make it stay where it is (either on the road or besides the road)
- you can make it continue (but then you should have some plausible destination)

A vehicle may have multiple stop definitions in its route and you can add/remove stops via TraCI.
To prolong the route you may simply set a new destination using traci.vehicle.changeTarget() and the route to that target will be computed automatically if it exists. Obviously, the latter method will not work if your network contains a cul-de-sac without turn-around.



Am Mo., 16. Sept. 2019 um 15:26 Uhr schrieb Paolo Bolzoni <paolo.bolzoni.brown@xxxxxxxxx>:
On Fri, Sep 13, 2019 at 6:12 PM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
> Indeed, a vehicle that reaches the end of its route will leave the simulation. To prevent this, add a stop at the end of the route or add more edges.

I am afraid I cannot use the idea of adding a stop because the
objectives are stops, the idea was exactly send the vehicle to the
next objective when the stop was over.

To use the "add more edges" idea: I need to
. get the id of last edge in the route (let's call it A)
. load the xml net file,
. look up for the edge tag with the id A
. get its "to" attribute (let's call it D)
. loop up for an edge with the "from" attribute to D
. add the edge to the route

Is that correct? It sounds a bit convoluted. And are we sure I can
always find an extra edge to add?

Cheers,
Paolo
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top