From: Jakob E. <nam...@go...> - 2013-03-29 13:23:25
|
1). Surprisingly (to mysell at least) the method traci.vehicle.rerouteTraveltime does not employ current travel times but rather uses loaded travel times (similar to loaded efforts). In the absence of loaded travel times the minimum travel time (length/speed) is used. There are 2 workarounds: a) equip your vehicles with rerouting devices (see tests/sumo/extended/simulation_routing b) update the traveltimes via traci: for edge in traci.edge.getIDList(): traci.edge.adaptTraveltime(edge, traci.edge.getTraveltime(edge)) this uses the fact that traci.edge.getTraveltime returns the *current* traveltime Unfortuantely, due to https://sourceforge.net/apps/trac/sumo/ticket/878this doesn't work at the moment. 2). many sumo outputs have the correct format to be used as weight files. see tests/sumo/outputs/meandata_edgebased regards, Jakob 2013/3/29 Wilmer Arellano <war...@my...> > Thank you Jakob, two last questions: > > > 1. Why doesn't the reroute by minimum time work in my example? > 2. Any link to how to create weight files? > > > Wilmer > > On Fri, Mar 29, 2013 at 5:37 AM, Jakob Erdmann <nam...@go... > > wrote: > >> Hello, >> routing by effort in the simulation only works if you start sumo with >> a weight file and declare which of the attributes in this file shall >> be interpreted as effort (options --weight-files, --weight-attribute). >> Otherwise every edge has effort 0. >> regards, >> Jakob >> >> 2013/3/29 Wilmer Arellano <war...@my...>: >> > Hello, >> > >> > >> > >> > I am sorry to post this topic again but I am having >> > some difficulties understanding reroutes in TraCI. >> > >> > >> > >> > I am attaching a zip file that when expanded will contain runner3.py >> and a >> > folder with the network files, the simulation works this way: >> > >> > 1. runner3.py will start the simulation which consists of cars >> initially >> > routed to go from south to north using the center of a rectangular >> grid >> > network. >> > 2. The first car is set to stop and all following cars, after t = 20 >> > seconds, are rerouted with either* traci.vehicle.rerouteEffort()* or >> * >> > traci.vehicle.rerouteTraveltime()*. >> > 3. In order to select what kind of reroute to use the # sign shuld >> be >> > changed from on type of reroute to the other in the following block >> of code >> > in runner3.py >> > >> > if time > 20000: >> > >> > traci.vehicle.rerouteEffort(carList[0]) >> > >> > #traci.vehicle.rerouteTraveltime(carList[0]) >> > >> > >> > >> > 4. In order to see the original routing of the cars, the previous >> block >> > of code and the instruction: traci.vehicle.setStop("0", "2/2to2/3", >> > pos=20.0, laneIndex=0, duration=2147483647)should be eliminated >> > >> > >> > >> > Results >> > >> > 1. traci.vehicle.rerouteTraveltime() appears not to work as no route >> > change happens even though DijkstraRouterTT respond the queries. >> > 2. traci.vehicle.rerouteEffort() seems to work OK even though in the >> > example that I provide it provides the same rerouted route to all >> vehicles >> > and that route is not the shortest. >> > >> > Intuitively I would expect ”traci.vehicle.rerouteEffort()” to provide >> the >> > alternate shortest route and “traci.vehicle.rerouteTraveltime()” to >> produce >> > the alternate fastest route. >> > >> > >> > Is there any thing wrong in my interpretation? Help is greatly >> appreciated. >> > >> > >> > >> > Thank you, >> > >> > >> > Wilmer >> > >> > >> ------------------------------------------------------------------------------ >> > Own the Future-Intel(R) Level Up Game Demo Contest 2013 >> > Rise to greatness in Intel's independent game demo contest. Compete >> > for recognition, cash, and the chance to get your game on Steam. >> > $5K grand prize plus 10 genre and skill prizes. Submit your demo >> > by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2 >> > _______________________________________________ >> > sumo-user mailing list >> > sum...@li... >> > https://lists.sourceforge.net/lists/listinfo/sumo-user >> > >> > > |