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
//! Layer 2 for `additional`: this crate's own domain types for `.add.xml`.
//!
//! Independent of SUMO/XSD, same rationale as `net`'s own `crate::domain`
//! (see the crate docs) — and independent of the other formats' domain
//! types, by design: `additional` doesn't require `net` or `routes` to be
//! enabled, so it can't borrow their types and defines its own [`LaneRef`]
//! 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 detector definitions are modelled: [`E1Detector`] (induction
//! loop), [`E2Detector`] (lane area) and [`E3Detector`] (multi-entry /
//! multi-exit). `additionalType` allows about forty more element kinds —
//! `busStop`, `chargingStation`, `parkingArea`, `rerouter`, `calibrator`,
//! `variableSpeedSign`, `WAUT`, `poly`, `poi`, the whole of `routesType`
//! again, ... — none of which are mapped; [`Additional`] silently drops
//! them (see [`crate::additional::schema_mapper`]).
use ;
use ;
/// Identifier of a detector. A distinct type from a bare `String`, same
/// rationale as `net`'s `crate::domain::EdgeId`.
] pub String);
/// A point in the network's coordinate system, re-exported at this format's
/// own path. This *is* `net`'s `crate::domain::Point`, not a lookalike: the
/// two used to be separate byte-identical structs only because `additional`
/// cannot name a type from `net`, which may not be enabled, and both are now
/// the one definition in a module that is always compiled. Unlike
/// [`LaneRef`] below, nothing was gained by keeping them apart — see the
/// type's own docs.
pub use cratePoint;
/// Identifier of a lane a detector sits on, in the `.net.xml` this
/// `.add.xml` accompanies. Deliberately not `net`'s `crate::domain::LaneId`
/// — see the module docs for why. The two carry the same string ids but
/// aren't the same Rust type, so they can't be mixed up by accident.
] pub String);
/// A position along a lane.
///
/// SUMO encodes the two cases in the sign of one number: a negative `pos`
/// means "measured back from the lane's end". That is spelled out as two
/// variants rather than left as a signed [`Length`] because the difference
/// is not cosmetic — reading a `-12.5` as a distance from the start puts a
/// detector at the wrong end of the road, and nothing about the number
/// itself says so.
///
/// Neither variant is resolved to the other here: doing that needs the
/// lane's length, which lives in the `.net.xml` this format deliberately
/// doesn't require to be loaded alongside.
/// One entry or exit point of an [`E3Detector`], mirroring SUMO's
/// `detEntryExitType`.
/// An induction loop (SUMO's `e1Detector`, also spelled `inductionLoop`): a
/// point detector at a fixed position on a single lane.
/// What an [`E2Detector`] is stretched over: SUMO's mutually exclusive
/// `lane` and `lanes` attributes, as one value that can only hold one of
/// them. Setting both is an error SUMO rejects, and this makes it
/// unrepresentable rather than something each consumer has to check.
/// A lane area detector (SUMO's `e2Detector`, also spelled
/// `laneAreaDetector`): covers a stretch of one lane, or a chain of lanes.
/// A multi-entry / multi-exit detector (SUMO's `e3Detector`, also spelled
/// `entryExitDetector`): an area of the network delimited by
/// [`DetectorGate`]s, measuring whatever is between them.
/// A `.add.xml` file's content, restricted to what this crate models — see
/// the module docs for what's dropped.