-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
293 lines (232 loc) · 12.2 KB
/
Copy pathindex.html
File metadata and controls
293 lines (232 loc) · 12.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A simple mapping utility for vehicle routing problem instances and solutions, specifically designed to work with the VRP-REP community-defined format.">
<link rel="icon" href="assets/images/vrp-repLogo_c.png">
<title>Mapper | VRP-REP</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="assets/css/starter-template.css" rel="stylesheet">
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-67398705-6', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<nav class="navbar navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="http://vrp-rep.org/" class="navbar-left">
<img style="padding-right: 20px; padding-top: 5px;" height="40px" src="assets/images/vrp-repLogo_c.png">
</a>
<span class="navbar-brand"><a href="http://vrp-rep.org/">VRP-REP</a> Mapper</span>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#">
<label class="nav-label">Upload instance<input id="instance-upload" type="file" style="display: none;"></label>
</a>
</li>
<li><a data-toggle="modal" href="#uploadSolutionModal">Upload solution</a></li>
<li><a data-toggle="modal" href="#sampleDataModal">Sample data</a></li>
<li><a data-toggle="modal" href="#aboutModal">About</a></li>
<li><a href="http://vrp-rep.org/">VRP-REP Home</a></li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<div class="map-zone" id="div-where-instance-goes">
</div>
</div>
<!-- /.container -->
<!-- Upload Solution Modal -->
<div id="uploadSolutionModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title">Upload solution</h3>
</div>
<div class="modal-body">
<p>
You may either upload a VRP-REP compliant solution or you may manually enter a sequence of nodes.
</p>
<div class="form-group">
<label>Upload VRP-REP compliant solution:</label><br>
<label id="btn-for-sol-upload" class="enable-on-instance-upload btn btn-default btn-file" disabled>
Browse <input class="enable-on-instance-upload" id="solution-upload" type="file" style="display: none;" disabled>
</label>
<span id="sol-upload-btn-text" style="font-style: italic;">First upload an instance</span>
</div>
<div class="form-group">
<label for="route-input">Route:</label>
<input type="text" class="enable-on-instance-upload form-control" id="route-input" placeholder="First upload an instance"
disabled>
</div>
</div>
<div class="modal-footer">
<button onclick="handleManualRouteInput(document.getElementById('route-input').value)" id="plot-route-btn" type="button"
class="enable-on-instance-upload btn btn-default" data-dismiss="modal" disabled>
Plot
</button>
</div>
</div>
</div>
</div>
<!-- Sample Data Modal -->
<div id="sampleDataModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title">Sample data</h3>
</div>
<div class="modal-body">
<em>
Get started with Mapper right away by using sample data files.
</em>
<div class="form-group">
<label>Get started:</label><br>
<label id="plot-sample-data-label" class="btn btn-default btn-file">
Plot sample dataset and solution <input id="plot-sample-data" onclick="loadSampleData()" style="display: none;">
</label>
</div>
<p>
You can also download the original sources for the sample data, which come from the CMT01 instance from Christofides <i>et al</i>.
(1979).
</p>
<div class="form-group">
<label>Download sample data files:</label><br>
<form method="get" target="_blank" action="data/VRPREPMapperSampleData.zip">
<button class="btn btn-default" type="submit">Download</button>
</form>
<span style="font-style: italic;">
<a href="http://www.vrp-rep.org/datasets/item/2014-0002.html">Learn more about this dataset at VRP-REP</a>
</span>
</div>
</div>
<div class="modal-footer">
<button id="plot-route-btn" type="button" class="btn btn-default" data-dismiss="modal">
Dismiss
</button>
</div>
</div>
</div>
</div>
<!-- About Modal -->
<div id="aboutModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title">About the VRP-REP Mapper</h3>
</div>
<div class="modal-body">
<p>Mapper let's users visualize datasets (problem instances) and solutions (routes) that are formatted according to
the Vehicle Routing Problem REPository (VRP-REP) specifications.</p>
<p>More about VRP-REP and the specification can be found on our <a href="http://vrp-rep.org/">website</a>.</p>
<p>Jump to</p>
<ul>
<li><a href="#dont-have-data">How to use Mapper if you don't have your own data</a></li>
<li><a href="#do-have-data">How to use Mapper if you do have your own data</a></li>
<li><a href="#route-display">Toggling route display</a></li>
<li><a href="#sol-format">The VRP-REP solution format</a></li>
</ul>
<h2 id="touse">To use</h2>
<p>
<a name="dont-have-data"></a>
</p>
<h3 id="ifyoudonthaveyourowndata">If you don't have your own data</h3>
<p>If you don't already have VRP-REP compliant datasets or solutions, select "Sample data".</p>
<p><img style="height: auto;width: 100%;" src="./assets/images/sampleData.gif" alt="Sample data" title="Sample data"
/></p>
<p>From here, select "Plot sample dataset and solution" to view the Christofides <em>et al.</em> (1979) CMT01 instance
and its solution.</p>
<p>You can also choose to download the source files for sample data using the "Download" button.</p>
<p>
<a name="do-have-data"></a>
</p>
<h3 id="ifyoudohaveyourowndata">If you do have your own data</h3>
<p>If you have your own VRP-REP compliant instances and solutions, then from the <a href="https://vrp-rep.github.io/mapper/">Mapper landing page</a>,
first select "Upload instance" to browse to and select a VRP-REP compliant dataset.</p>
<p><img style="height: auto;width: 100%;" src="./assets/images/uploadInstance.PNG" alt="Upload instance" title="Upload instance"
/></p>
<p>Once you have uploaded an instance, the upload solution functionality becomes available. Select "Upload solution."</p>
<p><img style="height: auto;width: 100%;" src="./assets/images/uploadSolution.PNG" alt="Upload solution" title="Upload solution"
/></p>
<p>From the modal that appears, you have two options to input a solution (a route or set of routes):</p>
<ol>
<li>You may select "Browse" to select a VRP-REP compliant solution, or</li>
<li>You may simply input a sequence of integers into the text field. This sequence of integers should be separated
either by commas or whitespace. After you input a sequence, hit the "Plot" button.</li>
</ol>
<p>Note that whenever a new solution is uploaded or a new route is entered, the existing routes will be cleared.</p>
<p>
<a name="sol-format"></a>
</p>
<p><a name="route-display"></a></p>
<h2 id="togglingroutedisplay">Toggling route display</h2>
<p>If you have uploaded a solution file that contains more than one route, you can toggle the display of the routes by clicking on the routes' legend entries.</p>
<p><img style="height: auto;width: 100%;" src="./assets/images/routeToggle.gif" alt="Toggle route display" title="Toggle route display" /></p>
<h2 id="thevrprepsolutionformat">The VRP-REP Solution Format</h2>
<p>The XML schema defining the VRP-REP solution format is <a href="http://vrp-rep.org/resources/download/6">available here</a>.</p>
<p>A description of the format:</p>
<ul>
<li>
<p>The root element must be a <code><solution></code> element, and it must contain a string attribute identifying
the <code>instance</code> (<code>method</code> is optional).</p>
</li>
<li>
<p>Within <code><solution></code> must be at least one <code><route></code> element with a mandatory
and unique <code>id</code> attribute (integer). <code><route></code> elements may also contain any
other attributes you want to add. For example, if your file reports the solution to a VRP with a limited
fleet, you can add an attribute <code>vehicle_id='X'</code> to the <code><route></code> element, indicating
that the route is serviced by vehicle 'X'.</p>
</li>
<li>
<p>Within <code><route></code> must be at least 2 <code><node></code>s, each with a mandatory <code>id</code> attribute (integer). <code><node></code>elements may contain any child elements you wish to add. For
example, if your file reports the solution to a VRP with split delivery, you can add to the <code><node></code> element a <code><quantity>X</quantity></code> child, indicating that the route services X units
of the node's demand.</p>
</li>
</ul>
<p>A sample solution file:</p>
<p><img style="height: auto;width: 100%;" src="./assets/images/solFileSnippet.PNG" alt="Example solution file" title="Example solution file"
/></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- D3 -->
<script src="https://d3js.org/d3.v4.min.js"></script>
<!-- For more color scale options -->
<script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script>
<!-- For the legend -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.21.0/d3-legend.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- Custom JS for the instance mapping -->
<script src="assets/js/instancemapper.js"></script>
</body>
</html>