Discussion:
[sumo-user] Queries about TraCI and SUMO
Ankur Sarker
2016-10-18 01:28:15 UTC
Permalink
Hi,

I am trying to change velocities of vehicles using TraCI. I have some
queries:

1. In my simulation, I am getting negative value from getDistance()
function. What would be the possible reason? Followings are my code:
------------------------------------------------------------------------------------
vehicles = traci.vehicle.getIDList()
for word in vehicles:
if word == "kang":
distance = traci.vehicle.getDistance("kang")
vel1 = traci.vehicle.getSpeed("kang")
print distance
--------------------------------------------------------------------------------------
2. How to let the vehicles stop at the final destination gradually?

3. If I use the TraCI in python, what is the simulation step in time? 1
second? or something else?
-----------------------------------------------------------------------------
step = 0
while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()
step+=1
--------------------------------------------------------------------------------

Thanks for your time!
A. Sarker
Jakob Erdmann
2016-10-18 06:32:51 UTC
Permalink
1). If the vehicle has not yet departed or if the route of the vehicle is
disconnected, the magic value -1001 is returned. Otherwise the distance
should be positive

2). in the vehicle definition, set arrivalSpeed=0. You could send the
maximum deceleration to a lower value to get a slower approach (can be done
via TraCI as wel). Alternatively, you could use the 'slowDown' command to
set a speed time line

3). The step length defaults to 1s but can be configured using the sumo
--step-length parameter. Some functions read/return time in ms though (i.e.
simulation.getCurrentTime). Beware.
Post by Ankur Sarker
Hi,
I am trying to change velocities of vehicles using TraCI. I have some
1. In my simulation, I am getting negative value from getDistance()
------------------------------------------------------------
------------------------
vehicles = traci.vehicle.getIDList()
distance = traci.vehicle.getDistance("kang")
vel1 = traci.vehicle.getSpeed("kang")
print distance
------------------------------------------------------------
--------------------------
2. How to let the vehicles stop at the final destination gradually?
3. If I use the TraCI in python, what is the simulation step in time? 1
second? or something else?
------------------------------------------------------------
-----------------
step = 0
traci.simulationStep()
step+=1
------------------------------------------------------------
--------------------
Thanks for your time!
A. Sarker
------------------------------------------------------------
------------------
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
https://lists.sourceforge.net/lists/listinfo/sumo-user
Loading...