Dear Sir,
Successfully implemented following code :
"""execute the TraCI control loop"""
step = 0
while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()
print("Vehicle List")
my_vehicle_list = traci.vehicle.getIDList()
print(my_vehicle_list)
for vehicle_id in my_vehicle_list:
traci.vehicle.setRoute(vehicle_id, ['ed04','ed05','ed06','ed07','ed08','ed10','ed03'])
print (vehicle_id)
step += 1
traci.close()
sys.stdout.flush()
But When I am executing following line :
traci.vehicle.setRoute(vehicle_id, ['ed04','ed05','ed06','ed07','ed08','ed10','ed03'])
I got Error :
traci.exceptions.TraCIException: Route replacement failed for veh1
My Route File is :
<routes>
<vType accel="1.0" decel="5.0" id="Car" length="2.0" maxSpeed="100.0" sigma="0.0" />
<route id="route0" edges="ed01 ed02 ed03 ed04 ed05 ed06 ed07 ed01"/>
<route id="route1" edges="ed04 ed05 ed06 ed07 ed08 ed10 ed03 ed04"/>
<vehicle depart="0" id="veh1" route="route1" type="Car" />
</routes>
Sorry sir for asking such a silly questions,But I am new to this.