__pgr_pickDeliver¶
Name¶
_pgr_pickDeliver
- Pickup and delivery Vehicle Routing Problem
Warning
This is developers function.
- Is not officially in the current release
- Functionality currently is incomplete
- Final name currently is undecided
- Signature can and will change without notice.
- Please use pgr_gsoc_vrppdtw - Proposed for a non changing Signature between releases
- It has the underscore until final functionality and name are decided
Synopsis¶
Problem: Distribute and optimize the pickup-delivery pairs into a fleet of vehicles.
- Optimization problem is NP-hard.
- pickup and Delivery with time windows.
- All vehicles are equal.
- Same Starting location.
- Same Ending location which is the same as Starting location.
- All vehicles travel at the same speed.
- A customer is for doing a pickup or doing a deliver.
- has an open time.
- has a closing time.
- has a service time.
- has an (x, y) location.
- There is a customer where to deliver a pickup.
- travel time between customers is distance / speed
- pickup and delivery pair is done with the same vehicle.
- A pickup is done before the delivery.
Characteristics:¶
- All trucks depart at time 0.
- No multiple time windows for a location.
- Less vehicle used is considered better.
- Less total duration is better.
- Less wait time is better.
- the algorithm will raise an exception when
- If there is a pickup-deliver pair than violates time window
- The speed, max_cycles, ma_capacity have illegal values
- Six different initial will be optimized - the best solution found will be result
Signature Summary¶
_pgr_pickDeliver(customers_sql, max_vehicles, capacity)
_pgr_pickDeliver(customers_sql, max_vehicles, capacity, speed, max_cycles)
RETURNS SET OF (seq, vehicle_id, vehicle_seq, stop_id,
travel_time, arrival_time, wait_time, service_time, departure_time)
Signatures¶
Minimal signature¶
The minimal signature is for speed = 1, for a max_cycles = 30
_pgr_pickDeliver(customers_sql, max_vehicles, capacity)
RETURNS SET OF (seq, vehicle_id, vehicle_seq, stop_id,
travel_time, arrival_time, wait_time, service_time, departure_time)
Example: |
---|
This example use the following data: TODO put link
SELECT * FROM _pgr_pickDeliver(
'select * from customer order by id', 25, 200, 1, 30);
seq | vehicle_id | vehicle_seq | stop_id | travel_time | arrival_time | wait_time | service_time | departure_time
-----+------------+-------------+---------+------------------+------------------+-----------+--------------+------------------
1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0
2 | 1 | 2 | 5 | 15.1327459504216 | 15.1327459504216 | 0 | 90 | 105.132745950422
3 | 1 | 3 | 3 | 1 | 106.132745950422 | 0 | 90 | 196.132745950422
4 | 1 | 4 | 7 | 2 | 198.132745950422 | 0 | 90 | 288.132745950422
5 | 1 | 5 | 8 | 2.82842712474619 | 290.961173075168 | 0 | 90 | 380.961173075168
6 | 1 | 6 | 10 | 3.60555127546399 | 384.566724350632 | 0 | 90 | 474.566724350632
7 | 1 | 7 | 11 | 3 | 477.566724350632 | 0 | 90 | 567.566724350632
8 | 1 | 8 | 9 | 3.16227766016838 | 570.7290020108 | 0 | 90 | 660.7290020108
9 | 1 | 9 | 6 | 2.23606797749979 | 662.9650699883 | 0 | 90 | 752.9650699883
10 | 1 | 10 | 4 | 2.23606797749979 | 755.2011379658 | 0 | 90 | 845.2011379658
11 | 1 | 11 | 2 | 3.60555127546399 | 848.806689241264 | 0 | 90 | 938.806689241264
12 | 1 | 12 | 1 | 2 | 940.806689241264 | 0 | 90 | 1030.80668924126
13 | 1 | 13 | 75 | 3 | 1033.80668924126 | 0 | 90 | 1123.80668924126
14 | 1 | 14 | 0 | 15.8113883008419 | 1139.61807754211 | 0 | 0 | 1139.61807754211
15 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0
16 | 2 | 2 | 13 | 30.8058436014987 | 30.8058436014987 | 0 | 90 | 120.805843601499
17 | 2 | 3 | 17 | 4 | 124.805843601499 | 0 | 90 | 214.805843601499
18 | 2 | 4 | 18 | 3 | 217.805843601499 | 0 | 90 | 307.805843601499
19 | 2 | 5 | 19 | 5 | 312.805843601499 | 0 | 90 | 402.805843601499
20 | 2 | 6 | 15 | 5 | 407.805843601499 | 0 | 90 | 497.805843601499
21 | 2 | 7 | 16 | 5 | 502.805843601499 | 0 | 90 | 592.805843601499
22 | 2 | 8 | 14 | 2 | 594.805843601499 | 0 | 90 | 684.805843601499
23 | 2 | 9 | 12 | 3 | 687.805843601499 | 0 | 90 | 777.805843601499
24 | 2 | 10 | 0 | 38.0788655293195 | 815.884709130818 | 0 | 0 | 815.884709130818
25 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0
26 | 3 | 2 | 20 | 10 | 10 | 0 | 90 | 100
27 | 3 | 3 | 24 | 5 | 105 | 0 | 90 | 195
28 | 3 | 4 | 25 | 2 | 197 | 0 | 90 | 287
29 | 3 | 5 | 27 | 2 | 289 | 0 | 90 | 379
30 | 3 | 6 | 29 | 3.60555127546399 | 382.605551275464 | 0 | 90 | 472.605551275464
31 | 3 | 7 | 30 | 5 | 477.605551275464 | 0 | 90 | 567.605551275464
32 | 3 | 8 | 28 | 3 | 570.605551275464 | 0 | 90 | 660.605551275464
33 | 3 | 9 | 26 | 2 | 662.605551275464 | 0 | 90 | 752.605551275464
34 | 3 | 10 | 23 | 3 | 755.605551275464 | 0 | 0 | 755.605551275464
35 | 3 | 11 | 103 | 0 | 755.605551275464 | 0 | 90 | 845.605551275464
36 | 3 | 12 | 22 | 3 | 848.605551275464 | 0 | 90 | 938.605551275464
37 | 3 | 13 | 21 | 2 | 940.605551275464 | 0 | 90 | 1030.60555127546
38 | 3 | 14 | 0 | 10.1980390271856 | 1040.80359030265 | 0 | 0 | 1040.80359030265
39 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0
40 | 4 | 2 | 32 | 31.6227766016838 | 31.6227766016838 | 0 | 90 | 121.622776601684
41 | 4 | 3 | 33 | 2 | 123.622776601684 | 0 | 90 | 213.622776601684
42 | 4 | 4 | 31 | 5.3851648071345 | 219.007941408818 | 0 | 90 | 309.007941408818
43 | 4 | 5 | 35 | 5 | 314.007941408818 | 0 | 90 | 404.007941408818
44 | 4 | 6 | 37 | 5.8309518948453 | 409.838893303664 | 0 | 90 | 499.838893303664
45 | 4 | 7 | 38 | 2 | 501.838893303664 | 0 | 90 | 591.838893303664
46 | 4 | 8 | 39 | 5 | 596.838893303664 | 0 | 90 | 686.838893303664
47 | 4 | 9 | 36 | 5 | 691.838893303664 | 0 | 0 | 691.838893303664
48 | 4 | 10 | 105 | 0 | 691.838893303664 | 0 | 90 | 781.838893303664
49 | 4 | 11 | 34 | 3 | 784.838893303664 | 0 | 90 | 874.838893303664
50 | 4 | 12 | 0 | 32.3882694814033 | 907.227162785067 | 0 | 0 | 907.227162785067
51 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0
52 | 5 | 2 | 43 | 16.5529453572468 | 16.5529453572468 | 0 | 90 | 106.552945357247
53 | 5 | 3 | 42 | 3 | 109.552945357247 | 0 | 90 | 199.552945357247
54 | 5 | 4 | 41 | 2 | 201.552945357247 | 0 | 90 | 291.552945357247
55 | 5 | 5 | 40 | 2 | 293.552945357247 | 0 | 90 | 383.552945357247
56 | 5 | 6 | 44 | 3 | 386.552945357247 | 0 | 90 | 476.552945357247
57 | 5 | 7 | 46 | 2.82842712474619 | 479.381372481993 | 0 | 90 | 569.381372481993
58 | 5 | 8 | 45 | 2 | 571.381372481993 | 0 | 90 | 661.381372481993
59 | 5 | 9 | 48 | 2 | 663.381372481993 | 0 | 90 | 753.381372481993
60 | 5 | 10 | 51 | 3 | 756.381372481993 | 0 | 0 | 756.381372481993
61 | 5 | 11 | 101 | 0 | 756.381372481993 | 0 | 90 | 846.381372481993
62 | 5 | 12 | 50 | 2.23606797749979 | 848.617440459493 | 0 | 90 | 938.617440459493
63 | 5 | 13 | 52 | 3.16227766016838 | 941.779718119661 | 0 | 90 | 1031.77971811966
64 | 5 | 14 | 49 | 3 | 1034.77971811966 | 0 | 90 | 1124.77971811966
65 | 5 | 15 | 47 | 2 | 1126.77971811966 | 0 | 90 | 1216.77971811966
66 | 5 | 16 | 0 | 18.0277563773199 | 1234.80747449698 | 0 | 0 | 1234.80747449698
67 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0
68 | 6 | 2 | 57 | 35 | 35 | 0 | 90 | 125
69 | 6 | 3 | 55 | 2 | 127 | 0 | 90 | 217
70 | 6 | 4 | 54 | 5 | 222 | 0 | 90 | 312
71 | 6 | 5 | 53 | 5.3851648071345 | 317.385164807135 | 0 | 90 | 407.385164807135
72 | 6 | 6 | 56 | 4 | 411.385164807135 | 0 | 90 | 501.385164807135
73 | 6 | 7 | 58 | 2 | 503.385164807135 | 0 | 90 | 593.385164807135
74 | 6 | 8 | 60 | 3 | 596.385164807135 | 0 | 90 | 686.385164807135
75 | 6 | 9 | 59 | 10.4403065089106 | 696.825471316045 | 0 | 90 | 786.825471316045
76 | 6 | 10 | 0 | 35.0570962859162 | 821.882567601961 | 0 | 0 | 821.882567601961
77 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0
78 | 7 | 2 | 67 | 12.2065556157337 | 12.2065556157337 | 0 | 90 | 102.206555615734
79 | 7 | 3 | 65 | 1 | 103.206555615734 | 0 | 90 | 193.206555615734
80 | 7 | 4 | 63 | 2 | 195.206555615734 | 0 | 90 | 285.206555615734
81 | 7 | 5 | 62 | 5 | 290.206555615734 | 0 | 90 | 380.206555615734
82 | 7 | 6 | 74 | 3 | 383.206555615734 | 0 | 90 | 473.206555615734
83 | 7 | 7 | 72 | 5 | 478.206555615734 | 0 | 90 | 568.206555615734
84 | 7 | 8 | 61 | 3 | 571.206555615734 | 0 | 90 | 661.206555615734
85 | 7 | 9 | 64 | 2 | 663.206555615734 | 0 | 0 | 663.206555615734
86 | 7 | 10 | 102 | 0 | 663.206555615734 | 0 | 90 | 753.206555615734
87 | 7 | 11 | 68 | 3 | 756.206555615734 | 0 | 90 | 846.206555615734
88 | 7 | 12 | 66 | 5.3851648071345 | 851.591720422868 | 0 | 90 | 941.591720422868
89 | 7 | 13 | 69 | 2 | 943.591720422868 | 0 | 90 | 1033.59172042287
90 | 7 | 14 | 0 | 15.8113883008419 | 1049.40310872371 | 0 | 0 | 1049.40310872371
91 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0
92 | 8 | 2 | 81 | 47.4341649025257 | 47.4341649025257 | 0 | 90 | 137.434164902526
93 | 8 | 3 | 78 | 3 | 140.434164902526 | 0 | 0 | 140.434164902526
94 | 8 | 4 | 104 | 0 | 140.434164902526 | 0 | 90 | 230.434164902526
95 | 8 | 5 | 76 | 2 | 232.434164902526 | 0 | 90 | 322.434164902526
96 | 8 | 6 | 71 | 5 | 327.434164902526 | 0 | 90 | 417.434164902526
97 | 8 | 7 | 70 | 5 | 422.434164902526 | 0 | 90 | 512.434164902526
98 | 8 | 8 | 73 | 3 | 515.434164902526 | 0 | 90 | 605.434164902526
99 | 8 | 9 | 77 | 4 | 609.434164902526 | 0 | 90 | 699.434164902526
100 | 8 | 10 | 79 | 1 | 700.434164902526 | 0 | 90 | 790.434164902526
101 | 8 | 11 | 80 | 5.3851648071345 | 795.81932970966 | 0 | 90 | 885.81932970966
102 | 8 | 12 | 0 | 51.478150704935 | 937.297480414595 | 0 | 0 | 937.297480414595
103 | 9 | 1 | 0 | 0 | 0 | 0 | 0 | 0
104 | 9 | 2 | 90 | 20.6155281280883 | 20.6155281280883 | 0 | 90 | 110.615528128088
105 | 9 | 3 | 87 | 5 | 115.615528128088 | 0 | 90 | 205.615528128088
106 | 9 | 4 | 86 | 1 | 206.615528128088 | 0 | 90 | 296.615528128088
107 | 9 | 5 | 83 | 6 | 302.615528128088 | 0 | 90 | 392.615528128088
108 | 9 | 6 | 82 | 3 | 395.615528128088 | 0 | 90 | 485.615528128088
109 | 9 | 7 | 84 | 5.8309518948453 | 491.446480022934 | 0 | 90 | 581.446480022934
110 | 9 | 8 | 85 | 2.82842712474619 | 584.27490714768 | 0 | 90 | 674.27490714768
111 | 9 | 9 | 88 | 3 | 677.27490714768 | 0 | 90 | 767.27490714768
112 | 9 | 10 | 89 | 2.82842712474619 | 770.103334272426 | 0 | 90 | 860.103334272426
113 | 9 | 11 | 91 | 3.60555127546399 | 863.70888554789 | 0 | 90 | 953.70888554789
114 | 9 | 12 | 0 | 22.3606797749979 | 976.069565322888 | 0 | 0 | 976.069565322888
115 | -1 | 0 | 0 | 732.993736320776 | 0 | 0 | 8190 | 8922.99373632078
(115 rows)
Complete signature¶
This signature performs the optimization based on the optional parameters
_pgr_pickDeliver(customers_sql, max_vehicles, capacity, speed, max_cycles)
RETURNS SET OF (seq, vehicle_id, vehicle_seq, stop_id,
travel_time, arrival_time, wait_time, service_time, departure_time)
Example: |
---|
This example use the following data: TODO put link
SELECT * FROM _pgr_pickDeliver(
'select * from customer order by id', 25, 200, 10, 30);
seq | vehicle_id | vehicle_seq | stop_id | travel_time | arrival_time | wait_time | service_time | departure_time
-----+------------+-------------+---------+-------------------+------------------+-------------------+--------------+------------------
1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0
2 | 1 | 2 | 5 | 1.51327459504216 | 1.51327459504216 | 13.4867254049578 | 90 | 105
3 | 1 | 3 | 3 | 0.1 | 105.1 | 0 | 90 | 195.1
4 | 1 | 4 | 7 | 0.2 | 195.3 | 0 | 90 | 285.3
5 | 1 | 5 | 8 | 0.282842712474619 | 285.582842712475 | 0 | 90 | 375.582842712475
6 | 1 | 6 | 10 | 0.360555127546399 | 375.943397840021 | 0 | 90 | 465.943397840021
7 | 1 | 7 | 11 | 0.3 | 466.243397840021 | 0 | 90 | 556.243397840021
8 | 1 | 8 | 9 | 0.316227766016838 | 556.559625606038 | 0 | 90 | 646.559625606038
9 | 1 | 9 | 6 | 0.223606797749979 | 646.783232403788 | 0 | 90 | 736.783232403788
10 | 1 | 10 | 4 | 0.223606797749979 | 737.006839201538 | 0 | 90 | 827.006839201538
11 | 1 | 11 | 2 | 0.360555127546399 | 827.367394329084 | 0 | 90 | 917.367394329084
12 | 1 | 12 | 1 | 0.2 | 917.567394329084 | 0 | 90 | 1007.56739432908
13 | 1 | 13 | 75 | 0.3 | 1007.86739432908 | 0 | 90 | 1097.86739432908
14 | 1 | 14 | 0 | 1.58113883008419 | 1099.44853315917 | 0 | 0 | 1099.44853315917
15 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0
16 | 2 | 2 | 13 | 3.08058436014987 | 3.08058436014987 | 26.9194156398501 | 90 | 120
17 | 2 | 3 | 17 | 0.4 | 120.4 | 0 | 90 | 210.4
18 | 2 | 4 | 18 | 0.3 | 210.7 | 0 | 90 | 300.7
19 | 2 | 5 | 19 | 0.5 | 301.2 | 0 | 90 | 391.2
20 | 2 | 6 | 15 | 0.5 | 391.7 | 0 | 90 | 481.7
21 | 2 | 7 | 16 | 0.5 | 482.2 | 0 | 90 | 572.2
22 | 2 | 8 | 14 | 0.2 | 572.4 | 0 | 90 | 662.4
23 | 2 | 9 | 12 | 0.3 | 662.7 | 0 | 90 | 752.7
24 | 2 | 10 | 0 | 3.80788655293195 | 756.507886552932 | 0 | 0 | 756.507886552932
25 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0
26 | 3 | 2 | 20 | 1 | 1 | 9 | 90 | 100
27 | 3 | 3 | 24 | 0.5 | 100.5 | 0 | 90 | 190.5
28 | 3 | 4 | 25 | 0.2 | 190.7 | 0 | 90 | 280.7
29 | 3 | 5 | 27 | 0.2 | 280.9 | 0 | 90 | 370.9
30 | 3 | 6 | 29 | 0.360555127546399 | 371.260555127546 | 0 | 90 | 461.260555127546
31 | 3 | 7 | 30 | 0.5 | 461.760555127546 | 0 | 90 | 551.760555127546
32 | 3 | 8 | 28 | 0.3 | 552.060555127546 | 0 | 90 | 642.060555127546
33 | 3 | 9 | 26 | 0.2 | 642.260555127546 | 0 | 90 | 732.260555127546
34 | 3 | 10 | 23 | 0.3 | 732.560555127546 | 0 | 0 | 732.560555127546
35 | 3 | 11 | 103 | 0 | 732.560555127546 | 0 | 90 | 822.560555127546
36 | 3 | 12 | 22 | 0.3 | 822.860555127546 | 0 | 90 | 912.860555127546
37 | 3 | 13 | 21 | 0.2 | 913.060555127546 | 0.939444872453691 | 90 | 1004
38 | 3 | 14 | 0 | 1.01980390271856 | 1005.01980390272 | 0 | 0 | 1005.01980390272
39 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0
40 | 4 | 2 | 32 | 3.16227766016838 | 3.16227766016838 | 27.8377223398316 | 90 | 121
41 | 4 | 3 | 33 | 0.2 | 121.2 | 0 | 90 | 211.2
42 | 4 | 4 | 31 | 0.53851648071345 | 211.738516480713 | 0 | 90 | 301.738516480713
43 | 4 | 5 | 35 | 0.5 | 302.238516480713 | 0 | 90 | 392.238516480713
44 | 4 | 6 | 37 | 0.58309518948453 | 392.821611670198 | 0 | 90 | 482.821611670198
45 | 4 | 7 | 38 | 0.2 | 483.021611670198 | 0 | 90 | 573.021611670198
46 | 4 | 8 | 39 | 0.5 | 573.521611670198 | 0 | 90 | 663.521611670198
47 | 4 | 9 | 36 | 0.5 | 664.021611670198 | 0.978388329802101 | 0 | 665
48 | 4 | 10 | 105 | 0 | 665 | 0 | 90 | 755
49 | 4 | 11 | 34 | 0.3 | 755.3 | 0 | 90 | 845.3
50 | 4 | 12 | 0 | 3.23882694814033 | 848.53882694814 | 0 | 0 | 848.53882694814
51 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0
52 | 5 | 2 | 43 | 1.65529453572468 | 1.65529453572468 | 14.3447054642753 | 90 | 106
53 | 5 | 3 | 42 | 0.3 | 106.3 | 0 | 90 | 196.3
54 | 5 | 4 | 41 | 0.2 | 196.5 | 0 | 90 | 286.5
55 | 5 | 5 | 40 | 0.2 | 286.7 | 0 | 90 | 376.7
56 | 5 | 6 | 44 | 0.3 | 377 | 0 | 90 | 467
57 | 5 | 7 | 46 | 0.282842712474619 | 467.282842712475 | 0 | 90 | 557.282842712475
58 | 5 | 8 | 45 | 0.2 | 557.482842712475 | 0 | 90 | 647.482842712475
59 | 5 | 9 | 48 | 0.2 | 647.682842712475 | 0 | 90 | 737.682842712475
60 | 5 | 10 | 51 | 0.3 | 737.982842712475 | 0 | 0 | 737.982842712475
61 | 5 | 11 | 101 | 0 | 737.982842712475 | 0 | 90 | 827.982842712475
62 | 5 | 12 | 50 | 0.223606797749979 | 828.206449510225 | 0 | 90 | 918.206449510225
63 | 5 | 13 | 52 | 0.316227766016838 | 918.522677276241 | 0 | 90 | 1008.52267727624
64 | 5 | 14 | 49 | 0.3 | 1008.82267727624 | 0 | 90 | 1098.82267727624
65 | 5 | 15 | 47 | 0.2 | 1099.02267727624 | 0 | 90 | 1189.02267727624
66 | 5 | 16 | 0 | 1.80277563773199 | 1190.82545291397 | 0 | 0 | 1190.82545291397
67 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0
68 | 6 | 2 | 57 | 3.5 | 3.5 | 31.5 | 90 | 125
69 | 6 | 3 | 55 | 0.2 | 125.2 | 0 | 90 | 215.2
70 | 6 | 4 | 54 | 0.5 | 215.7 | 0 | 90 | 305.7
71 | 6 | 5 | 53 | 0.53851648071345 | 306.238516480713 | 0 | 90 | 396.238516480713
72 | 6 | 6 | 56 | 0.4 | 396.638516480713 | 0 | 90 | 486.638516480713
73 | 6 | 7 | 58 | 0.2 | 486.838516480713 | 0 | 90 | 576.838516480713
74 | 6 | 8 | 60 | 0.3 | 577.138516480713 | 0 | 90 | 667.138516480713
75 | 6 | 9 | 59 | 1.04403065089106 | 668.182547131604 | 0 | 90 | 758.182547131604
76 | 6 | 10 | 0 | 3.50570962859162 | 761.688256760196 | 0 | 0 | 761.688256760196
77 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0
78 | 7 | 2 | 67 | 1.22065556157337 | 1.22065556157337 | 10.7793444384266 | 90 | 102
79 | 7 | 3 | 65 | 0.1 | 102.1 | 0 | 90 | 192.1
80 | 7 | 4 | 63 | 0.2 | 192.3 | 0 | 90 | 282.3
81 | 7 | 5 | 62 | 0.5 | 282.8 | 0 | 90 | 372.8
82 | 7 | 6 | 74 | 0.3 | 373.1 | 0 | 90 | 463.1
83 | 7 | 7 | 72 | 0.5 | 463.6 | 0 | 90 | 553.6
84 | 7 | 8 | 61 | 0.3 | 553.9 | 0 | 90 | 643.9
85 | 7 | 9 | 64 | 0.2 | 644.1 | 0 | 0 | 644.1
86 | 7 | 10 | 102 | 0 | 644.1 | 0 | 90 | 734.1
87 | 7 | 11 | 68 | 0.3 | 734.4 | 0 | 90 | 824.4
88 | 7 | 12 | 66 | 0.53851648071345 | 824.938516480713 | 1.06148351928664 | 90 | 916
89 | 7 | 13 | 69 | 0.2 | 916.2 | 0 | 90 | 1006.2
90 | 7 | 14 | 0 | 1.58113883008419 | 1007.78113883008 | 0 | 0 | 1007.78113883008
91 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0
92 | 8 | 2 | 81 | 4.74341649025257 | 4.74341649025257 | 42.2565835097474 | 90 | 137
93 | 8 | 3 | 78 | 0.3 | 137.3 | 0 | 0 | 137.3
94 | 8 | 4 | 104 | 0 | 137.3 | 0 | 90 | 227.3
95 | 8 | 5 | 76 | 0.2 | 227.5 | 0 | 90 | 317.5
96 | 8 | 6 | 71 | 0.5 | 318 | 0 | 90 | 408
97 | 8 | 7 | 70 | 0.5 | 408.5 | 0 | 90 | 498.5
98 | 8 | 8 | 73 | 0.3 | 498.8 | 0 | 90 | 588.8
99 | 8 | 9 | 77 | 0.4 | 589.2 | 0 | 90 | 679.2
100 | 8 | 10 | 79 | 0.1 | 679.3 | 0 | 90 | 769.3
101 | 8 | 11 | 80 | 0.53851648071345 | 769.838516480713 | 0 | 90 | 859.838516480713
102 | 8 | 12 | 0 | 5.1478150704935 | 864.986331551207 | 0 | 0 | 864.986331551207
103 | 9 | 1 | 0 | 0 | 0 | 0 | 0 | 0
104 | 9 | 2 | 90 | 2.06155281280883 | 2.06155281280883 | 17.9384471871912 | 90 | 110
105 | 9 | 3 | 87 | 0.5 | 110.5 | 0 | 90 | 200.5
106 | 9 | 4 | 86 | 0.1 | 200.6 | 0 | 90 | 290.6
107 | 9 | 5 | 83 | 0.6 | 291.2 | 0 | 90 | 381.2
108 | 9 | 6 | 82 | 0.3 | 381.5 | 0 | 90 | 471.5
109 | 9 | 7 | 84 | 0.58309518948453 | 472.083095189485 | 0 | 90 | 562.083095189485
110 | 9 | 8 | 85 | 0.282842712474619 | 562.365937901959 | 0 | 90 | 652.365937901959
111 | 9 | 9 | 88 | 0.3 | 652.665937901959 | 0 | 90 | 742.665937901959
112 | 9 | 10 | 89 | 0.282842712474619 | 742.948780614434 | 0 | 90 | 832.948780614434
113 | 9 | 11 | 91 | 0.360555127546399 | 833.30933574198 | 2.69066425801998 | 90 | 926
114 | 9 | 12 | 0 | 2.23606797749979 | 928.2360679775 | 0 | 0 | 928.2360679775
115 | -1 | 0 | 0 | 73.2993736320776 | 0 | 199.732924963843 | 8190 | 8463.03229859592
(115 rows)
Description of the Signatures¶
Description of the customers_sql query¶
Column | Type | Description |
---|---|---|
id | ANY-INTEGER |
Identifier of the customer.
|
x | ANY-NUMERICAL |
X coordinate of the location. |
y | ANY-NUMERICAL |
Y coordinate of the location. |
demand | ANY-NUMERICAL |
How much is added / removed from the vehicle.
|
openTime | ANY-NUMERICAL |
The time relative to 0, when the customer opens. |
closeTime | ANY-NUMERICAL |
The time relative to 0, when the customer closes. |
serviceTime | ANY-NUMERICAL |
The duration of the loading / unloading. |
pickup_id | ANY-INTEGER |
Value used when the current customer is a Delivery to find the corresponding Pickup |
deliver_id | ANY-INTEGER |
Value used when the current customer is a Pickup to find the corresponding Delivery |
Where:
ANY-INTEGER: | SMALLINT, INTEGER, BIGINT |
---|---|
ANY-NUMERICAL: | SMALLINT, INTEGER, BIGINT, REAL, FLOAT |
Description of the parameters of the signatures¶
Column | Type | Default | Description |
---|---|---|---|
customers_sql | TEXT |
SQL query as described above. | |
max_vehicles | INTEGER |
Maximum number of vehicles in the result. (currently is ignored) | |
capacity | FLOAT |
Capacity of the vehicle. | |
speed | FLOAT |
1 | Speed of the vehicle. |
max_cycles | INTEGER |
30 | A multiplier for internal cycles (currently is ignored) |
Description of the result¶
RETURNS SET OF: | (seq, vehicle_id, vehicle_seq, stop_id, travel_time, arrival_time, wait_time, service_time, departure_time) |
---|
Column | Type | Description |
---|---|---|
seq | INTEGER | Sequential value starting from 1. |
vehicle_id | INTEGER | Current vehicle identifier. |
vehicle_seq | INTEGER | Sequential value starting from 1 for the current vehicle. |
stop_id | BIGINT | Visited customer identifier. |
travel_time | FLOAT | Travel time from previous stop_id to current stop_id . |
arrival_time | FLOAT | Previous departure_time plus current travel_time . |
wait_time | FLOAT | Time spent waiting for stop_id to open. |
service_time | FLOAT | Service time at current stop_id. |
departure_time | FLOAT |
|