Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Vehicles not following Traffic Signal with traci.

Hello everyone

I am new with Traci. I am trying to run my model with that. What I am
observing is that the vehicles in my models are not following traffic
signals. On the other hand, with sumo-gui, they are completely following it.
Am I missing something?  

import traci
traci.start(sumoCmd)
print("Starting SUMO")
traci.gui.setSchema("View #0", "real world")

step = 0
while step < 3600:
    traci.simulationStep()
    
    vehicles=traci.vehicle.getIDList();
    if (step%10)==0: #every 10 sec....
        for i in range(0,len(vehicles)):
            print("Speed ", vehicles[i], ": ",
traci.vehicle.getSpeed(vehicles[i]), " m/s")    
            print("CO2Emission by vehicle", vehicles[i], ": ",
traci.vehicle.getCO2Emission(vehicles[i]), " mg/s")                
            print("EdgeID of veh ", vehicles[i], ": ",
traci.vehicle.getRoadID(vehicles[i]))  
            print('Distance covered by vehicle', vehicles[i], ": ",
traci.vehicle.getDistance(vehicles[i]), " m")  
            print('Waiting time by vehicle', vehicles[i], ": ",
traci.vehicle.getWaitingTime(vehicles[i]), " sec")      
    step +=1
traci.close()



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/


Back to the top