Skip to content

Commit 2624a4b

Browse files
committed
MIO update
1 parent a5102a4 commit 2624a4b

7 files changed

Lines changed: 246 additions & 549 deletions

File tree

‎Samples/REST Services/MIO/mio.html‎

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@
7979
map.imageSprite.add('home-icon', '/images/icons/home.png');
8080
map.imageSprite.add('depot-icon', '/images/icons/factory.png');
8181

82+
// Add controls
83+
map.controls.add(
84+
[
85+
new atlas.control.ZoomControl(),
86+
new atlas.control.PitchControl(),
87+
new atlas.control.CompassControl(),
88+
new atlas.control.StyleControl({
89+
mapStyles: "all"
90+
})
91+
],
92+
{
93+
position: "top-right"
94+
}
95+
);
96+
8297
// Download stop and depot location GeoJSON data.
8398
Promise.all([
8499
fetch('/data/geojson/mio_stops.json').then(response => response.json()),
@@ -398,24 +413,27 @@
398413

399414
<fieldset style="width:calc(100% - 30px);min-width:290px;margin-top:10px;">
400415
<legend>Multi-Itinerary Optimization</legend>
401-
This example demonstrates the process of optimizing multiple itineraries using Azure Maps in conjunction with
402-
<a href="https://www.nvidia.com/en-us/ai-data-science/products/cuopt/" target="_blank">NVIDIA's cuOpt</a> optimizer service.
416+
This example demonstrates the process of optimizing multiple itineraries using
417+
<a href="https://azuremaps.com/" target="_blank">Azure Maps</a> in conjunction with
418+
<a href="https://www.nvidia.com/en-us/ai-data-science/products/cuopt/" target="_blank">NVIDIA cuOpt</a>.
419+
<br />
420+
The scenario outlined includes 24 delivery points, 4 transport units, with each of the 2 storage hubs providing 2 vehicles.
403421
<br />
404-
The scenario outlined includes 8 delivery points, 4 transport units, with each of the 2 storage hubs providing 2 vehicles.
422+
<img src="/rest-services/mio/process.png" style="width:100%;" />
405423
</fieldset>
406424

407425
<div class="container">
408426
<div style="width: 33%;">
409-
<h3>8 delivery points [stops]</h3>
410-
<textarea id="textArea1"></textarea>
427+
<h3>24 delivery points [stops]</h3>
428+
<textarea id="textArea1" readonly="readonly"></textarea>
411429
</div>
412430
<div style="width: 33%;">
413431
<h3>2 storage hubs [depots]</h3>
414-
<textarea id="textArea2"></textarea>
432+
<textarea id="textArea2" readonly="readonly"></textarea>
415433
</div>
416434
<div style="width: 33%;">
417435
<h3>4 transport units [vehicles]</h3>
418-
<textarea id="textArea3"></textarea>
436+
<textarea id="textArea3" readonly="readonly"></textarea>
419437
</div>
420438
</div>
421439

80.5 KB
Loading

‎Services/SampleFunctions/Optimizer.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "post
2121
// You can replace this with your own data
2222
// The data should be in the same format as the response from the solver
2323
// More details: https://docs.nvidia.com/cuopt/user-guide/supported-features.html
24-
return new OkObjectResult("{\"reqId\":\"b3f34ef7-e037-402d-837e-2e97c48ebf74\",\"status\":\"fulfilled\",\"percentComplete\":100,\"response\":{\"response\":{\"solver_response\":{\"status\":0,\"num_vehicles\":4,\"solution_cost\":41830,\"vehicle_data\":{\"Car A\":{\"task_id\":[\"Depot\",\"Break\",\"0\",\"5\",\"Depot\"],\"arrival_stamp\":[28800,43200,43596,44172,44965],\"route\":[0,0,2,7,0],\"type\":[\"Depot\",\"Break\",\"Delivery\",\"Delivery\",\"Depot\"]},\"Car B\":{\"task_id\":[\"Depot\",\"Break\",\"6\",\"7\",\"Depot\"],\"arrival_stamp\":[28800,43200,43838,43987,44527],\"route\":[0,0,8,9,0],\"type\":[\"Depot\",\"Break\",\"Delivery\",\"Delivery\",\"Depot\"]},\"Car C\":{\"task_id\":[\"Depot\",\"3\",\"Break\",\"1\",\"Depot\"],\"arrival_stamp\":[28800,28954,43200,43540,43857],\"route\":[1,5,5,3,1],\"type\":[\"Depot\",\"Delivery\",\"Break\",\"Delivery\",\"Depot\"]},\"Car D\":{\"task_id\":[\"Depot\",\"Break\",\"4\",\"2\",\"Depot\"],\"arrival_stamp\":[28800,43200,43200,43480,43863],\"route\":[1,6,6,4,1],\"type\":[\"Depot\",\"Break\",\"Delivery\",\"Delivery\",\"Depot\"]}},\"dropped_tasks\":{\"task_id\":[],\"task_index\":[]},\"msg\":\"\"},\"perf_times\":null},\"warnings\":[],\"notes\":[]}}");
24+
return new OkObjectResult("{\"reqId\":\"3b24d203-1275-4284-8620-b3679f059e4a\",\"status\":\"fulfilled\",\"percentComplete\":100,\"response\":{\"response\":{\"solver_response\":{\"status\":0,\"num_vehicles\":4,\"solution_cost\":93236,\"vehicle_data\":{\"Car A\":{\"task_id\":[\"Depot\",\"Break\",\"0\",\"15\",\"1\",\"22\",\"12\",\"Depot\"],\"arrival_stamp\":[28800,43200,43548,43990,44269,44333,44493,44698],\"route\":[0,0,2,17,3,24,14,0],\"type\":[\"Depot\",\"Break\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Depot\"]},\"Car B\":{\"task_id\":[\"Depot\",\"Break\",\"20\",\"14\",\"7\",\"6\",\"10\",\"11\",\"23\",\"Depot\"],\"arrival_stamp\":[28800,43200,43567,44253,44800,44911,45195,45563,45938,46350],\"route\":[0,0,22,16,9,8,12,13,25,0],\"type\":[\"Depot\",\"Break\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Depot\"]},\"Car C\":{\"task_id\":[\"Depot\",\"Break\",\"9\",\"18\",\"19\",\"16\",\"13\",\"17\",\"8\",\"5\",\"21\",\"Depot\"],\"arrival_stamp\":[28800,43200,43526,43649,44107,44449,44608,45160,45561,45970,46609,46902],\"route\":[1,1,11,20,21,18,15,19,10,7,23,1],\"type\":[\"Depot\",\"Break\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Delivery\",\"Depot\"]},\"Car D\":{\"task_id\":[\"Depot\",\"Break\",\"3\",\"4\",\"2\",\"Depot\"],\"arrival_stamp\":[28800,43200,43328,43609,43859,44192],\"route\":[1,1,5,6,4,1],\"type\":[\"Depot\",\"Break\",\"Delivery\",\"Delivery\",\"Delivery\",\"Depot\"]}},\"dropped_tasks\":{\"task_id\":[],\"task_index\":[]},\"msg\":\"\"},\"perf_times\":null},\"warnings\":[],\"notes\":[]}}");
2525
}
2626

2727
// Retrun access denied if the referer domain is not allowed

‎Static/data/geojson/mio_stops.json‎

Lines changed: 216 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"coordinates": [ -105.0783007, 40.5601487 ]
1010
},
1111
"properties": {
12-
"demand": 30,
12+
"demand": 3,
1313
"service_time": 0,
1414
"opening_hours": [ 8, 17 ]
1515
}
@@ -22,7 +22,7 @@
2222
"coordinates": [ -105.0573299, 40.5628491 ]
2323
},
2424
"properties": {
25-
"demand": 40,
25+
"demand": 4,
2626
"service_time": 0,
2727
"opening_hours": [ 8, 17 ]
2828
}
@@ -35,7 +35,7 @@
3535
"coordinates": [ -105.0351322, 40.5679378 ]
3636
},
3737
"properties": {
38-
"demand": 40,
38+
"demand": 4,
3939
"service_time": 0,
4040
"opening_hours": [ 8, 17 ]
4141
}
@@ -48,7 +48,7 @@
4848
"coordinates": [ -105.0332723, 40.550293 ]
4949
},
5050
"properties": {
51-
"demand": 30,
51+
"demand": 3,
5252
"service_time": 0,
5353
"opening_hours": [ 8, 17 ]
5454
}
@@ -61,7 +61,7 @@
6161
"coordinates": [ -105.0306531, 40.5638493 ]
6262
},
6363
"properties": {
64-
"demand": 30,
64+
"demand": 3,
6565
"service_time": 0,
6666
"opening_hours": [ 8, 17 ]
6767
}
@@ -74,7 +74,7 @@
7474
"coordinates": [ -105.1001173, 40.5472442 ]
7575
},
7676
"properties": {
77-
"demand": 40,
77+
"demand": 4,
7878
"service_time": 0,
7979
"opening_hours": [ 8, 17 ]
8080
}
@@ -87,7 +87,7 @@
8787
"coordinates": [ -105.1212113, 40.5867356 ]
8888
},
8989
"properties": {
90-
"demand": 40,
90+
"demand": 4,
9191
"service_time": 0,
9292
"opening_hours": [ 8, 17 ]
9393
}
@@ -100,7 +100,215 @@
100100
"coordinates": [ -105.1245675, 40.5897754 ]
101101
},
102102
"properties": {
103-
"demand": 30,
103+
"demand": 3,
104+
"service_time": 0,
105+
"opening_hours": [ 8, 17 ]
106+
}
107+
},
108+
{
109+
"type": "Feature",
110+
"id": 8,
111+
"geometry": {
112+
"type": "Point",
113+
"coordinates": [ -105.1046965, 40.5276185 ]
114+
},
115+
"properties": {
116+
"demand": 1,
117+
"service_time": 0,
118+
"opening_hours": [ 8, 17 ]
119+
}
120+
},
121+
{
122+
"type": "Feature",
123+
"id": 9,
124+
"geometry": {
125+
"type": "Point",
126+
"coordinates": [ -105.0238679, 40.5185113 ]
127+
},
128+
"properties": {
129+
"demand": 1,
130+
"service_time": 0,
131+
"opening_hours": [ 8, 17 ]
132+
}
133+
},
134+
{
135+
"type": "Feature",
136+
"id": 10,
137+
"geometry": {
138+
"type": "Point",
139+
"coordinates": [ -105.11177529999998, 40.57828689999999 ]
140+
},
141+
"properties": {
142+
"demand": 1,
143+
"service_time": 0,
144+
"opening_hours": [ 8, 17 ]
145+
}
146+
},
147+
{
148+
"type": "Feature",
149+
"id": 11,
150+
"geometry": {
151+
"type": "Point",
152+
"coordinates": [ -105.1061185, 40.5994244 ]
153+
},
154+
"properties": {
155+
"demand": 1,
156+
"service_time": 0,
157+
"opening_hours": [ 8, 17 ]
158+
}
159+
},
160+
{
161+
"type": "Feature",
162+
"id": 12,
163+
"geometry": {
164+
"type": "Point",
165+
"coordinates": [ -105.0659091, 40.5681418 ]
166+
},
167+
"properties": {
168+
"demand": 1,
169+
"service_time": 0,
170+
"opening_hours": [ 8, 17 ]
171+
}
172+
},
173+
{
174+
"type": "Feature",
175+
"id": 13,
176+
"geometry": {
177+
"type": "Point",
178+
"coordinates": [ -105.02168879999999, 40.5042999 ]
179+
},
180+
"properties": {
181+
"demand": 1,
182+
"service_time": 0,
183+
"opening_hours": [ 8, 17 ]
184+
}
185+
},
186+
{
187+
"type": "Feature",
188+
"id": 14,
189+
"geometry": {
190+
"type": "Point",
191+
"coordinates": [ -105.1436876, 40.6269554 ]
192+
},
193+
"properties": {
194+
"demand": 1,
195+
"service_time": 0,
196+
"opening_hours": [ 8, 17 ]
197+
}
198+
},
199+
{
200+
"type": "Feature",
201+
"id": 15,
202+
"geometry": {
203+
"type": "Point",
204+
"coordinates": [ -105.0627723, 40.5425555 ]
205+
},
206+
"properties": {
207+
"demand": 1,
208+
"service_time": 0,
209+
"opening_hours": [ 8, 17 ]
210+
}
211+
},
212+
{
213+
"type": "Feature",
214+
"id": 16,
215+
"geometry": {
216+
"type": "Point",
217+
"coordinates": [ -105.007176, 40.5081922 ]
218+
},
219+
"properties": {
220+
"demand": 1,
221+
"service_time": 0,
222+
"opening_hours": [ 8, 17 ]
223+
}
224+
},
225+
{
226+
"type": "Feature",
227+
"id": 17,
228+
"geometry": {
229+
"type": "Point",
230+
"coordinates": [ -105.06645300000002, 40.5127219 ]
231+
},
232+
"properties": {
233+
"demand": 1,
234+
"service_time": 0,
235+
"opening_hours": [ 8, 17 ]
236+
}
237+
},
238+
{
239+
"type": "Feature",
240+
"id": 18,
241+
"geometry": {
242+
"type": "Point",
243+
"coordinates": [ -105.026599, 40.5187669 ]
244+
},
245+
"properties": {
246+
"demand": 1,
247+
"service_time": 0,
248+
"opening_hours": [ 8, 17 ]
249+
}
250+
},
251+
{
252+
"type": "Feature",
253+
"id": 19,
254+
"geometry": {
255+
"type": "Point",
256+
"coordinates": [ -104.9831195, 40.532558 ]
257+
},
258+
"properties": {
259+
"demand": 1,
260+
"service_time": 0,
261+
"opening_hours": [ 8, 17 ]
262+
}
263+
},
264+
{
265+
"type": "Feature",
266+
"id": 20,
267+
"geometry": {
268+
"type": "Point",
269+
"coordinates": [ -105.0563852, 40.6152574 ]
270+
},
271+
"properties": {
272+
"demand": 1,
273+
"service_time": 0,
274+
"opening_hours": [ 8, 17 ]
275+
}
276+
},
277+
{
278+
"type": "Feature",
279+
"id": 21,
280+
"geometry": {
281+
"type": "Point",
282+
"coordinates": [ -105.0508481, 40.5419566 ]
283+
},
284+
"properties": {
285+
"demand": 1,
286+
"service_time": 0,
287+
"opening_hours": [ 8, 17 ]
288+
}
289+
},
290+
{
291+
"type": "Feature",
292+
"id": 22,
293+
"geometry": {
294+
"type": "Point",
295+
"coordinates": [ -105.05266280000001, 40.5635807 ]
296+
},
297+
"properties": {
298+
"demand": 1,
299+
"service_time": 0,
300+
"opening_hours": [ 8, 17 ]
301+
}
302+
},
303+
{
304+
"type": "Feature",
305+
"id": 23,
306+
"geometry": {
307+
"type": "Point",
308+
"coordinates": [ -105.10208740000002, 40.5918091 ]
309+
},
310+
"properties": {
311+
"demand": 1,
104312
"service_time": 0,
105313
"opening_hours": [ 8, 17 ]
106314
}

‎Static/data/geojson/mio_vehicles.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": 0,
44
"name": "Car A",
55
"start_end_location_ids": [ 0, 0 ],
6-
"capacity": 75,
6+
"capacity": 12,
77
"vehicle_type_id": 1,
88
"break_duration": 0,
99
"break_time_window": [ 12, 14 ],
@@ -13,7 +13,7 @@
1313
"id": 1,
1414
"name": "Car B",
1515
"start_end_location_ids": [ 0, 0 ],
16-
"capacity": 75,
16+
"capacity": 12,
1717
"vehicle_type_id": 1,
1818
"break_duration": 0,
1919
"break_time_window": [ 12, 14 ],
@@ -23,7 +23,7 @@
2323
"id": 2,
2424
"name": "Car C",
2525
"start_end_location_ids": [ 1, 1 ],
26-
"capacity": 75,
26+
"capacity": 12,
2727
"vehicle_type_id": 1,
2828
"break_duration": 0,
2929
"break_time_window": [ 12, 14 ],
@@ -33,7 +33,7 @@
3333
"id": 3,
3434
"name": "Car D",
3535
"start_end_location_ids": [ 1, 1 ],
36-
"capacity": 75,
36+
"capacity": 12,
3737
"vehicle_type_id": 1,
3838
"break_duration": 0,
3939
"break_time_window": [ 12, 14 ],

0 commit comments

Comments
 (0)