transportations-library 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- transportations_library-0.1.0/Cargo.lock +453 -0
- transportations_library-0.1.0/Cargo.toml +28 -0
- transportations_library-0.1.0/PKG-INFO +21 -0
- transportations_library-0.1.0/README.md +6 -0
- transportations_library-0.1.0/dist/transportations_library-0.1.0.tar.gz +0 -0
- transportations_library-0.1.0/documents/README.md +9 -0
- transportations_library-0.1.0/documents/setups.md +13 -0
- transportations_library-0.1.0/pyproject.toml +25 -0
- transportations_library-0.1.0/src/lib.rs +4 -0
- transportations_library-0.1.0/src/middleware/copython/mod.rs +1 -0
- transportations_library-0.1.0/src/middleware/copython/py_twolanehighways.rs +325 -0
- transportations_library-0.1.0/src/middleware/corust/mod.rs +1 -0
- transportations_library-0.1.0/src/middleware/corust/wasm_twolanehighways.rs +440 -0
- transportations_library-0.1.0/src/middleware.rs +5 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 3
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "assert_approx_eq"
|
|
7
|
+
version = "1.1.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "3c07dab4369547dbe5114677b33fbbf724971019f3818172d59a97a61c774ffd"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "autocfg"
|
|
13
|
+
version = "1.3.0"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "bitflags"
|
|
19
|
+
version = "2.6.0"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "bumpalo"
|
|
25
|
+
version = "3.16.0"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "cfg-if"
|
|
31
|
+
version = "1.0.0"
|
|
32
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
+
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "crosstraffic_middleware"
|
|
37
|
+
version = "0.1.4"
|
|
38
|
+
dependencies = [
|
|
39
|
+
"js-sys",
|
|
40
|
+
"pyo3",
|
|
41
|
+
"serde",
|
|
42
|
+
"serde-wasm-bindgen",
|
|
43
|
+
"transportations_library",
|
|
44
|
+
"wasm-bindgen",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[[package]]
|
|
48
|
+
name = "heck"
|
|
49
|
+
version = "0.4.1"
|
|
50
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
51
|
+
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
|
52
|
+
|
|
53
|
+
[[package]]
|
|
54
|
+
name = "indoc"
|
|
55
|
+
version = "2.0.5"
|
|
56
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
57
|
+
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
|
|
58
|
+
|
|
59
|
+
[[package]]
|
|
60
|
+
name = "itoa"
|
|
61
|
+
version = "1.0.11"
|
|
62
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
63
|
+
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
|
|
64
|
+
|
|
65
|
+
[[package]]
|
|
66
|
+
name = "js-sys"
|
|
67
|
+
version = "0.3.69"
|
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
+
checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
|
|
70
|
+
dependencies = [
|
|
71
|
+
"wasm-bindgen",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
[[package]]
|
|
75
|
+
name = "libc"
|
|
76
|
+
version = "0.2.155"
|
|
77
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
78
|
+
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "lock_api"
|
|
82
|
+
version = "0.4.12"
|
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
84
|
+
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
|
|
85
|
+
dependencies = [
|
|
86
|
+
"autocfg",
|
|
87
|
+
"scopeguard",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[[package]]
|
|
91
|
+
name = "log"
|
|
92
|
+
version = "0.4.21"
|
|
93
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
94
|
+
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
|
|
95
|
+
|
|
96
|
+
[[package]]
|
|
97
|
+
name = "memoffset"
|
|
98
|
+
version = "0.9.1"
|
|
99
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
100
|
+
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
101
|
+
dependencies = [
|
|
102
|
+
"autocfg",
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
[[package]]
|
|
106
|
+
name = "once_cell"
|
|
107
|
+
version = "1.19.0"
|
|
108
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
109
|
+
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
|
110
|
+
|
|
111
|
+
[[package]]
|
|
112
|
+
name = "parking_lot"
|
|
113
|
+
version = "0.12.3"
|
|
114
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
115
|
+
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
|
|
116
|
+
dependencies = [
|
|
117
|
+
"lock_api",
|
|
118
|
+
"parking_lot_core",
|
|
119
|
+
]
|
|
120
|
+
|
|
121
|
+
[[package]]
|
|
122
|
+
name = "parking_lot_core"
|
|
123
|
+
version = "0.9.10"
|
|
124
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
125
|
+
checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
|
|
126
|
+
dependencies = [
|
|
127
|
+
"cfg-if",
|
|
128
|
+
"libc",
|
|
129
|
+
"redox_syscall",
|
|
130
|
+
"smallvec",
|
|
131
|
+
"windows-targets",
|
|
132
|
+
]
|
|
133
|
+
|
|
134
|
+
[[package]]
|
|
135
|
+
name = "portable-atomic"
|
|
136
|
+
version = "1.6.0"
|
|
137
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
138
|
+
checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
|
|
139
|
+
|
|
140
|
+
[[package]]
|
|
141
|
+
name = "proc-macro2"
|
|
142
|
+
version = "1.0.86"
|
|
143
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
144
|
+
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
|
|
145
|
+
dependencies = [
|
|
146
|
+
"unicode-ident",
|
|
147
|
+
]
|
|
148
|
+
|
|
149
|
+
[[package]]
|
|
150
|
+
name = "pyo3"
|
|
151
|
+
version = "0.21.2"
|
|
152
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
153
|
+
checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8"
|
|
154
|
+
dependencies = [
|
|
155
|
+
"cfg-if",
|
|
156
|
+
"indoc",
|
|
157
|
+
"libc",
|
|
158
|
+
"memoffset",
|
|
159
|
+
"parking_lot",
|
|
160
|
+
"portable-atomic",
|
|
161
|
+
"pyo3-build-config",
|
|
162
|
+
"pyo3-ffi",
|
|
163
|
+
"pyo3-macros",
|
|
164
|
+
"unindent",
|
|
165
|
+
]
|
|
166
|
+
|
|
167
|
+
[[package]]
|
|
168
|
+
name = "pyo3-build-config"
|
|
169
|
+
version = "0.21.2"
|
|
170
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
171
|
+
checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50"
|
|
172
|
+
dependencies = [
|
|
173
|
+
"once_cell",
|
|
174
|
+
"target-lexicon",
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
[[package]]
|
|
178
|
+
name = "pyo3-ffi"
|
|
179
|
+
version = "0.21.2"
|
|
180
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
181
|
+
checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403"
|
|
182
|
+
dependencies = [
|
|
183
|
+
"libc",
|
|
184
|
+
"pyo3-build-config",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[[package]]
|
|
188
|
+
name = "pyo3-macros"
|
|
189
|
+
version = "0.21.2"
|
|
190
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
191
|
+
checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c"
|
|
192
|
+
dependencies = [
|
|
193
|
+
"proc-macro2",
|
|
194
|
+
"pyo3-macros-backend",
|
|
195
|
+
"quote",
|
|
196
|
+
"syn",
|
|
197
|
+
]
|
|
198
|
+
|
|
199
|
+
[[package]]
|
|
200
|
+
name = "pyo3-macros-backend"
|
|
201
|
+
version = "0.21.2"
|
|
202
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
203
|
+
checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c"
|
|
204
|
+
dependencies = [
|
|
205
|
+
"heck",
|
|
206
|
+
"proc-macro2",
|
|
207
|
+
"pyo3-build-config",
|
|
208
|
+
"quote",
|
|
209
|
+
"syn",
|
|
210
|
+
]
|
|
211
|
+
|
|
212
|
+
[[package]]
|
|
213
|
+
name = "quote"
|
|
214
|
+
version = "1.0.36"
|
|
215
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
216
|
+
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
|
|
217
|
+
dependencies = [
|
|
218
|
+
"proc-macro2",
|
|
219
|
+
]
|
|
220
|
+
|
|
221
|
+
[[package]]
|
|
222
|
+
name = "redox_syscall"
|
|
223
|
+
version = "0.5.2"
|
|
224
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
225
|
+
checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
|
|
226
|
+
dependencies = [
|
|
227
|
+
"bitflags",
|
|
228
|
+
]
|
|
229
|
+
|
|
230
|
+
[[package]]
|
|
231
|
+
name = "round"
|
|
232
|
+
version = "0.1.2"
|
|
233
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
234
|
+
checksum = "b02705db4fa872ae37e464fc803b7ffa574e6c4a5e112c52a82550f9dd63b657"
|
|
235
|
+
|
|
236
|
+
[[package]]
|
|
237
|
+
name = "ryu"
|
|
238
|
+
version = "1.0.18"
|
|
239
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
240
|
+
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
|
|
241
|
+
|
|
242
|
+
[[package]]
|
|
243
|
+
name = "scopeguard"
|
|
244
|
+
version = "1.2.0"
|
|
245
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
246
|
+
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
247
|
+
|
|
248
|
+
[[package]]
|
|
249
|
+
name = "serde"
|
|
250
|
+
version = "1.0.203"
|
|
251
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
252
|
+
checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
|
|
253
|
+
dependencies = [
|
|
254
|
+
"serde_derive",
|
|
255
|
+
]
|
|
256
|
+
|
|
257
|
+
[[package]]
|
|
258
|
+
name = "serde-wasm-bindgen"
|
|
259
|
+
version = "0.4.5"
|
|
260
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
261
|
+
checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf"
|
|
262
|
+
dependencies = [
|
|
263
|
+
"js-sys",
|
|
264
|
+
"serde",
|
|
265
|
+
"wasm-bindgen",
|
|
266
|
+
]
|
|
267
|
+
|
|
268
|
+
[[package]]
|
|
269
|
+
name = "serde_derive"
|
|
270
|
+
version = "1.0.203"
|
|
271
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
272
|
+
checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
|
|
273
|
+
dependencies = [
|
|
274
|
+
"proc-macro2",
|
|
275
|
+
"quote",
|
|
276
|
+
"syn",
|
|
277
|
+
]
|
|
278
|
+
|
|
279
|
+
[[package]]
|
|
280
|
+
name = "serde_json"
|
|
281
|
+
version = "1.0.118"
|
|
282
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
+
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4"
|
|
284
|
+
dependencies = [
|
|
285
|
+
"itoa",
|
|
286
|
+
"ryu",
|
|
287
|
+
"serde",
|
|
288
|
+
]
|
|
289
|
+
|
|
290
|
+
[[package]]
|
|
291
|
+
name = "smallvec"
|
|
292
|
+
version = "1.13.2"
|
|
293
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
294
|
+
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
|
295
|
+
|
|
296
|
+
[[package]]
|
|
297
|
+
name = "syn"
|
|
298
|
+
version = "2.0.68"
|
|
299
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
300
|
+
checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
|
|
301
|
+
dependencies = [
|
|
302
|
+
"proc-macro2",
|
|
303
|
+
"quote",
|
|
304
|
+
"unicode-ident",
|
|
305
|
+
]
|
|
306
|
+
|
|
307
|
+
[[package]]
|
|
308
|
+
name = "target-lexicon"
|
|
309
|
+
version = "0.12.14"
|
|
310
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
311
|
+
checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
|
|
312
|
+
|
|
313
|
+
[[package]]
|
|
314
|
+
name = "transportations_library"
|
|
315
|
+
version = "0.1.1"
|
|
316
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
317
|
+
checksum = "7758bbdb12575c0942f1a077a104d544785e0198e2523f3aab2db9a1b1c65b16"
|
|
318
|
+
dependencies = [
|
|
319
|
+
"assert_approx_eq",
|
|
320
|
+
"round",
|
|
321
|
+
"serde",
|
|
322
|
+
"serde_json",
|
|
323
|
+
]
|
|
324
|
+
|
|
325
|
+
[[package]]
|
|
326
|
+
name = "unicode-ident"
|
|
327
|
+
version = "1.0.12"
|
|
328
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
329
|
+
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
|
330
|
+
|
|
331
|
+
[[package]]
|
|
332
|
+
name = "unindent"
|
|
333
|
+
version = "0.2.3"
|
|
334
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
335
|
+
checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
|
|
336
|
+
|
|
337
|
+
[[package]]
|
|
338
|
+
name = "wasm-bindgen"
|
|
339
|
+
version = "0.2.92"
|
|
340
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
341
|
+
checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
|
|
342
|
+
dependencies = [
|
|
343
|
+
"cfg-if",
|
|
344
|
+
"wasm-bindgen-macro",
|
|
345
|
+
]
|
|
346
|
+
|
|
347
|
+
[[package]]
|
|
348
|
+
name = "wasm-bindgen-backend"
|
|
349
|
+
version = "0.2.92"
|
|
350
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
351
|
+
checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
|
|
352
|
+
dependencies = [
|
|
353
|
+
"bumpalo",
|
|
354
|
+
"log",
|
|
355
|
+
"once_cell",
|
|
356
|
+
"proc-macro2",
|
|
357
|
+
"quote",
|
|
358
|
+
"syn",
|
|
359
|
+
"wasm-bindgen-shared",
|
|
360
|
+
]
|
|
361
|
+
|
|
362
|
+
[[package]]
|
|
363
|
+
name = "wasm-bindgen-macro"
|
|
364
|
+
version = "0.2.92"
|
|
365
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
366
|
+
checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
|
|
367
|
+
dependencies = [
|
|
368
|
+
"quote",
|
|
369
|
+
"wasm-bindgen-macro-support",
|
|
370
|
+
]
|
|
371
|
+
|
|
372
|
+
[[package]]
|
|
373
|
+
name = "wasm-bindgen-macro-support"
|
|
374
|
+
version = "0.2.92"
|
|
375
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
376
|
+
checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
|
|
377
|
+
dependencies = [
|
|
378
|
+
"proc-macro2",
|
|
379
|
+
"quote",
|
|
380
|
+
"syn",
|
|
381
|
+
"wasm-bindgen-backend",
|
|
382
|
+
"wasm-bindgen-shared",
|
|
383
|
+
]
|
|
384
|
+
|
|
385
|
+
[[package]]
|
|
386
|
+
name = "wasm-bindgen-shared"
|
|
387
|
+
version = "0.2.92"
|
|
388
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
389
|
+
checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
|
|
390
|
+
|
|
391
|
+
[[package]]
|
|
392
|
+
name = "windows-targets"
|
|
393
|
+
version = "0.52.5"
|
|
394
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
395
|
+
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
|
|
396
|
+
dependencies = [
|
|
397
|
+
"windows_aarch64_gnullvm",
|
|
398
|
+
"windows_aarch64_msvc",
|
|
399
|
+
"windows_i686_gnu",
|
|
400
|
+
"windows_i686_gnullvm",
|
|
401
|
+
"windows_i686_msvc",
|
|
402
|
+
"windows_x86_64_gnu",
|
|
403
|
+
"windows_x86_64_gnullvm",
|
|
404
|
+
"windows_x86_64_msvc",
|
|
405
|
+
]
|
|
406
|
+
|
|
407
|
+
[[package]]
|
|
408
|
+
name = "windows_aarch64_gnullvm"
|
|
409
|
+
version = "0.52.5"
|
|
410
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
411
|
+
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
|
|
412
|
+
|
|
413
|
+
[[package]]
|
|
414
|
+
name = "windows_aarch64_msvc"
|
|
415
|
+
version = "0.52.5"
|
|
416
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
417
|
+
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
|
|
418
|
+
|
|
419
|
+
[[package]]
|
|
420
|
+
name = "windows_i686_gnu"
|
|
421
|
+
version = "0.52.5"
|
|
422
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
423
|
+
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
|
|
424
|
+
|
|
425
|
+
[[package]]
|
|
426
|
+
name = "windows_i686_gnullvm"
|
|
427
|
+
version = "0.52.5"
|
|
428
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
429
|
+
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
|
|
430
|
+
|
|
431
|
+
[[package]]
|
|
432
|
+
name = "windows_i686_msvc"
|
|
433
|
+
version = "0.52.5"
|
|
434
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
435
|
+
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
|
|
436
|
+
|
|
437
|
+
[[package]]
|
|
438
|
+
name = "windows_x86_64_gnu"
|
|
439
|
+
version = "0.52.5"
|
|
440
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
441
|
+
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
|
|
442
|
+
|
|
443
|
+
[[package]]
|
|
444
|
+
name = "windows_x86_64_gnullvm"
|
|
445
|
+
version = "0.52.5"
|
|
446
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
447
|
+
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
|
|
448
|
+
|
|
449
|
+
[[package]]
|
|
450
|
+
name = "windows_x86_64_msvc"
|
|
451
|
+
version = "0.52.5"
|
|
452
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
453
|
+
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "crosstraffic_middleware"
|
|
3
|
+
version = "0.1.4"
|
|
4
|
+
authors = ["Rei Tamaru <tamaru@wisc.edu>"]
|
|
5
|
+
edition = "2021"
|
|
6
|
+
license = "MIT OR Apache-2.0"
|
|
7
|
+
description = "Middleware for transporations library and the software applications."
|
|
8
|
+
documentation = "https://docs.rs/cross-traffic-middleware"
|
|
9
|
+
repository = "https://github.com/crosstraffic/cross-traffic-middleware"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
exclude = [
|
|
12
|
+
".gitignore",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[features]
|
|
16
|
+
pybindings = ["pyo3"]
|
|
17
|
+
|
|
18
|
+
[dependencies]
|
|
19
|
+
wasm-bindgen = "0.2.90"
|
|
20
|
+
serde = { version = "1.0", features = ["derive"]}
|
|
21
|
+
serde-wasm-bindgen = "0.4"
|
|
22
|
+
transportations_library = "0.1.0"
|
|
23
|
+
js-sys = "0.3.67"
|
|
24
|
+
pyo3 = { version = "0.21.2", features = ["extension-module"], optional = true}
|
|
25
|
+
|
|
26
|
+
[lib]
|
|
27
|
+
name = "crosstraffic_middleware"
|
|
28
|
+
crate-type = ["cdylib", "rlib"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: transportations_library
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Summary: Middleware for transporations library and the software applications.
|
|
8
|
+
Author: raynbowy23
|
|
9
|
+
Author-email: Rei Tamaru <tamaru@wisc.edu>
|
|
10
|
+
License: MIT OR Apache-2.0
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
Project-URL: Homepage, https://github.com/crosstraffic/cross-traffic-middleware
|
|
14
|
+
|
|
15
|
+
## About
|
|
16
|
+
|
|
17
|
+
Middleware for transportation library and software applications.
|
|
18
|
+
|
|
19
|
+
Currently, it supports the connection between the Transportation Library and Cross Traffic Platform / Cross Traffic Web Calculator through WebAssembly.
|
|
20
|
+
Please import to Cargo from crates.io (https://lib.rs/crates/crosstraffic_middleware).
|
|
21
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
## About
|
|
2
|
+
|
|
3
|
+
Middleware for transportation library and software applications.
|
|
4
|
+
|
|
5
|
+
Currently, it supports the connection between the Transportation Library and Cross Traffic Platform / Cross Traffic Web Calculator through WebAssembly.
|
|
6
|
+
Please import to Cargo from crates.io (https://lib.rs/crates/crosstraffic_middleware).
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## HCM-middleware
|
|
2
|
+
|
|
3
|
+
Generating scenario for HCM and the vehicle control system.
|
|
4
|
+
|
|
5
|
+
## Configuration
|
|
6
|
+
|
|
7
|
+
We are using scenario_simulator of Autoware (https://github.com/tier4/scenario_simulator_v2). Parameters of user's input corresponds to yaml parameters in the Autoware.
|
|
8
|
+
|
|
9
|
+
This can automatically generate testing scenario and run the docker under the hood. User can observe and interact through RVIZ.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.6,<2.0"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "transportations_library"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="raynbowy23" },
|
|
10
|
+
]
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.8"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Rust",
|
|
15
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
16
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[tool.maturin]
|
|
20
|
+
features = ["pyo3/extension-module"]
|
|
21
|
+
python-source = "python"
|
|
22
|
+
module-name = "transportations_library"
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/crosstraffic/cross-traffic-middleware"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pub mod py_twolanehighways;
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
use transportations_library::{ TwoLaneHighways as LibTwoLaneHighways, Segment as LibSegment, SubSegment as LibSubSegment };
|
|
2
|
+
|
|
3
|
+
#[cfg(feature = "pybindings")]
|
|
4
|
+
use pyo3::prelude::*;
|
|
5
|
+
|
|
6
|
+
#[cfg(feature = "pybindings")]
|
|
7
|
+
#[pyclass]
|
|
8
|
+
#[derive(Debug, Clone)]
|
|
9
|
+
pub struct SubSegment {
|
|
10
|
+
inner: LibSubSegment,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#[cfg(feature = "pybindings")]
|
|
14
|
+
#[pymethods]
|
|
15
|
+
impl SubSegment {
|
|
16
|
+
|
|
17
|
+
#[new]
|
|
18
|
+
pub fn new(length: f64, avg_speed: f64, hor_class: i32, design_rad: f64, central_angle: f64, sup_ele: f64) -> Self {
|
|
19
|
+
SubSegment {
|
|
20
|
+
|
|
21
|
+
inner: LibSubSegment::new(
|
|
22
|
+
length,
|
|
23
|
+
avg_speed,
|
|
24
|
+
hor_class,
|
|
25
|
+
design_rad,
|
|
26
|
+
central_angle,
|
|
27
|
+
sup_ele,
|
|
28
|
+
),
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
pub fn get_length(&self) -> f64 {
|
|
33
|
+
self.inner.get_length()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pub fn get_avg_speed(&self) -> f64 {
|
|
37
|
+
self.inner.get_avg_speed()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub fn get_hor_class(&self) -> i32 {
|
|
41
|
+
self.inner.get_hor_class()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
pub fn get_design_rad(&self) -> f64 {
|
|
45
|
+
self.inner.get_design_rad()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
pub fn get_central_angle(&self) -> f64 {
|
|
49
|
+
self.inner.get_central_angle()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
pub fn get_sup_ele(&self) -> f64 {
|
|
53
|
+
self.inner.get_sup_ele()
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
#[cfg(feature = "pybindings")]
|
|
62
|
+
#[pyclass]
|
|
63
|
+
#[derive(Debug, Clone)]
|
|
64
|
+
pub struct Segment {
|
|
65
|
+
inner: LibSegment,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#[cfg(feature = "pybindings")]
|
|
69
|
+
#[pymethods]
|
|
70
|
+
impl Segment {
|
|
71
|
+
|
|
72
|
+
#[new]
|
|
73
|
+
pub fn new(passing_type: usize, length: f64, grade: f64, spl: f64, is_hc: bool, volume: f64, volume_op: f64, flow_rate: f64, flow_rate_o: f64, capacity: i32,
|
|
74
|
+
ffs: f64, avg_speed: f64, vertical_class: i32, py_subsegments: Vec<SubSegment>, phf: f64, phv: f64, pf: f64, fd: f64, fd_mid: f64, hor_class: i32) -> Self {
|
|
75
|
+
|
|
76
|
+
let subsegments: Vec<LibSubSegment> = py_subsegments.into_iter().map(|py_subseg| py_subseg.inner).collect();
|
|
77
|
+
|
|
78
|
+
Segment {
|
|
79
|
+
inner: LibSegment::new(
|
|
80
|
+
passing_type,
|
|
81
|
+
length,
|
|
82
|
+
grade,
|
|
83
|
+
spl,
|
|
84
|
+
is_hc,
|
|
85
|
+
volume,
|
|
86
|
+
volume_op,
|
|
87
|
+
flow_rate,
|
|
88
|
+
flow_rate_o,
|
|
89
|
+
capacity,
|
|
90
|
+
ffs,
|
|
91
|
+
avg_speed,
|
|
92
|
+
vertical_class,
|
|
93
|
+
subsegments,
|
|
94
|
+
phf,
|
|
95
|
+
phv,
|
|
96
|
+
pf,
|
|
97
|
+
fd,
|
|
98
|
+
fd_mid,
|
|
99
|
+
hor_class,
|
|
100
|
+
),
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
pub fn get_passing_type(&self) -> usize {
|
|
106
|
+
self.inner.get_passing_type()
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
pub fn get_length(&self) -> f64 {
|
|
110
|
+
self.inner.get_length()
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
pub fn get_grade(&self) -> f64 {
|
|
114
|
+
self.inner.get_grade()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
pub fn get_spl(&self) -> f64 {
|
|
118
|
+
self.inner.get_spl()
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
pub fn get_is_hc(&self) -> bool {
|
|
122
|
+
self.inner.get_is_hc()
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
pub fn get_volume(&self) -> f64 {
|
|
126
|
+
self.inner.get_volume()
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
pub fn get_volume_op(&self) -> f64 {
|
|
130
|
+
self.inner.get_volume_op()
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
pub fn get_flow_rate(&self) -> f64 {
|
|
134
|
+
self.inner.get_flow_rate()
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// // pub fn set_flow_rate(&mut self, flow_rate: f64) {
|
|
138
|
+
|
|
139
|
+
// // }
|
|
140
|
+
|
|
141
|
+
pub fn get_flow_rate_o(&self) -> f64 {
|
|
142
|
+
self.inner.get_flow_rate_o()
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// // pub fn set_flow_rate_o(&mut self, flow_rate_o: f64) {
|
|
146
|
+
|
|
147
|
+
// // }
|
|
148
|
+
|
|
149
|
+
pub fn get_capacity(&self) -> i32 {
|
|
150
|
+
self.inner.get_capacity()
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// // pub fn set_capacity(&mut self, capacity: i32) {
|
|
154
|
+
// // self.capacity = capacity
|
|
155
|
+
// // }
|
|
156
|
+
|
|
157
|
+
pub fn get_ffs(&self) -> f64 {
|
|
158
|
+
self.inner.get_ffs()
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// // pub fn set_ffs(&mut self, ffs: f64) {
|
|
162
|
+
// // self.ffs = ffs
|
|
163
|
+
// // }
|
|
164
|
+
|
|
165
|
+
pub fn get_avg_speed(&self) -> f64 {
|
|
166
|
+
self.inner.get_avg_speed()
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// // pub fn set_avg_speed(&mut self, avg_speed: f64) {
|
|
170
|
+
// // self.avg_speed = avg_speed
|
|
171
|
+
// // }
|
|
172
|
+
|
|
173
|
+
// pub fn get_subsegments(&self) -> JsValue {
|
|
174
|
+
// self.subsegs_to_js_value()
|
|
175
|
+
// }
|
|
176
|
+
|
|
177
|
+
pub fn get_subsegments(&self) -> SubSegment {
|
|
178
|
+
self.get_subsegments()
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
pub fn get_vertical_class(&self) -> i32 {
|
|
182
|
+
self.inner.get_vertical_class()
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// // pub fn set_vertical_class(&mut self, vertical_class: i32) {
|
|
186
|
+
// // self.vertical_class = vertical_class
|
|
187
|
+
// // }
|
|
188
|
+
|
|
189
|
+
pub fn get_phf(&self) -> f64 {
|
|
190
|
+
self.inner.get_phf()
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
pub fn get_phv(&self) -> f64 {
|
|
194
|
+
self.inner.get_phv()
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
pub fn get_percent_followers(&self) -> f64 {
|
|
198
|
+
self.inner.get_percent_followers()
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// // pub fn set_percent_followers(&mut self, pf: f64) {
|
|
202
|
+
// // self.pf = pf
|
|
203
|
+
// // }
|
|
204
|
+
|
|
205
|
+
pub fn get_followers_density(&self) -> f64 {
|
|
206
|
+
self.inner.get_followers_density()
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// // pub fn set_followers_density(&mut self, fd: f64) {
|
|
210
|
+
// // self.fd = fd
|
|
211
|
+
// // }
|
|
212
|
+
|
|
213
|
+
pub fn get_followers_density_mid(&self) -> f64 {
|
|
214
|
+
self.inner.get_followers_density_mid()
|
|
215
|
+
}
|
|
216
|
+
pub fn get_hor_class(&self) -> i32 {
|
|
217
|
+
self.inner.get_hor_class()
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
#[cfg(feature = "pybindings")]
|
|
224
|
+
#[pyclass]
|
|
225
|
+
#[derive(Debug, Clone)]
|
|
226
|
+
pub struct TwoLaneHighways{
|
|
227
|
+
inner: LibTwoLaneHighways,
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
#[cfg(feature = "pybindings")]
|
|
231
|
+
#[pymethods]
|
|
232
|
+
impl TwoLaneHighways {
|
|
233
|
+
|
|
234
|
+
#[new]
|
|
235
|
+
pub fn new(py_segments: Vec<Segment>, lane_width: f64, shoulder_width: f64, apd: f64, pmhvfl: f64, l_de: f64) -> Self {
|
|
236
|
+
|
|
237
|
+
let segments: Vec<LibSegment> = py_segments.into_iter().map(|py_seg| py_seg.inner).collect();
|
|
238
|
+
|
|
239
|
+
TwoLaneHighways {
|
|
240
|
+
inner: LibTwoLaneHighways::new(
|
|
241
|
+
segments,
|
|
242
|
+
lane_width,
|
|
243
|
+
shoulder_width,
|
|
244
|
+
apd,
|
|
245
|
+
pmhvfl,
|
|
246
|
+
l_de
|
|
247
|
+
),
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
pub fn get_segments(&self) -> Vec<Segment> {
|
|
252
|
+
self.get_segments()
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
pub fn identify_vertical_class(&mut self, seg_num: usize) -> Vec<f64> {
|
|
256
|
+
let mut _min = 0.0;
|
|
257
|
+
let mut _max = 0.0;
|
|
258
|
+
(_min, _max) = self.inner.identify_vertical_class(seg_num);
|
|
259
|
+
vec![_min, _max]
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
pub fn determine_demand_flow(&mut self, seg_num: usize) -> Vec<f64> {
|
|
263
|
+
let (demand_flow_i , demand_flow_o, capacity) = self.inner.determine_demand_flow(seg_num);
|
|
264
|
+
|
|
265
|
+
vec![demand_flow_i, demand_flow_o, capacity as f64]
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
pub fn determine_vertical_alignment(&mut self, seg_num: usize) -> i32 {
|
|
269
|
+
self.inner.determine_vertical_alignment(seg_num)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
pub fn determine_free_flow_speed(&mut self, seg_num: usize) -> f64 {
|
|
273
|
+
self.inner.determine_free_flow_speed(seg_num)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
pub fn estimate_average_speed(&mut self, seg_num: usize) -> Vec<f64> {
|
|
277
|
+
let (res_s, seg_hor_class) = self.inner.estimate_average_speed(seg_num);
|
|
278
|
+
vec![res_s, seg_hor_class as f64]
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
pub fn estimate_percent_followers(&mut self, seg_num: usize) -> f64 {
|
|
282
|
+
self.inner.estimate_percent_followers(seg_num)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
pub fn estimate_average_speed_sf(&mut self, seg_num: usize, length: f64, vd: f64, phv: f64, rad: f64, sup_ele: f64) -> Vec<f64> {
|
|
286
|
+
let (s, hor_class) = self.inner.estimate_average_speed_sf(seg_num, length, vd, phv, rad, sup_ele);
|
|
287
|
+
vec![s, hor_class as f64]
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
pub fn estimate_percent_followers_sf(&self, seg_num: usize, vd: f64, phv: f64) -> f64 {
|
|
291
|
+
self.inner.estimate_percent_followers_sf(seg_num, vd, phv)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
pub fn determine_follower_density_pl(&mut self, seg_num: usize) -> Vec<f64> {
|
|
295
|
+
let (fd, fd_mid) = self.inner.determine_follower_density_pl(seg_num);
|
|
296
|
+
vec![fd, fd_mid]
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
pub fn determine_follower_density_pc_pz(&mut self, seg_num: usize) -> f64 {
|
|
300
|
+
self.inner.determine_follower_density_pc_pz(seg_num)
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
pub fn determine_adjustment_to_follower_density(&mut self, seg_num: usize) -> f64 {
|
|
304
|
+
self.inner.determine_adjustment_to_follower_density(seg_num)
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
pub fn determine_segment_los(&self, seg_num: usize, s_pl: f64, cap: i32) -> char {
|
|
308
|
+
self.inner.determine_segment_los(seg_num, s_pl, cap)
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
pub fn determine_facility_los(&self, fd: f64, s_pl: f64) -> char {
|
|
312
|
+
self.inner.determine_facility_los(fd, s_pl)
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
#[cfg(feature = "pybindings")]
|
|
318
|
+
#[pymodule]
|
|
319
|
+
fn transportations_library(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|
320
|
+
m.add_class::<SubSegment>()?;
|
|
321
|
+
m.add_class::<Segment>()?;
|
|
322
|
+
m.add_class::<TwoLaneHighways>()?;
|
|
323
|
+
|
|
324
|
+
Ok(())
|
|
325
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pub mod wasm_twolanehighways;
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
use transportations_library::{ TwoLaneHighways, Segment, SubSegment };
|
|
3
|
+
|
|
4
|
+
#[wasm_bindgen]
|
|
5
|
+
#[derive(Debug, Clone)]
|
|
6
|
+
pub struct WasmSubSegment {
|
|
7
|
+
inner: SubSegment,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
#[wasm_bindgen]
|
|
11
|
+
impl WasmSubSegment {
|
|
12
|
+
|
|
13
|
+
#[wasm_bindgen(constructor)]
|
|
14
|
+
pub fn new(length: f64, avg_speed: f64, hor_class: i32, design_rad: f64, central_angle: f64, sup_ele: f64) -> Self {
|
|
15
|
+
WasmSubSegment {
|
|
16
|
+
|
|
17
|
+
inner: SubSegment::new(
|
|
18
|
+
length,
|
|
19
|
+
avg_speed,
|
|
20
|
+
hor_class,
|
|
21
|
+
design_rad,
|
|
22
|
+
central_angle,
|
|
23
|
+
sup_ele,
|
|
24
|
+
),
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
pub fn to_js_value(&self) -> JsValue {
|
|
29
|
+
let obj = js_sys::Object::new();
|
|
30
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("length"), &JsValue::from(self.get_length())).unwrap();
|
|
31
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("avg_speed"), &JsValue::from(self.get_avg_speed())).unwrap();
|
|
32
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("hor_class"), &JsValue::from(self.get_hor_class())).unwrap();
|
|
33
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("design_rad"), &JsValue::from(self.get_design_rad())).unwrap();
|
|
34
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("central_angle"), &JsValue::from(self.get_central_angle())).unwrap();
|
|
35
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("sup_ele"), &JsValue::from(self.get_sup_ele())).unwrap();
|
|
36
|
+
|
|
37
|
+
// Convert the JavaScript object to a JsValue
|
|
38
|
+
JsValue::from(obj)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
pub fn get_length(&self) -> f64 {
|
|
42
|
+
self.inner.get_length()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pub fn get_avg_speed(&self) -> f64 {
|
|
46
|
+
self.inner.get_avg_speed()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
pub fn get_hor_class(&self) -> i32 {
|
|
50
|
+
self.inner.get_hor_class()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
pub fn get_design_rad(&self) -> f64 {
|
|
54
|
+
self.inner.get_design_rad()
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
pub fn get_central_angle(&self) -> f64 {
|
|
58
|
+
self.inner.get_central_angle()
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
pub fn get_sup_ele(&self) -> f64 {
|
|
62
|
+
self.inner.get_sup_ele()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
#[wasm_bindgen]
|
|
69
|
+
#[derive(Debug, Clone)]
|
|
70
|
+
pub struct WasmSegment {
|
|
71
|
+
inner: Segment,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#[wasm_bindgen]
|
|
75
|
+
impl WasmSegment {
|
|
76
|
+
|
|
77
|
+
#[wasm_bindgen(constructor)]
|
|
78
|
+
pub fn new(passing_type: usize, length: f64, grade: f64, spl: f64, is_hc: bool, volume: f64, volume_op: f64, flow_rate: f64, flow_rate_o: f64, capacity: i32,
|
|
79
|
+
ffs: f64, avg_speed: f64, vertical_class: i32, wasm_subsegments: Vec<WasmSubSegment>, phf: f64, phv: f64, pf: f64, fd: f64, fd_mid: f64, hor_class: i32) -> Self {
|
|
80
|
+
|
|
81
|
+
let mut subsegments: Vec<SubSegment> = vec![];
|
|
82
|
+
|
|
83
|
+
for (index, _) in wasm_subsegments.iter().enumerate() {
|
|
84
|
+
|
|
85
|
+
let js_subsegment = wasm_subsegments[index].to_js_value();
|
|
86
|
+
|
|
87
|
+
let subsegment: SubSegment = serde_wasm_bindgen::from_value(js_subsegment).unwrap();
|
|
88
|
+
subsegments.push(subsegment);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
WasmSegment {
|
|
92
|
+
inner: Segment::new(
|
|
93
|
+
passing_type,
|
|
94
|
+
length,
|
|
95
|
+
grade,
|
|
96
|
+
spl,
|
|
97
|
+
is_hc,
|
|
98
|
+
volume,
|
|
99
|
+
volume_op,
|
|
100
|
+
flow_rate,
|
|
101
|
+
flow_rate_o,
|
|
102
|
+
capacity,
|
|
103
|
+
ffs,
|
|
104
|
+
avg_speed,
|
|
105
|
+
vertical_class,
|
|
106
|
+
subsegments,
|
|
107
|
+
phf,
|
|
108
|
+
phv,
|
|
109
|
+
pf,
|
|
110
|
+
fd,
|
|
111
|
+
fd_mid,
|
|
112
|
+
hor_class,
|
|
113
|
+
),
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
pub fn subsegs_to_js_value(&self) -> JsValue {
|
|
119
|
+
let js_array = js_sys::Array::new();
|
|
120
|
+
|
|
121
|
+
let subsegments = self.inner.get_subsegments();
|
|
122
|
+
|
|
123
|
+
for (_, subseg) in subsegments.iter().enumerate() {
|
|
124
|
+
|
|
125
|
+
let obj = js_sys::Object::new();
|
|
126
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("length"), &JsValue::from(subseg.get_length())).unwrap();
|
|
127
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("avg_speed"), &JsValue::from(subseg.get_avg_speed())).unwrap();
|
|
128
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("hor_class"), &JsValue::from(subseg.get_hor_class())).unwrap();
|
|
129
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("design_rad"), &JsValue::from(subseg.get_design_rad())).unwrap();
|
|
130
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("central_angle"), &JsValue::from(subseg.get_central_angle())).unwrap();
|
|
131
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("sup_ele"), &JsValue::from(subseg.get_sup_ele())).unwrap();
|
|
132
|
+
|
|
133
|
+
// Convert the JavaScript object to a JsValue
|
|
134
|
+
js_array.push(&obj);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// for subseg in subsegments {
|
|
138
|
+
// let subseg_js_value = subseg[index].to_js_value();
|
|
139
|
+
|
|
140
|
+
// js_array.push(&subseg_js_value);
|
|
141
|
+
// }
|
|
142
|
+
|
|
143
|
+
JsValue::from(js_array)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
pub fn to_js_value(&self) -> JsValue {
|
|
148
|
+
let obj = js_sys::Object::new();
|
|
149
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("passing_type"), &JsValue::from(self.get_passing_type())).unwrap();
|
|
150
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("length"), &JsValue::from(self.get_length())).unwrap();
|
|
151
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("grade"), &JsValue::from(self.get_grade())).unwrap();
|
|
152
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("spl"), &JsValue::from(self.get_spl())).unwrap();
|
|
153
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("is_hc"), &JsValue::from(self.get_is_hc())).unwrap();
|
|
154
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("volume"), &JsValue::from(self.get_volume())).unwrap();
|
|
155
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("volume_op"), &JsValue::from(self.get_volume_op())).unwrap();
|
|
156
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("flow_rate"), &JsValue::from(self.get_flow_rate())).unwrap();
|
|
157
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("flow_rate_o"), &JsValue::from(self.get_flow_rate_o())).unwrap();
|
|
158
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("capacity"), &JsValue::from(self.get_capacity())).unwrap();
|
|
159
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("ffs"), &JsValue::from(self.get_ffs())).unwrap();
|
|
160
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("avg_speed"), &JsValue::from(self.get_avg_speed())).unwrap();
|
|
161
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("vertical_class"), &JsValue::from(self.get_vertical_class())).unwrap();
|
|
162
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("subsegments"), &self.get_subsegments()).unwrap();
|
|
163
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("phf"), &JsValue::from(self.get_phf())).unwrap();
|
|
164
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("phv"), &JsValue::from(self.get_phv())).unwrap();
|
|
165
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("pf"), &JsValue::from(self.get_percent_followers())).unwrap();
|
|
166
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("fd"), &JsValue::from(self.get_followers_density())).unwrap();
|
|
167
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("fd_mid"), &JsValue::from(self.get_followers_density_mid())).unwrap();
|
|
168
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("hor_class"), &JsValue::from(self.get_hor_class())).unwrap();
|
|
169
|
+
|
|
170
|
+
JsValue::from(obj)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
pub fn get_passing_type(&self) -> usize {
|
|
174
|
+
self.inner.get_passing_type()
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
pub fn get_length(&self) -> f64 {
|
|
178
|
+
self.inner.get_length()
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
pub fn get_grade(&self) -> f64 {
|
|
182
|
+
self.inner.get_grade()
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
pub fn get_spl(&self) -> f64 {
|
|
186
|
+
self.inner.get_spl()
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
pub fn get_is_hc(&self) -> bool {
|
|
190
|
+
self.inner.get_is_hc()
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
pub fn get_volume(&self) -> f64 {
|
|
194
|
+
self.inner.get_volume()
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
pub fn get_volume_op(&self) -> f64 {
|
|
198
|
+
self.inner.get_volume_op()
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
pub fn get_flow_rate(&self) -> f64 {
|
|
202
|
+
self.inner.get_flow_rate()
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// // pub fn set_flow_rate(&mut self, flow_rate: f64) {
|
|
206
|
+
|
|
207
|
+
// // }
|
|
208
|
+
|
|
209
|
+
pub fn get_flow_rate_o(&self) -> f64 {
|
|
210
|
+
self.inner.get_flow_rate_o()
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// // pub fn set_flow_rate_o(&mut self, flow_rate_o: f64) {
|
|
214
|
+
|
|
215
|
+
// // }
|
|
216
|
+
|
|
217
|
+
pub fn get_capacity(&self) -> i32 {
|
|
218
|
+
self.inner.get_capacity()
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// // pub fn set_capacity(&mut self, capacity: i32) {
|
|
222
|
+
// // self.capacity = capacity
|
|
223
|
+
// // }
|
|
224
|
+
|
|
225
|
+
pub fn get_ffs(&self) -> f64 {
|
|
226
|
+
self.inner.get_ffs()
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// // pub fn set_ffs(&mut self, ffs: f64) {
|
|
230
|
+
// // self.ffs = ffs
|
|
231
|
+
// // }
|
|
232
|
+
|
|
233
|
+
pub fn get_avg_speed(&self) -> f64 {
|
|
234
|
+
self.inner.get_avg_speed()
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// // pub fn set_avg_speed(&mut self, avg_speed: f64) {
|
|
238
|
+
// // self.avg_speed = avg_speed
|
|
239
|
+
// // }
|
|
240
|
+
|
|
241
|
+
pub fn get_subsegments(&self) -> JsValue {
|
|
242
|
+
self.subsegs_to_js_value()
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
pub fn get_vertical_class(&self) -> i32 {
|
|
246
|
+
self.inner.get_vertical_class()
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// // pub fn set_vertical_class(&mut self, vertical_class: i32) {
|
|
250
|
+
// // self.vertical_class = vertical_class
|
|
251
|
+
// // }
|
|
252
|
+
|
|
253
|
+
pub fn get_phf(&self) -> f64 {
|
|
254
|
+
self.inner.get_phf()
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
pub fn get_phv(&self) -> f64 {
|
|
258
|
+
self.inner.get_phv()
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
pub fn get_percent_followers(&self) -> f64 {
|
|
262
|
+
self.inner.get_percent_followers()
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// // pub fn set_percent_followers(&mut self, pf: f64) {
|
|
266
|
+
// // self.pf = pf
|
|
267
|
+
// // }
|
|
268
|
+
|
|
269
|
+
pub fn get_followers_density(&self) -> f64 {
|
|
270
|
+
self.inner.get_followers_density()
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// // pub fn set_followers_density(&mut self, fd: f64) {
|
|
274
|
+
// // self.fd = fd
|
|
275
|
+
// // }
|
|
276
|
+
|
|
277
|
+
pub fn get_followers_density_mid(&self) -> f64 {
|
|
278
|
+
self.inner.get_followers_density_mid()
|
|
279
|
+
}
|
|
280
|
+
pub fn get_hor_class(&self) -> i32 {
|
|
281
|
+
self.inner.get_hor_class()
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
#[wasm_bindgen]
|
|
288
|
+
#[derive(Debug, Clone)]
|
|
289
|
+
pub struct WasmTwoLaneHighways{
|
|
290
|
+
inner: TwoLaneHighways,
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
#[wasm_bindgen]
|
|
294
|
+
impl WasmTwoLaneHighways {
|
|
295
|
+
|
|
296
|
+
#[wasm_bindgen(constructor)]
|
|
297
|
+
pub fn new(wasm_segments: Vec<WasmSegment>, lane_width: f64, shoulder_width: f64, apd: f64, pmhvfl: f64, l_de: f64) -> Self {
|
|
298
|
+
|
|
299
|
+
let mut segments: Vec<Segment> = vec![];
|
|
300
|
+
|
|
301
|
+
for (index, _) in wasm_segments.iter().enumerate() {
|
|
302
|
+
|
|
303
|
+
// let cloned_subsegments = wasm_subsegments.clone();
|
|
304
|
+
|
|
305
|
+
let js_segment = wasm_segments[index].to_js_value();
|
|
306
|
+
|
|
307
|
+
let segment: Segment = serde_wasm_bindgen::from_value(js_segment).unwrap();
|
|
308
|
+
segments.push(segment);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
WasmTwoLaneHighways {
|
|
312
|
+
inner: TwoLaneHighways::new(
|
|
313
|
+
segments,
|
|
314
|
+
lane_width,
|
|
315
|
+
shoulder_width,
|
|
316
|
+
apd,
|
|
317
|
+
pmhvfl,
|
|
318
|
+
l_de
|
|
319
|
+
),
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
pub fn segs_to_js_value(&self) -> JsValue {
|
|
324
|
+
let js_array = js_sys::Array::new();
|
|
325
|
+
|
|
326
|
+
let segments = self.inner.get_segments();
|
|
327
|
+
|
|
328
|
+
for (_, seg) in segments.iter().enumerate() {
|
|
329
|
+
let sub_js_array = js_sys::Array::new();
|
|
330
|
+
|
|
331
|
+
let obj = js_sys::Object::new();
|
|
332
|
+
|
|
333
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("passing_type"), &JsValue::from(seg.get_passing_type())).unwrap();
|
|
334
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("length"), &JsValue::from(seg.get_length())).unwrap();
|
|
335
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("grade"), &JsValue::from(seg.get_grade())).unwrap();
|
|
336
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("spl"), &JsValue::from(seg.get_spl())).unwrap();
|
|
337
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("is_hc"), &JsValue::from(seg.get_is_hc())).unwrap();
|
|
338
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("volume"), &JsValue::from(seg.get_volume())).unwrap();
|
|
339
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("volume_op"), &JsValue::from(seg.get_volume_op())).unwrap();
|
|
340
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("flow_rate"), &JsValue::from(seg.get_flow_rate())).unwrap();
|
|
341
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("flow_rate_o"), &JsValue::from(seg.get_flow_rate_o())).unwrap();
|
|
342
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("capacity"), &JsValue::from(seg.get_capacity())).unwrap();
|
|
343
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("ffs"), &JsValue::from(seg.get_ffs())).unwrap();
|
|
344
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("avg_speed"), &JsValue::from(seg.get_avg_speed())).unwrap();
|
|
345
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("vertical_class"), &JsValue::from(seg.get_vertical_class())).unwrap();
|
|
346
|
+
for (_, subseg) in seg.get_subsegments().iter().enumerate() {
|
|
347
|
+
let sub_obj = js_sys::Object::new();
|
|
348
|
+
js_sys::Reflect::set(&sub_obj, &JsValue::from_str("length"), &JsValue::from(subseg.get_length())).unwrap();
|
|
349
|
+
js_sys::Reflect::set(&sub_obj, &JsValue::from_str("avg_speed"), &JsValue::from(subseg.get_avg_speed())).unwrap();
|
|
350
|
+
js_sys::Reflect::set(&sub_obj, &JsValue::from_str("hor_class"), &JsValue::from(subseg.get_hor_class())).unwrap();
|
|
351
|
+
js_sys::Reflect::set(&sub_obj, &JsValue::from_str("design_rad"), &JsValue::from(subseg.get_design_rad())).unwrap();
|
|
352
|
+
js_sys::Reflect::set(&sub_obj, &JsValue::from_str("central_angle"), &JsValue::from(subseg.get_central_angle())).unwrap();
|
|
353
|
+
js_sys::Reflect::set(&sub_obj, &JsValue::from_str("sup_ele"), &JsValue::from(subseg.get_sup_ele())).unwrap();
|
|
354
|
+
sub_js_array.push(&sub_obj);
|
|
355
|
+
}
|
|
356
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("subsegments"), &JsValue::from(sub_js_array)).unwrap();
|
|
357
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("phf"), &JsValue::from(seg.get_phf())).unwrap();
|
|
358
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("phv"), &JsValue::from(seg.get_phv())).unwrap();
|
|
359
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("pf"), &JsValue::from(seg.get_percent_followers())).unwrap();
|
|
360
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("fd"), &JsValue::from(seg.get_followers_density())).unwrap();
|
|
361
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("fd_mid"), &JsValue::from(seg.get_followers_density_mid())).unwrap();
|
|
362
|
+
js_sys::Reflect::set(&obj, &JsValue::from_str("hor_class"), &JsValue::from(seg.get_hor_class())).unwrap();
|
|
363
|
+
|
|
364
|
+
// Convert the JavaScript object to a JsValue
|
|
365
|
+
js_array.push(&obj);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// for subseg in subsegments {
|
|
369
|
+
// let subseg_js_value = subseg[index].to_js_value();
|
|
370
|
+
|
|
371
|
+
// js_array.push(&subseg_js_value);
|
|
372
|
+
// }
|
|
373
|
+
|
|
374
|
+
JsValue::from(js_array)
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
pub fn get_segments(&self) -> JsValue {
|
|
378
|
+
self.segs_to_js_value()
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
pub fn identify_vertical_class(&mut self, seg_num: usize) -> Vec<f64> {
|
|
382
|
+
let mut _min = 0.0;
|
|
383
|
+
let mut _max = 0.0;
|
|
384
|
+
(_min, _max) = self.inner.identify_vertical_class(seg_num);
|
|
385
|
+
vec![_min, _max]
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
pub fn determine_demand_flow(&mut self, seg_num: usize) -> Vec<f64> {
|
|
389
|
+
let (demand_flow_i , demand_flow_o, capacity) = self.inner.determine_demand_flow(seg_num);
|
|
390
|
+
|
|
391
|
+
vec![demand_flow_i, demand_flow_o, capacity as f64]
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
pub fn determine_vertical_alignment(&mut self, seg_num: usize) -> i32 {
|
|
395
|
+
self.inner.determine_vertical_alignment(seg_num)
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
pub fn determine_free_flow_speed(&mut self, seg_num: usize) -> f64 {
|
|
399
|
+
self.inner.determine_free_flow_speed(seg_num)
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
pub fn estimate_average_speed(&mut self, seg_num: usize) -> Vec<f64> {
|
|
403
|
+
let (res_s, seg_hor_class) = self.inner.estimate_average_speed(seg_num);
|
|
404
|
+
vec![res_s, seg_hor_class as f64]
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
pub fn estimate_percent_followers(&mut self, seg_num: usize) -> f64 {
|
|
408
|
+
self.inner.estimate_percent_followers(seg_num)
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
pub fn estimate_average_speed_sf(&mut self, seg_num: usize, length: f64, vd: f64, phv: f64, rad: f64, sup_ele: f64) -> Vec<f64> {
|
|
412
|
+
let (s, hor_class) = self.inner.estimate_average_speed_sf(seg_num, length, vd, phv, rad, sup_ele);
|
|
413
|
+
vec![s, hor_class as f64]
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
pub fn estimate_percent_followers_sf(&self, seg_num: usize, vd: f64, phv: f64) -> f64 {
|
|
417
|
+
self.inner.estimate_percent_followers_sf(seg_num, vd, phv)
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
pub fn determine_follower_density_pl(&mut self, seg_num: usize) -> Vec<f64> {
|
|
421
|
+
let (fd, fd_mid) = self.inner.determine_follower_density_pl(seg_num);
|
|
422
|
+
vec![fd, fd_mid]
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
pub fn determine_follower_density_pc_pz(&mut self, seg_num: usize) -> f64 {
|
|
426
|
+
self.inner.determine_follower_density_pc_pz(seg_num)
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
pub fn determine_adjustment_to_follower_density(&mut self, seg_num: usize) -> f64 {
|
|
430
|
+
self.inner.determine_adjustment_to_follower_density(seg_num)
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
pub fn determine_segment_los(&self, seg_num: usize, s_pl: f64, cap: i32) -> char {
|
|
434
|
+
self.inner.determine_segment_los(seg_num, s_pl, cap)
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
pub fn determine_facility_los(&self, fd: f64, s_pl: f64) -> char {
|
|
438
|
+
self.inner.determine_facility_los(fd, s_pl)
|
|
439
|
+
}
|
|
440
|
+
}
|