Hi Jakob,

 

I tried the workaround. But adding some route that consists of my desired 
origin edge will lead to “TraciException: Could not add route”. This is what I 
did:

 

traci.route.add("dummyRoute", [origin.link])

traci.vehicle.addFull("dummy", "dummyRoute", "taxi")

traci.vehicle.changeTarget("dummy", destination.link)

route = traci.vehicle.getRoute("dummy")

estimatedTime = 0

for edgeID in route:

estimatedTime += traci.lane.getLength(edgeID+"_0") / 
traci.lane.getMaxSpeed(edgeID+"_0")

traci.vehicle.remove("dummy")

 

I’ve no idea why this fails. Could you please shed some light on it? Thanks 
again!

 

Best regards,

Li

 

From: Jakob Erdmann [mailto:[email protected]] 
Sent: Wednesday, January 11, 2017 6:55 AM
To: Li Yan
Cc: sumo-user
Subject: Re: [sumo-user] About estimating travel time from road speed limit

 

Hello,

this is a known deficiency in the traci API. see 
http://sumo.dlr.de/trac.wsgi/ticket/2524 which also outlines the current 
work-around.

Your approach in modifying the C++ code has no obvious errors but you will have 
to debug this for yourself.

regards,

Jakob

 

2017-01-11 1:35 GMT+01:00 Li Yan <[email protected]>:

Dear SUMO contributors,



Is there any way to estimate the travel time from origin to destination by
the speed limit of the edges in the route? For example,
traci.simulation.getDistanceRoad() returns the distance of the shortest
route between two positions. I wish to estimate the travel time for driving
this route.



I've tried adding a function similar to SUMOReal MSRoute::getTimeBetween()
in MSRoute.cpp. The only difference is the distance of each edge is divided
by its speed limit (edge->getSpeedLimit()), which is expected to return the
travel time of this edge. But the returned result is the same with SUMOReal
MSRoute::getDistanceBetween(), which means the speed limits of all the edges
are 1?



If I'm modifying the source code in the wrong way (I'm not sure whether
edge->getSpeedLimit() is the right way to get the speed limit of an edge),
please give me some hint. Or please show me if there are other neat ways to
finish this job. Thanks a lot!



Best regards,

Li



Li Yan, Ph.D. candidate

Department of Computer Science

University of Virginia

Personal website:  <http://www.people.virginia.edu/~ly4ss/>
http://www.people.virginia.edu/~ly4ss/



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

 

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to