22.01.2015 Views

Stefan Schröder - Simulating Carriers - MATSim

Stefan Schröder - Simulating Carriers - MATSim

Stefan Schröder - Simulating Carriers - MATSim

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Simulating</strong> carriers: time-dependent vehicle routing<br />

<strong>MATSim</strong> User Meeting 2012,<br />

<strong>Stefan</strong> <strong>Schröder</strong> (stefan.schroeder@kit.edu)<br />

Institut für Wirtschaftspolitik und Wirtschaftsforschung (IWW) Fachgebiet Netzwerkökonomie<br />

KIT – Universität des Landes Baden-Württemberg und<br />

nationales Großforschungszentrum in der Helmholtz-Gemeinschaft<br />

www.kit.edu


Agenda<br />

! Motivation<br />

! Problem<br />

! Algorithm<br />

! Case Study<br />

! Conclusion<br />

2 23.03.2012<br />

IWW


Motivation<br />

research project: conceptual and concrete contribution to behavioral<br />

freight modeling<br />

concept and test-implementation of multi-tiered freight framework<br />

(e.g. shipper, transport service provider and carrier)<br />

streamlining of carrier layer new <strong>MATSim</strong> agent<br />

3 23.03.2012<br />

IWW


Motivation<br />

Passenger traffic:<br />

persons conduct activities (=> travel through space => traffic)<br />

individual calculus: maximize utility, activity duration (+), travel time (-)<br />

typical decisions: route choice, activity sequence, mode choice<br />

Freight traffic:<br />

carriers offer transport services (=> travel through space => traffic)<br />

calculus: minimize costs, activity duration (-), travel time (-)<br />

typical decisions: route choice, activity sequence, vehicle scheduling,<br />

mode choice<br />

4 23.03.2012<br />

IWW


Motivation<br />

How to model route choice, activity sequence and vehicle<br />

scheduling decisions consistently<br />

Consistent<br />

given information about traffic system, decisions are made such<br />

that total costs are minimized<br />

Time-dependent vehicle router coupled with physical simulation<br />

of <strong>MATSim</strong><br />

5 23.03.2012<br />

IWW


Agenda<br />

! Motivation<br />

! Problem<br />

! Algorithm<br />

! Case Study<br />

! Conclusion<br />

6 23.03.2012<br />

IWW


Vehicle Routing Problem<br />

Problem<br />

Solution<br />

Source: http://neo.lcc.uma.es/radi-aeb/WebVRP/<br />

Single Depot VRP with capacity constraints<br />

7 23.03.2012<br />

IWW


Vehicle Routing Problem - Variety<br />

VRP type<br />

Capacitated (CVRP)<br />

Time Windows (VRPTW)<br />

Pickup and Delivery (VRPPD)<br />

Multiple Depots (VRPMD)<br />

Heterogeneous Fleet (VRPHF)<br />

CVRPTWPDMDHF<br />

...<br />

Costs<br />

Constant costs<br />

Time-dependent costs<br />

Demand<br />

Deterministic<br />

Stochastic<br />

Problem type<br />

Combinatorial problem<br />

Search space grows fast with #nodes<br />

Solution approaches<br />

Exact:<br />

Branch-and-Bound, Branch-and-Cut, ...<br />

(Meta)Heuristics:<br />

Tabu Search, Simulated Annealing, ...<br />

Initial solution<br />

Search through neighborhood<br />

8 23.03.2012<br />

IWW


Agenda<br />

! Motivation<br />

! Problem<br />

! Algorithm<br />

! Case Study<br />

! Conclusion<br />

9 23.03.2012<br />

IWW


Algorithm – Ruin-and-Recreate Principle<br />

Schrimpf et al. (2000) ★ ,<br />

(1) can be implemented as general framework, (2) simple operations<br />

Initial Solution<br />

Initial plan (vehicle routes)<br />

Ruin<br />

Remove customer from plan<br />

Recreate<br />

Re-Insert customer to plan<br />

Threshold Accepting<br />

Evaluate solution<br />

Final Solution<br />

★<br />

Record Breaking Optimization Results Using the Ruin and Recreate Principle,<br />

Gerhard Schrimpf,∗ Johannes Schneider,† Hermann Stamm-Wilbrandt,∗ and Gunter<br />

Dueck∗, Journal of Computational Physics, 2000.<br />

10 23.03.2012<br />

IWW


Algorithm – Ruin-and-Recreate<br />

Initial Solution<br />

Ruin<br />

