The travel_time * penalty approach you describe is the most flexible and general approach. You could achieve a similar effect (automatically updated travel times, some customization via TraCI) with device.rerouting. http://sumo.dlr.de/wiki/Demand/Automatic_Routing
regards, Jakob 2017-10-03 18:36 GMT+02:00 Shekar V via sumo-user < [email protected]>: > Hello > > I am trying to run a simple simulation where all vehicles move from Point A > to Point B. There are only 2 routes to travel from A to B, say Route1 and > Route2. > > I want to "discourage" the router from assigning vehicles to Route1 by > adding a penalty/weight to the route. To do this, I am using weight files > with the traveltime attribute along with the traci command: > traci.vehicle.rerouteTraveltime(self, vehID, currentTravelTimes=False) > > I understand that by doing this the vehicle will completely ignore the > current travel times and route according to the weights defined in the > weight file. What I want to do is add a penalty to the current travel > times, so that if Route 2 becomes congested, new trips will be routed > through Route 1. > > An approach I was considering is: > travel_time = traci.edge.getTraveltime(edgeID) > new_travel_time = travel_time * penalty > traci.edge.adaptTraveltime(edgeID, new_travel_time) > > If there is an easier way to solve this issue please let me know. > > Thanks > Shekar > ------------------------------------------------------------ > ------------------ > 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/sumo-user > _______________________________________________ > sumo-user mailing list > [email protected] > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://dev.eclipse.org/mailman/listinfo/sumo-user > ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/sumo-user
