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
//! Layer 2 for `routes`: this crate's own domain types for `.rou.xml`.
//!
//! Independent of SUMO/XSD, same rationale as `net`'s own `crate::domain`
//! (see the crate docs) — and independent of `net`'s own domain types too,
//! by design: `routes` doesn't require `net` to be enabled, so it can't
//! borrow `crate::domain::EdgeId` and defines its own [`EdgeRef`] instead.
//!
//! Those cross-format names are code spans, not intra-doc links: `net` may
//! not be enabled, and a link to a feature-gated item is a broken link in
//! every build that leaves that feature off.
//!
//! Only the building blocks of a traffic demand file are modeled:
//! [`Route`], [`VehicleType`], [`Vehicle`], and — read-only, and only its
//! [`Walk`] stages — [`Person`]. `routesType` also allows `flow`, `trip`,
//! `personFlow`, `container`, `containerFlow`, `interval`, `include`,
//! `vTypeDistribution`, and `routeDistribution` elements, none of which are
//! mapped yet — [`Routes`] silently drops them (see
//! [`crate::routes::schema_mapper`]).
use ;
use ;
pub use crateVClass;
/// Identifier of a [`Route`]. A distinct type from a bare `String`, same
/// rationale as `net`'s `crate::domain::EdgeId`.
] pub String);
/// Identifier of a [`VehicleType`] (SUMO's confusingly-named `vType`
/// element — not to be confused with [`Vehicle`], an actual vehicle
/// instance; see that type's docs).
] pub String);
/// Identifier of a [`Vehicle`].
] pub String);
/// Identifier of an edge in the `.net.xml` a route file's [`Route::edges`]
/// refer to. Deliberately not `crate::domain::EdgeId` — see the module
/// docs for why. If both `net` and `routes` are enabled and describe the
/// same network, the two id newtypes carry the same string ids but aren't
/// the same Rust type, so they can't be mixed up by accident.
] pub String);
/// SUMO's `colorType`: either explicit RGBA components or one of SUMO's
/// named colors. Kept as two variants rather than resolving named colors to
/// RGBA: `invisible` and `random` aren't fixed colors to begin with, and
/// this crate doesn't want to guess RGB values for the rest independently
/// of SUMO's own source.
/// The symbolic color names `colorType` accepts as an alternative to RGBA.
/// A named path through the network: an ordered list of edges a [`Vehicle`]
/// can be assigned to by referencing this route's [`RouteId`].
/// A vehicle class definition (SUMO's `vType` element, `vTypeType` in the
/// XSD), shared by every [`Vehicle`] that references it via
/// [`Vehicle::vehicle_type`].
///
/// Only the handful of attributes most consumers care about are modeled.
/// `vTypeType` also has car-following-model parameters (`carFollowing-*`
/// child elements), lane-changing parameters (`lcStrategic`, ...),
/// emission/mass/shape details, and more — none of which are mapped here.
/// When a [`Vehicle`] enters the simulation: a fixed point in time, or one
/// of SUMO's symbolic triggers (`departType`'s non-numeric union member).
/// A single vehicle running a route (SUMO's `vehicle` element,
/// `vehicleType` in the XSD — not to be confused with [`VehicleType`],
/// *this* crate's type for SUMO's `vType`/`vTypeType`, a vehicle *class*
/// definition. The clash is SUMO's own naming, not introduced here).
///
/// Only the attributes covering the common case (a vehicle referencing a
/// pre-defined `vType` and `route` by id) are modeled. `vehicleType` also
/// allows the route to be given inline (a nested `<route>` or
/// `<routeDistribution>` element instead of the `route` attribute), and has
/// arrival/departure lane, position, and speed attributes, none of which
/// are mapped here.
/// Identifier of a [`Person`].
] pub String);
/// One `<walk>` stage of a [`Person`]'s plan (SUMO's `walkType`, nested in
/// `personType`): the edges it covers, however the file expressed them.
/// `walkType`'s `edges`/`from`/`to` are three independently optional
/// attributes at the XSD level, but a real document only ever uses one of
/// two shapes — [`Self::Edges`], an explicit list, or [`Self::Endpoints`]
/// (the common case: every `.rou.xml` in this project's own fixtures writes
/// a walk this way), leaving SUMO's own router to fill in the path between
/// them — so this crate models the real choice directly instead of leaving
/// 3 independent `Option`s a caller has to reconcile itself. Never resolved
/// to the full path here: that needs the road network this crate doesn't
/// necessarily have loaded (`routes` doesn't require `net`) plus a router of
/// its own — a consumer that needs the actual path already needs both.
/// A pedestrian (SUMO's `person` element, `personType` in the XSD).
///
/// Only [`Walk`] stages are modeled, and only for reading — `personType`
/// can also contain `personTrip`, `ride`, and `stop` children, and every
/// attribute on the element itself (`depart`, `arrival`, `color`, ...) is
/// dropped too, same as `Routes` itself drops whole element kinds it
/// doesn't map (see the module docs): nothing in this crate needs more
/// than which edges a pedestrian walks yet. [`crate::routes::schema_writer`]
/// has no `Person` -> `schema` direction at all for the same reason —
/// nothing in this crate writes a `<person>` back out.
/// A `.rou.xml` file's content, restricted to what this crate models — see
/// the module docs for what's dropped.