Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Edge-List is expanding unnecessarily when I reroute via traci.

Hi,
I use Sumo Version 1.3.1
So basically I want to drive back and forth:
            if (traci.vehicle.getRoadID(vehicle) =='gneE28'):
                traci.vehicle.changeTarget(vehicle,'gneE11')
            if (traci.vehicle.getRoadID(vehicle) =='gneE11'):
                traci.vehicle.changeTarget(vehicle,'gneE28')
               
when I print (traci.vehicle.getRoute(vehicle)) I see that the Edges-List gets longer, the longer the simulation runs. But to save space I only want to save the edges which I need to reach the destination. I tried traci.vehicle.setRoute(vehicle,traci.vehicle.getRoadID(vehicle)) to reset the route, but it only appends the new edge to the previously traveled route. Is there a way to reset the route? If not, what is the reason behind it?
Best,
Valentin

Back to the top