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")Am Do., 21. Nov. 2019 um 07:24 Uhr schrieb Hao Zhou <[email protected]>: > 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 > > On November 19, 2019 at 1:55 PM, Jakob Erdmann <[email protected]> > wrote: > > 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 > > Am Mo., 18. Nov. 2019 um 22:19 Uhr schrieb Hao Zhou <[email protected] > >: > >> 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 >> [email protected] >> 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 > [email protected] > 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 > [email protected] > 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 [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
