Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] vehicle.setRoute() Changing Initial Edge

Hello,
the solution is to generate routes that start from the current vehicle edge. Either:
- use findRoute() from the current edge to the intended destination
- if you have a route that starts somewhere else, remove all edges before the current vehicle edge

regards,
Jakob

2018-04-18 2:29 GMT+02:00 Jonathan Harper via sumo-user <sumo-user@xxxxxxxxxxxxxxxxxxxxx>:
Hello,

I’m currently attempting to set the route of a vehicle during runtime, however, currently setRoute() returns the error “raise TraCIException(prefix[1], _RESULTS[prefix[2]], err) // traci.exceptions.TraCIException: Route replacement failed”. After doing some debugging I believe the issue is that I am setting a route which does not begin with the edge in which the vehicle is currently occupying.

For example, if I have a route which I know would work from the point of the simulation beginning, if I were to set that route after the vehicle had moved off that initial edge, I would receive the error.

I’ve tried to do vehicle.changeTarget() with the last edge of the aforementioned route being the target in hopes that the route would be rebuilt with the first element in the route list being the current edge, however, the origin edge is still used. I have also tried to do a rerouting using rerouteTraveltime(), again with the hopes that the routes generated would be from the current position of the vehicle, but with similar results to the changeTarget() method.

Is there any methods in order to reroute the vehicle with consideration of it’s current edge (where the route would be from that current edge to the same destination edge as defined in the routes.xml file)?

Kind regards,
Jonathan



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sumo-user mailing list
sumo-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sumo-user


Back to the top