@@ -121,31 +121,46 @@ labels: ["INOUI", "TCHOU"]
121
121
# used to select speed limits for simulation
122
122
speed_limit_tags : ["MA100"]
123
123
124
- # the departure time has to have a timezone
125
- # all durations and times are specified using ISO 8601
126
- departure_time : " 2023-12-21T08:51:11.914897+00:00"
124
+ # the start time is an ISO 8601 datetime with timezone. it is not always the
125
+ # same at the departure time, as there may be a stop at the starting point
126
+ start_time : " 2023-12-21T08:51:11.914897+00:00"
127
127
128
128
path :
129
- - {id: a, waypoint: true, uic: 87210}
129
+ - {id: a, uic: 87210}
130
130
- {id: b, track: foo, offset: 10}
131
- - {id: c, deleted: true, waypoint: true, trigram: ABC}
132
- - {id: d, waypoint: true, operational_point: operational_point.id}
133
-
134
- # the algorithm used for computing the standard margins AND scheduled points
135
- distribution_margins : MARECO
131
+ - {id: c, deleted: true, trigram: ABC}
132
+ - {id: d, operational_point: X}
136
133
137
- standard_margins :
138
- # the begin and end waypoints are always implicitly added
139
- intermediate_waypoints : [b]
140
- values : ["5%", "2%"]
134
+ # the algorithm used for distributing margins and scheduled times
135
+ constraint_distribution : MARECO
141
136
142
137
# all durations and times are specified using ISO 8601
143
- scheduled_points :
144
- - {at: a, arrival: PT0M, stop_for: PT5M}
145
- - {at: b, arrival: PT10M}
146
- - {at: c, arrival: PT25M}
147
-
148
- # train speed at departure, in meters per second
138
+ # times are defined as time elapsed since start. Even if the attribute is omitted,
139
+ # a scheduled point at the starting point is infered to have departure=start_time
140
+ # the "locked" flag is ignored by the backend.
141
+ schedule :
142
+ - {at: a, stop_for: PT5M, locked: true} # infered arrival to be equal to start_time
143
+ - {at: b, arrival: PT10M, departure: PT15M} # equivalent to a 5m stop
144
+ - {at: c, stop_for: PT5M}
145
+ - {at: d, arrival: PT50M, locked: true}
146
+
147
+ margins :
148
+ # This example encodes the following margins:
149
+ # a --- 5% --- b --- 3% --- d
150
+
151
+ # /!\ all schedule points with either an arrival or departure time must also be
152
+ # margin boundaries. departure and arrival waypoints are implicit boundaries. /!\
153
+ # boundaries delimit margin sections. A list of N boundaries yields N + 1 sections.
154
+ boundaries : [b]
155
+
156
+ # the following units are supported:
157
+ # - 0 is a special value which indicates no margin. It's the default
158
+ # - % means added percentage of the base simulation time
159
+ # - min/km means minutes per kilometers
160
+ values : ["5%", "3%"]
161
+
162
+ # train speed at simulation start, in meters per second.
163
+ # must be zero if the train starts at a stop
149
164
initial_speed : 2.5
150
165
151
166
power_restrictions :
@@ -157,6 +172,57 @@ options:
157
172
use_electrical_profiles : true
158
173
` ` `
159
174
175
+
176
+ # Combining margins and schedule
177
+
178
+ Margins and scheduled points are two ways to add time constraints to a train's schedule.
179
+ Therefore, there most be a clear set of rules to figure out how these two interfaces interact.
180
+
181
+ Their interaction is defined as follows:
182
+
183
+ - The path is subdivided into **known time sections**, which are separated by locations where
184
+ an arrival or departure time is known. If the is no known arrival time at destination, a
185
+ **relaxed time section** is created between the end of the last known time section and the arrival
186
+ location.
187
+ - Margin boundaries separate margin section. Margin sections cover the entire path.
188
+ - Margin sections are grouped by known time section. It can only be done because
189
+ **margins are not allowed to cross known time section boundaries**.
190
+
191
+ **The end goal is to compute a target time loss per margin section**.
192
+
193
+
194
+ ## Computing a target time loss per margin section
195
+
196
+ The target time loss is computed as follows:
197
+
198
+ - A **base simulation** is computed, without any time constraint whatsoever.
199
+ - For each margin section, a provisional target time loss is computed based on the margin value and the base simulation.
200
+ The timetable that would be achieved if a train were to achieve these targets is called the **standard working**.
201
+ - For each known time section:
202
+ - compute the standard working trip duration for each margin section
203
+ - compute the total standard working trip duration for the known time section
204
+ - compute the difference between the standard working trip duration and the expected trip duration for the known time section.
205
+ This value is known as the schedule point impact.
206
+ - correct the provisional target time loss of margin sections by distributing the schedule point impact proportionally
207
+ to the standard working trip duration of each margin sections. The result is the target time loss.
208
+ - at this point, if the target time loss is negative on any section, it cannot be computed, and an
209
+ error is returned
210
+
211
+
212
+ ## Impossible margins
213
+
214
+ It may occur that a target time loss cannot be achieved:
215
+
216
+ - it can be too low, as transitions from high density margin to low margin section force the train to loose
217
+ time after it has exited to high density margin section.
218
+ - it can also be too high, as the train may not have time to slow down enough, or drive so slow as to be
219
+ unacceptable.
220
+
221
+ During simulation, if a target time loss cannot be achieved, the error value is added to the target time loss
222
+ of the following section. This is a best effort measure to preserve scheduled points time targets despite failing
223
+ margins.
224
+
225
+
160
226
## Endpoints
161
227
162
228
` ` `
0 commit comments