print(traci.simulation.findRoute('gneE28','gneE11')) returns a Stage object:

Stage(type=3, edges=('gneE28', '-gneE28', '-gneE27', '-gneE26', '-gneE25',
'-gneE24', '-gneE23', '-gneE22', '-gneE21', '-gneE20', '-gneE19',
'-gneE18', '-gneE17', '-gneE16', '-gneE15', '-gneE14', '-gneE13',
'-gneE12', '-gneE11', 'gneE11'), travelTime=97.9654663546,
cost=97.9654663546, length=4012.31, depart=-1073741824.0,
departPos=-1073741824.0, arrivalPos=-1073741824.0)
So there is no Route ID. Is there a way to assign a routeID to that stage
object?


Am Fr., 6. Nov. 2020 um 10:29 Uhr schrieb <[email protected]>:

> Hi Valentin,
>
>
>
> maybe you can try with setRouteID. First you will need to search the edges
> of the new route, which you can do with findRoute. See
> https://sumo.dlr.de/docs/TraCI/Change_Vehicle_State.html and
> https://sumo.dlr.de/docs/TraCI/Simulation_Value_Retrieval.html
>
>
>
> Regards,
>
> Giuliana
>
>
>
>
>
> *Von:* [email protected] <[email protected]> *Im
> Auftrag von *Valentin Klamka
> *Gesendet:* Donnerstag, 5. November 2020 15:44
> *An:* Sumo project User discussions <[email protected]>
> *Betreff:* [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
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to