thanks Jakob.
A routeID is the name for a list of edges and must be registered first:
traci.route.add("route0", ["E3D3","D3C3"]) traci.vehicle.add("vehicle0", "route0")
Hey Jakob, I tried the following simple test but it failed, I don't see why it happens.
veh_id = 0 route_ID = str(["E3D3","D3C3",]) traci.vehicle.add(str(veh_id),route_ID)
File "/home/hao/sumo/tools/traci/connection.py", line 105, in _sendExact raise TraCIException(err, prefix[1], _RESULTS[prefix[2]]) traci.exceptions.TraCIException: Invalid route '['E3D3', 'D3C3']' for vehicle '0'.
Could you help explain?
Thank you, Hao Hello, you can call traci.vehicle.add repeatedly with the same routeID. just make sure to use a new vehicleID every time. Alternatively, you could call sumo with option --scale to easily scale the amount of traffic up or down.
regards, Jakob
Hi all,
I want to keep generating vehicles until the network reaches a certain density level. I know sumo has the option to give a limit on the number of vehicles, which is one of the options. But do there exist better approaches? I want to do multiple experiments with different density levels, so it would be best if I can do it in a loop with traCI. I tried traci.vehicle.add, and found an old question says that route id cannot be repeated. In a word, how can I use traci to generate flow until we reach our desired density?
Thank you in advance, Hao _______________________________________________ sumo-user mailing list sumo-user@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user
|