You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We then realized that abstracting over constraint types during simulation had immense benefits:
310
+
311
+
- it allows expressing requirements on what constraints need to be enforceable
312
+
- it greatly simplifies the process of validating constraint semantics: instead of having to validate interactions between
313
+
every possible type of constraints, we only have to validate that constraint semantics can be expressed by the abstract
314
+
constraint type
315
+
316
+
We decided the explore the possibility of keeping constraint types distinct in the external API, but lowering these constraints into an intermediary representation internaly. We found a number of downsides:
317
+
318
+
- the public simulation API would still bear the complexity of dealing with many constraint types
319
+
- there would be a need to incrementaly generate internal abstracted constraints to support the incremental API
We tried to improve over the previous proposal by moving the burden of converting many constraints into a common abstraction out of the simulation API. We found that doing so:
324
+
325
+
- reduces the API surface of the train simulation module
326
+
- decouples behavior from constraint types: if a new constraint type needs to be added, the simulation
327
+
API only needs expansion if the expected behavior expected for this constraint isn't part of the API.
328
+
329
+
330
+
## Interpreting driving instructions
331
+
332
+
As the train progresses through the simulation, it reacts according to driving instructions
333
+
which depend on more than the bare train physics state (position, time, and speed):
334
+
335
+
- the behavior of a train on each block depends on the state of the last passed block signal
336
+
- when a train stops at a red signal, then restarts, it may have to keep applying the driving
337
+
instruction from the previous signal until the formerly red light is passed
338
+
339
+
Thus, given:
340
+
341
+
- set of all possible driving instructions (alongside applicability metadata)
342
+
- the result of previous integration steps (which may be extended to hold metadata)
343
+
344
+
There is a need to know what driving instructions are applicable to the current integration step.
217
345
218
346
Overrides are a way of modelling instructions which disable previous ones. Here are some examples:
219
347
@@ -227,6 +355,6 @@ We identified multiple filtering needs:
227
355
228
356
We quickly settled on adding a kind field, but had a lengthy discussion over how to discriminate upstream and downstream signals. We explored the following options:
229
357
230
-
- adding `source` metadata, which was rejected as it does not address the issue of upstream / downstream
231
-
- adding identifiers to instructions, and overriding specific instructions, which was rejected as it makes instruction generation and processing more complex
232
-
- adding some kind of priority / rank field, which was adopted
358
+
-{{< rejected >}} adding `source` metadata, which was rejected as it does not address the issue of upstream / downstream
359
+
-{{< rejected >}} adding identifiers to instructions, and overriding specific instructions, which was rejected as it makes instruction generation and processing more complex
360
+
-{{< adopted >}} adding some kind of priority / rank field, which was adopted
0 commit comments