Random Ruin (p=0.5,#customer=0.5)<br />

Radial Ruin (p=0.5,#customer=0.3)<br />

Recreate<br />

Best Insertion (min. marginal cost)<br />

Threshold Accepting<br />

Final Solution<br />

NewSolution.result < OldSolution.result + T<br />

T 0<br />

T = T 0<br />

* exp(−ln2* x<br />

0.1 )<br />

Determined by random walk<br />

€ Tolerant (1.Iteration) Greedy (last Iter.)<br />

€<br />

11 23.03.2012<br />

IWW


Algorithm – Radial Ruin<br />

Source: Schrimpf et. al (2000)<br />

Select customer randomly<br />

Identify neighborhood<br />

(e.g. time, space)<br />

Ruin neighborhood<br />

=> List of customers not<br />

served<br />

Re-insert customers<br />

subject to constraints<br />

(where MC is minimal)<br />

12 23.03.2012<br />

IWW


Algorithm – Time-dependency<br />

Time-dependent marginal costs are additional costs attributed to<br />

inserted customer<br />

MC(h)=c(i,h,depTime@i) + c(h,j,depTime@h) – c(i,j,depTime@i) + Δ<br />

Δ = changes in travel time due to changes in departure times at<br />

subsequent customers<br />

Time-dependent travel times <strong>MATSim</strong>‘s TDSPA<br />

13 23.03.2012<br />

IWW


Algorithm – Implementation & Verification<br />

Implementation in JAVA, available at contrib.freight.vrp<br />

Verification on test instances:<br />

Christophides, Mingozzi and Toth (CVRP)<br />

Solomon (CVRPTW)<br />

Li and Lim (CVRPTWPD)<br />

14 23.03.2012<br />

IWW


Agenda<br />

! Motivation<br />

! Problem<br />

! Algorithm<br />

! Case Study<br />

! Conclusion<br />

15 23.03.2012<br />

IWW


Case – Goals<br />

Illustrate VRP-algorithm<br />

Several carrier vehicles can be simulated along with<br />

passenger vehicles<br />

<strong>Carriers</strong> can pickup congestion and adapt to changes in the<br />

traffic system (they have plan strategies)<br />

<strong>Carriers</strong> can score plans and have plan memory<br />

16 23.03.2012<br />

IWW


Case – Setup<br />

Network:<br />

Link-Cap: 7 Veh/h<br />

Broadway-Link-Cap: 10 Veh/h<br />

Outer ring: 10 Veh/h<br />

Free-Speed: 50km/h<br />

Depot i<br />

W<br />

A<br />

W<br />

A<br />

Depot j<br />

Persons:<br />

#Persons: 400<br />

Activities.: home, work<br />

Locations<br />

Departure Home: 7:00 – 10:00<br />

Departure Work: 15:00 – 18:00<br />

<strong>Carriers</strong>:<br />

#<strong>Carriers</strong>: 10<br />

Location<br />

#Shipments: UD[10-40]<br />

Shipment size: UD(0-10]<br />

#Vehicles: 10; Vehicle Cap: 40<br />

Small Delivery TW: 30 min., UD<br />

[08:00am-12:00am]<br />

Operation-Start: UD[6:30am<br />

-8:30am]<br />

Simulation:<br />

#Iterations: 100<br />

17 23.03.2012<br />

IWW


Case – Simulation<br />

Initial Plans<br />

Vehicle routing based on empty road network (initialize routers)<br />

Simulation<br />

BeforeSim: Drivers are created from carrier plans<br />

Scoring<br />

score = −50 €/h * hours −1€/km * km −1000 €/h * hours_ tooLate<br />

Re-Planning<br />

−100 €/vehicle * vehicles<br />

€<br />

Persons:<br />

Best-Plan (0.95)<br />

Re-Route (0.05)<br />

<strong>Carriers</strong>:<br />

Best-Plan (0.9)<br />

Re-Schedule (0.05)<br />

Re-Route (0.05)<br />

select best carrier-plan<br />

transform best plan into initial solution for<br />

ruin-and-recreate algorithm<br />

do td-vehicle-routing on loaded network of the<br />

last iteration<br />

re-transform result into carrier-plan<br />

18 23.03.2012<br />

IWW


Case – Carrier Score<br />

Starting with bad score; initial<br />

plans made on empty road<br />

network<br />

Due to congestion, carriers<br />

miss almost every time window<br />

In the course of iterations,<br />

carrier can adapt to traffic<br />

conditions<br />

Total score can be increased<br />

by 78% ( costs of carriers)<br />

Red line: sum of best scores; Green line: sum of scores of executed plan; Blue: Avg. plan score per agent<br />

19 23.03.2012<br />

IWW


Case – Carrier Time<br />

Initial plan: Almost every time<br />

window missed<br />

Adaptations lead to a decrease<br />

of time too late<br />

Time on road can be reduced<br />

by 34%<br />

When late time decreases,<br />

waiting time increases slightly<br />

Red: total duty time; Green: total time on road; Blue: total waiting time; Yellow: total time too late<br />

20 23.03.2012<br />

IWW


Case – Verification<br />

0<br />

-50000<br />

1 11 21 31 41 51 61 71 81 91 101<br />

Green: improvements<br />

attributed to passengers<br />

Re-routing little better than<br />

doing nothing<br />

-100000<br />

-150000<br />

-200000<br />

noStrat<br />

reRoute<br />

reSchedule<br />

Re-scheduling is superior (30%<br />

better than other strat.)<br />

Re-Route: +2% computation<br />

time<br />

Re-Schedule: +26%<br />

computation time<br />

-250000<br />

sum of best scores<br />

21 23.03.2012<br />

IWW


Agenda<br />

! Motivation<br />

! Problem<br />

! Algorithm<br />

! Case Study<br />

! Conclusion<br />

22 23.03.2012<br />

IWW


Conclusion<br />

VRP library that can solve a variety of vehicle routing problems<br />

Carrier as new <strong>MATSim</strong>-Agent who can consistently consider changes in the<br />

traffic system<br />

<strong>MATSim</strong>-Agent that manages and employs a vehicle fleet<br />

Optimization of the operations of the number of vehicles vs. of a single<br />

vehicle => varying number of simulated vehicles<br />

Decision support system in City-Logistics<br />

From economic point of view, it is interesting for single logistics decision makers<br />

One step to modeling freight traffic<br />

23 23.03.2012<br />

IWW


Conclusion<br />

Challenges:<br />

How to calibrate a vehicle router (an optimization problem with constraints)<br />

empirically (here: normative model with assumption of complete<br />

information of the modeler)<br />

Need for tools like we have in discrete choice theory<br />

Thank you for your attention!<br />

24 23.03.2012<br />

IWW


Backup<br />

Large-scale scenarios<br />

Computation time: very good vs. good results<br />

Comp.Time: TD Shortest Path Algo<br />

Memory consumption: RR requires travel times from all customers to<br />

all customers => n*n*timeSlices (n = #customers)<br />

25 23.03.2012<br />

IWW


Backup – Solomon’s benchmarking (TW,100)<br />

- Converge to best known<br />

solution<br />

- Marginal costs increase<br />

- Very good solution are<br />

expensive<br />

- Good solutions are<br />

affordable<br />

26 23.03.2012<br />

IWW


Backup – Food Retailing<br />

<br />

<br />

<br />

<br />

<br />

Synthrade Hanno Friedrich<br />

Closing the gap between inter-regional and intra-regional models<br />

Evaluation of policy (city logistics) measures and impact<br />

assessment of food retailing<br />

Impact of E-retailing (REWE)<br />

Connecting consumers‘ demand with freight logistics<br />

27 23.03.2012<br />

IWW


Backup – Broadway with more cap<br />

28 23.03.2012<br />

IWW


Backup – Broadway with more cap<br />

29 23.03.2012<br />

IWW


Vehicle Routing Problem - CarrierPlan<br />

Problem<br />

Solution<br />

...<br />

30 23.03.2012<br />

IWW


Case – Along with passenger<br />

<br />

<br />

CarrierAgentTracker keeping track of Drivers initiated by <strong>Carriers</strong><br />

CarrierAgentTracker listens to Mobsim-Events and informs<br />

respective carriers<br />

31 23.03.2012<br />

IWW


Case – Bad initial solution<br />

0<br />

1<br />

6<br />

11<br />

16<br />

21<br />

26<br />

31<br />

36<br />

41<br />

46<br />

51<br />

56<br />

61<br />

66<br />

71<br />

76<br />

81<br />

86<br />

91<br />

96<br />

101<br />

-50000<br />

-100000<br />

-150000<br />

-200000<br />

noStrat<br />

reRoute<br />

reSchedule<br />

-250000<br />

-300000<br />

-350000<br />

32 23.03.2012<br />

IWW


Vehicle Routing Problem – CVRP Formal<br />

min<br />

∑<br />

∑<br />

r∈K (i, j )∈A<br />

r<br />

c ij<br />

x ij<br />

Min. costs<br />

€<br />

s.t.<br />

∑<br />

j∈N +<br />

∑<br />

r∈K<br />

∑<br />

i∈N +<br />

∑<br />

i∈N +<br />

∑<br />

i∈N +<br />

∑<br />

i∈N<br />

x r ij<br />

= y r i<br />

, i ∈ N, r ∈K,<br />

y i r =1, i ∈ N,<br />

r<br />

x ih<br />

r<br />

x 0i<br />

−<br />

r<br />

x i(n +1)<br />

∑<br />

j∈N +<br />

r<br />

x hj<br />

=1, r ∈K,<br />

q i<br />

y i r ≤ Q,<br />

=1, r ∈K,<br />

= 0, h ∈ N, r ∈K,<br />

r ∈K<br />

Every customer is served only once<br />

Tour is consistent, flow equation<br />

Capacity restriction<br />

r<br />

x ij<br />

y i<br />

r<br />

c ij<br />

Q<br />

binary, (i, € j) ∈ A, r ∈K<br />

binary, i ∈ N, r ∈K<br />

transport costs from customer i to j<br />

Vehicle − capacity<br />

q i<br />

K<br />

A<br />

N<br />

demand of customer i<br />

set of routes<br />

set of arcs<br />

set of customer<br />

€<br />

33 23.03.2012<br />

€<br />

IWW

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!