Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Adding penalties to current travel times.

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 <sumo-user@xxxxxxxxxxxxxxxxxxxxx>:
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
sumo-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/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://dev.eclipse.org/mailman/listinfo/sumo-user


Back to the top