-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_me.html
More file actions
248 lines (239 loc) · 29.1 KB
/
read_me.html
File metadata and controls
248 lines (239 loc) · 29.1 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome file.md</title>
<link rel="stylesheet" href="https://stackedit.io/style.css" />
</head>
<body class="stackedit">
<div class="stackedit__html"><h1 id="libraries-to-install">Libraries to install</h1>
<p>Please install:</p>
<ul>
<li>Python 3.7</li>
<li>Jupyter notebook</li>
<li>jupyter_contrib_nbextensions from <a href="https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html">https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html</a></li>
<li>jupyter_nbextensions_configurator from<br>
<a href="https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator">https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator</a><br>
Once you open jupyter hopepage, navigate to Nbextensions tab and enable the following features:</li>
<li>Table of Contents (2)</li>
<li>highlighter</li>
<li>Codefolding</li>
</ul>
<p>Other python libraries to install:<br>
Common libraries:<br>
[numpy, pandas, json, matplotlib, ast]<br>
More specific libraries<br>
[shapely, geopandas, geopy, functools, requests, glob, gurobipy (install from grouby installation folder), scipy, sklearn, imageio, seaborn]<br>
if the main directory of your gurobi installation does not have a python37 version for gurobipy:<br>
copy and replace the content of the folder “gurobipy installation” in the directory of the main gurobi installation, using the new <a href="http://setup.py">setup.py</a> you should be able to use gurobipy with python3.7 .</p>
<h1 id="files">Files</h1>
<p>The list of files you should have:<br>
From PTV:</p>
<ul>
<li>xserver</li>
<li>simulator (folder)</li>
<li>dispatcher_service.exe</li>
<li>ScenarioParameters.json<br>
(the fleet_size, vehicle_capacity, max_waiting_time can be set here)</li>
<li>start.bat</li>
</ul>
<p>For charging:</p>
<ul>
<li><a href="http://options.py">options.py</a></li>
<li>run_this_before_each_simulation.py</li>
<li><a href="http://charging.py">charging.py</a></li>
<li>charging_prams.py</li>
<li>scenarios folder, including a selection of scenarios with a description file</li>
<li>data (folder) including zones shapefile and OD matrix</li>
<li>GeneratingScenarios_MakingDailyChargingPlan_VisualizingResults.ipynb</li>
</ul>
<h1 id="run-ready-made-scenarios">Run ready made scenarios</h1>
<h3 id="running-the-simulation">Running the simulation</h3>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> start xsever:</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> make a high performance routing network for Barcelona (only once for all the runs) :
<ul>
<li>Go to xserver location on your browser, by default localhost:50000</li>
<li>Under administration, choose Raw Request Runner</li>
<li>choose the following options [XData/JSON/experimental/startCreateHighPerformanceRoutingNetwork]</li>
<li>Put in the following request, and send (this takes some time):</li>
</ul>
</li>
</ul>
<pre class=" language-java"><code class="prism language-java"> <span class="token punctuation">{</span><span class="token string">"label"</span><span class="token operator">:</span> <span class="token string">"barcelona"</span><span class="token punctuation">,</span>
<span class="token string">"scope"</span><span class="token operator">:</span> <span class="token string">"barcelona"</span><span class="token punctuation">,</span>
<span class="token string">"storedProfile"</span><span class="token operator">:</span> <span class="token string">"car"</span><span class="token punctuation">,</span>
<span class="token string">"highPerformanceRoutingNetworkOptions"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token string">"geographicRestrictions"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token string">"allowedCountries"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
<span class="token string">"ES"</span><span class="token punctuation">]</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">}</span>
</code></pre>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> start.bat, dispatcher.exe, ScenarioParameters.json, and simulator folder should be in the same directory (refered to as main directory from now on)</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> set the following in start.bat:</li>
<li>–energy_step_exe: Path to executable installed by your python distribution (e.g. “C:\Software\python.exe”)</li>
<li>–energy_step_script “<a href="http://charging.py">charging.py</a>”</li>
<li>–options_step_exe: Path to executable installed by your python distribution (same as above)</li>
<li>–options_step_script “<a href="http://options.py">options.py</a>”</li>
<li>–kpi_file “KPI.json”</li>
<li>–log_file “simulation_log.txt”</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> choose scenario and copy its folder “example_scenario” to the main directory</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> from “example_scenario” folder copy TripRequests.json and Nodes.txt and paste them in the main directory</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> set the following in charging_prams.py :</li>
</ul>
<pre class=" language-python"><code class="prism language-python">scenario_name<span class="token operator">=</span><span class="token string">'example_scenario'</span>
STAGE<span class="token operator">=</span><span class="token number">3</span>
LOG<span class="token operator">=</span><span class="token boolean">True</span><span class="token operator">/</span><span class="token boolean">False</span>
SoC_in_assignment<span class="token operator">=</span><span class="token boolean">True</span><span class="token operator">/</span><span class="token boolean">False</span>
lazy_charging<span class="token operator">=</span><span class="token boolean">True</span><span class="token operator">/</span><span class="token boolean">False</span>
</code></pre>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> set the following in ScenarioParameters.json, or just use the ScenarioParameters.json that came with the charging files :</li>
<li>“AcceptableWaitingTime”: 600</li>
<li>“MaximumDetourFactor”: 1.6</li>
<li>“FleetSize”: 150</li>
<li>“SeatCapacity”: 6</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> run run_this_before_each_simulation.py</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> run start.bat</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> after the simulation is over, copy the vehicle%d.csv files to the directory ‘example_scenario/results/3/toure and trajectory’</li>
</ul>
<h3 id="visulizing-the-results">Visulizing the results</h3>
<p>To look at the results start the jupyter notebook GeneratingScenarios_MakingDailyChargingPlan_VisualizingResults.ipynb, which should be placed in the main directory. Further instructions follow in the notebook, in short:</p>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> Enter the name of the scenario</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> Make sure you see the table of content on the left (you should see 4 main sections)</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> Run every cell section 1</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> Run every cell in section 4</li>
</ul>
<p>You will see the plots, and KPI in the notebook, they will also be saved to the results folder (‘example_scenario/results/3/toure and trajectory’), location of the vehicles through the simulation is saved as Gif files and are not shown in the notebook.</p>
<h1 id="making-a-scenario">Making a scenario</h1>
<h3 id="general-scheme">General scheme:</h3>
<div class="mermaid"><svg xmlns="http://www.w3.org/2000/svg" id="mermaid-svg-vTljWzLvRCYzV512" width="100%" style="max-width: 569.6062393188477px;" viewBox="0 0 569.6062393188477 1678.7218475341797"><g transform="translate(-12, -12)"><g class="output"><g class="clusters"></g><g class="edgePaths"><g class="edgePath" style="opacity: 1;"><path class="path" d="M288.24960708618164,118L288.24960708618164,143L288.74960708618164,168.50000610351552" marker-end="url(#arrowhead128)" style="fill:none"></path><defs><marker id="arrowhead128" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M288.74960708618164,454.2218688964844L288.24960708618164,478.72186279296875L288.24960708618164,503.72186279296875" marker-end="url(#arrowhead129)" style="fill:none"></path><defs><marker id="arrowhead129" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M382.6048684506803,601.7218627929688L430.7453079223633,626.7218627929688L430.7453079223633,777.4757690429688L430.7453079223633,928.2296752929688L430.7453079223633,1076.1148300170898L430.7453079223633,1223.999984741211L431.24530792236334,1249.4999908447269" marker-end="url(#arrowhead130)" style="fill:none"></path><defs><marker id="arrowhead130" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M193.89434572168298,601.7218627929688L145.75390625,626.7218627929688L146.25390625,652.2218627929688" marker-end="url(#arrowhead131)" style="fill:none"></path><defs><marker id="arrowhead131" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M146.25390625,903.7296752929688L145.75390625,928.2296752929688L146.25390625,953.7296768188477" marker-end="url(#arrowhead132)" style="fill:none"></path><defs><marker id="arrowhead132" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M146.25390625,1199.4999862670895L145.75390625,1223.999984741211L146.25390625,1300.2304473876954" marker-end="url(#arrowhead133)" style="fill:none"></path><defs><marker id="arrowhead133" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M146.25390625,1484.4913818359373L145.75390625,1559.7218475341797L193.89434572168298,1584.7218475341797" marker-end="url(#arrowhead134)" style="fill:none"></path><defs><marker id="arrowhead134" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M431.24530792236334,1535.2218536376959L430.7453079223633,1559.7218475341797L382.6048684506803,1584.7218475341797" marker-end="url(#arrowhead135)" style="fill:none"></path><defs><marker id="arrowhead135" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g></g><g class="edgeLabels"><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g></g><g class="nodes"><g class="node" id="A" transform="translate(288.24960708618164,69)" style="opacity: 1;"><rect rx="0" ry="0" x="-96.375" y="-49" width="192.75" height="98"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-86.375,-39)"><foreignObject width="172.75" height="78"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Stage 1: Simulating with <br> no relocation and <br> no charging trips</div></foreignObject></g></g></g><g class="node" id="B" transform="translate(288.24960708618164,310.8609313964844)" style="opacity: 1;"><polygon points="142.8609375,0 285.721875,-142.8609375 142.8609375,-285.721875 0,-142.8609375" rx="5" ry="5" transform="translate(-142.8609375,142.8609375)"></polygon><g class="label" transform="translate(0,0)"><g transform="translate(-73.734375,-65)"><foreignObject width="147.46875" height="130"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Update <br> estimation of pickup <br> and drop-off for <br> each zone per <br> time step</div></foreignObject></g></g></g><g class="node" id="C" transform="translate(288.24960708618164,552.7218627929688)" style="opacity: 1;"><rect rx="0" ry="0" x="-96.375" y="-49" width="192.75" height="98"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-86.375,-39)"><foreignObject width="172.75" height="78"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Stage 2: Simulating with <br> relocation but <br> no charging trips</div></foreignObject></g></g></g><g class="node" id="D" transform="translate(430.7453079223633,1391.8609161376953)" style="opacity: 1;"><polygon points="142.8609375,0 285.721875,-142.8609375 142.8609375,-285.721875 0,-142.8609375" rx="5" ry="5" transform="translate(-142.8609375,142.8609375)"></polygon><g class="label" transform="translate(0,0)"><g transform="translate(-73.734375,-65)"><foreignObject width="147.46875" height="130"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Update <br> estimation of pickup <br> and drop-off for <br> each zone per <br> time step</div></foreignObject></g></g></g><g class="node" id="E" transform="translate(145.75390625,777.4757690429688)" style="opacity: 1;"><polygon points="125.75390625,0 251.5078125,-125.75390625 125.75390625,-251.5078125 0,-125.75390625" rx="5" ry="5" transform="translate(-125.75390625,125.75390625)"></polygon><g class="label" transform="translate(0,0)"><g transform="translate(-80.7265625,-39)"><foreignObject width="161.453125" height="78"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Get total travel <br> and total consumption <br> per time step</div></foreignObject></g></g></g><g class="node" id="F" transform="translate(145.75390625,1076.1148300170898)" style="opacity: 1;"><polygon points="122.88515625000001,0 245.77031250000002,-122.88515625000001 122.88515625000001,-245.77031250000002 0,-122.88515625000001" rx="5" ry="5" transform="translate(-122.88515625000001,122.88515625000001)"></polygon><g class="label" transform="translate(0,0)"><g transform="translate(-77.5390625,-39)"><foreignObject width="155.078125" height="78"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Make daily <br> charging plan: running<br> algorithm A</div></foreignObject></g></g></g><g class="node" id="G" transform="translate(145.75390625,1391.8609161376953)" style="opacity: 1;"><polygon points="92.13046875,0 184.2609375,-92.13046875 92.13046875,-184.2609375 0,-92.13046875" rx="5" ry="5" transform="translate(-92.13046875,92.13046875)"></polygon><g class="label" transform="translate(0,0)"><g transform="translate(-43.3671875,-39)"><foreignObject width="86.734375" height="78"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Get metric<br> for high SoC<br> vehicles</div></foreignObject></g></g></g><g class="node" id="H" transform="translate(288.24960708618164,1633.7218475341797)" style="opacity: 1;"><rect rx="0" ry="0" x="-96.375" y="-49" width="192.75" height="98"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-86.375,-39)"><foreignObject width="172.75" height="78"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Stage 3: Simulating with <br> relocation and <br> charging trips</div></foreignObject></g></g></g></g></g></g></svg></div>
<h3 id="set-the-prameters-of-the-scenario">Set the prameters of the scenario:</h3>
<p>Here find where each parameter should be changed, first the relavent file is specified, and then the variable’s name:<br>
“notebook” is used as shortcut for “GeneratingScenarios_MakingDailyChargingPlan_VisualizingResults.ipynb”</p>
<p>Scenario name:</p>
<ul>
<li>charging_pram.py: scenario_name</li>
<li>notebook: scenario_name</li>
</ul>
<p>Stage:</p>
<ul>
<li>charging_pram.py: STAGE</li>
<li>notebook: stage</li>
</ul>
<p>Charging method:</p>
<ul>
<li>charging_pram.py: [SoC_in_assignment, lazy_charging]</li>
<li>notebook: only applicable when visulizing (stage=4) [SoC_in_assignment, lazy_charging]</li>
</ul>
<hr>
<p>Operating hours:</p>
<ul>
<li>charging_pram.py: [<em>operation_start_time, operation_end_time</em>]</li>
<li>notebook: [<em>operation_start_time, operation_end_time</em>]</li>
</ul>
<p>Fleet size:</p>
<ul>
<li>ScenarioParameters.json: <em>FleetSize</em></li>
<li>notebook: <em>fleet_size</em></li>
</ul>
<p>Driving range:</p>
<ul>
<li>charging_pram.py: <em>DrivingRange</em></li>
<li>notebook: <em>DrivingRange</em></li>
</ul>
<p>Number of chargers:</p>
<ul>
<li>notebook: [<em>number_of_slow_plugs, number_of_slow_stations, number_of_fast_plugs, number_of_fast_stations</em>]</li>
</ul>
<p>Charging rate:</p>
<ul>
<li>charging_pram.py: <em>charging_time</em></li>
<li>notebook: <em>charging_time</em></li>
</ul>
<p>Seat Capacity:</p>
<ul>
<li>ScenarioParameters.json: <em>SeatCapacity</em></li>
</ul>
<p>Max wating time:</p>
<ul>
<li>ScenarioParameters.json: <em>AcceptableWaitingTime</em></li>
</ul>
<p>Max dtour:</p>
<ul>
<li>ScenarioParameters.json: <em>MaximumDetourfactor</em></li>
</ul>
<hr>
<p>Reoptimization frequency of charging:</p>
<ul>
<li>charging_pram.py: <em>time_step_online</em></li>
<li>strat.bat: <em>energy_time_step</em></li>
</ul>
<p>Objective weigths of algorithm A:</p>
<ul>
<li>notebook: <em>penalty_A</em></li>
</ul>
<p>Objective weigths of algorithm B, C, R:</p>
<ul>
<li>charging_pram.py: [<em>penalty_B, penalty_C, penalty_R</em>]</li>
</ul>
<p>Total expected demand:</p>
<ul>
<li>notebook: <em>es_total_demand</em></li>
</ul>
<h3 id="walk-through">Walk through:</h3>
<h4 id="stage-1">Stage 1</h4>
<p>To generate a scenario start with the jupyter notebook GeneratingScenarios_MakingDailyChargingPlan_VisualizingResults.ipynb, which should be placed in the main directory:<br>
Use Sections 1 and 2 to genarete a scenario the notebook includes a guid to choose number of zones, number of requests, and location of charger stations. Set white noise factor <span class="katex--inline"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height: 0.43056em; vertical-align: 0em;"></span><span class="mord mathdefault" style="margin-right: 0.02691em;">w</span></span></span></span></span> to 0, set morning and evening bias factors <span class="katex--inline"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi><mi mathvariant="normal">_</mi><mi>m</mi><mi>o</mi><mi>r</mi><mi>n</mi><mi>i</mi><mi>n</mi><mi>g</mi></mrow><annotation encoding="application/x-tex">b\_morning</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height: 1.00444em; vertical-align: -0.31em;"></span><span class="mord mathdefault">b</span><span class="mord" style="margin-right: 0.02778em;">_</span><span class="mord mathdefault">m</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.02778em;">r</span><span class="mord mathdefault">n</span><span class="mord mathdefault">i</span><span class="mord mathdefault">n</span><span class="mord mathdefault" style="margin-right: 0.03588em;">g</span></span></span></span></span>, <span class="katex--inline"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi><mi mathvariant="normal">_</mi><mi>e</mi><mi>v</mi><mi>e</mi><mi>n</mi><mi>i</mi><mi>n</mi><mi>g</mi></mrow><annotation encoding="application/x-tex">b\_evening</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height: 1.00444em; vertical-align: -0.31em;"></span><span class="mord mathdefault">b</span><span class="mord" style="margin-right: 0.02778em;">_</span><span class="mord mathdefault">e</span><span class="mord mathdefault" style="margin-right: 0.03588em;">v</span><span class="mord mathdefault">e</span><span class="mord mathdefault">n</span><span class="mord mathdefault">i</span><span class="mord mathdefault">n</span><span class="mord mathdefault" style="margin-right: 0.03588em;">g</span></span></span></span></span> to 0 for stage=1.<br>
Once scenario is generated by running all relavent cells to stage=1 in the notebook, follow the checklist below to run the simulation with no relocation or charging:</p>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> from “new_scenario” folder copy TripRequests.json and Nodes.txt and paste them in the main directory</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> set the following in charging_prams.py :</li>
</ul>
<pre class=" language-python"><code class="prism language-python">scenario_name<span class="token operator">=</span><span class="token string">'new_scenario'</span>
STAGE<span class="token operator">=</span><span class="token number">1</span>
LOG<span class="token operator">=</span><span class="token boolean">True</span><span class="token operator">/</span><span class="token boolean">False</span>
SoC_in_assignment<span class="token operator">=</span><span class="token boolean">False</span>
lazy_charging<span class="token operator">=</span><span class="token boolean">False</span>
</code></pre>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> set the value for fleet_size in ScenarioParameters.json</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> run run_this_before_each_simulation.py</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> run start.bat<br>
after the simulation is over, copy the vehicle%d.csv files to the directory ‘new_scenario/results/1/toure and trajectory’</li>
</ul>
<h4 id="stage-2">Stage 2</h4>
<p>go to GeneratingScenarios_MakingDailyChargingPlan_VisualizingResults.ipynb and use Sections 1 and 2 to genarete a scenario to for stage=2. Follow the checklist below to run the simulation with relocation but no charging:</p>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> from “new_scenario” folder copy TripRequests.json and Nodes.txt and paste them in the main directory</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> set the following in charging_prams.py :</li>
</ul>
<pre class=" language-python"><code class="prism language-python">STAGE<span class="token operator">=</span><span class="token number">2</span>
</code></pre>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> run run_this_before_each_simulation.py</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> run start.bat<br>
after the simulation is over, copy the vehicle%d.csv files to the directory ‘new_scenario/results/2/toure and trajectory’, replacing the privous ones</li>
</ul>
<h4 id="stage-3">Stage 3</h4>
<p>go to GeneratingScenarios_MakingDailyChargingPlan_VisualizingResults.ipynb and use Sections 1, 2, and 3 to genarete a scenario to for stage 3. In this stage you can set white noise factor, morning and evening bias factor for the demand.<br>
Section 3 in the jupyrter notebok will read trejectory data from stage 2 get travel time and distance from xroute for those trejectories. With this it will calculate the input to algorithm A. Then it will run algorithm A and write the solution to folder of the scenario. You will also observe the plan by algorithm A in section 3. Further guidline is included in the notebook.<br>
Follow the checklist below to run the simulation with relocation and charging:</p>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> from “new_scenario” folder copy TripRequests.json and Nodes.txt and paste them in the main directory</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> set the following in charging_prams.py :</li>
</ul>
<pre class=" language-python"><code class="prism language-python">STAGE<span class="token operator">=</span><span class="token number">3</span>
LOG<span class="token operator">=</span><span class="token boolean">True</span><span class="token operator">/</span><span class="token boolean">False</span>
SoC_in_assignment<span class="token operator">=</span><span class="token boolean">True</span><span class="token operator">/</span><span class="token boolean">False</span>
lazy_charging<span class="token operator">=</span><span class="token boolean">True</span><span class="token operator">/</span><span class="token boolean">False</span>
</code></pre>
<ul>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> run run_this_before_each_simulation.py</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> run start.bat</li>
</ul>
</div>
</body>
</html>