Conversation
Update unit descriptions in schema files and documentation
gwehrle
left a comment
There was a problem hiding this comment.
For now, I only reviewed Rolling-Stock.md and Runng-Path.md, because these are the definitions. If we cleared all my annotations, I'll review the other files too.
I really like the running path definition a lot! Great effort. Looks much cleaner and more intuitive.
Also, I think it's pretty cool to have some flexibility in defining rolling stock. I added some comments.
Two more general thoughts that apply to multiple definitions:
"An array of at least one"
Should an empty array be invalid? For example, if you comment out or create a scaffold, the file would be invalid.
"model_fidelity"
Is there an advantage to define the model explicit? For me, it would make perfect sense to have an implicit behavior. With traction it could look like this:
There are two ways to define
traction:
- Direct values / table
Attributes Necessity Description rated_powerrequired Rated power of the vehicle (kW). initial_tractive_forcerequired Initial tractive force (kN).
- As list of speed-force pairs
Attributes Necessity Description speedrequired Speed at which the brake effort is applied (km/h) forcerequired Brake force applied at the specified speed (kN)
doc/Rolling-Stock.md
Outdated
| | `schema_version` | required | Version of the JSON schema. | | ||
| | `schema_version` | required | Version of the JSON schema (current version `2024.07`). | | ||
| | `model_fidelity` | required | Level of detail for train dynamics modeling. Values: `simplified`, `detailed`. | | ||
| | `trains` | optional[^1] | An array of [trains](#Attributes-in-trains). | |
There was a problem hiding this comment.
Why is at least one of trains or vehicles required?
It wouldn't make sense, but I think the file should still be valid.
doc/Rolling-Stock.md
Outdated
| | `schema_version` | required | Version of the JSON schema. | | ||
| | `schema_version` | required | Version of the JSON schema (current version `2024.07`). | | ||
| | `model_fidelity` | required | Level of detail for train dynamics modeling. Values: `simplified`, `detailed`. | | ||
| | `trains` | optional[^1] | An array of [trains](#Attributes-in-trains). | |
There was a problem hiding this comment.
Maybe it's better to use a more common word instead of array like list?
There was a problem hiding this comment.
If you agree to change it: There are several appearances. I'll only comment this one.
| ### Model Fidelity Rationale | ||
|
|
||
| The `model_fidelity` attribute specifies the level of detail for train dynamics modeling: | ||
|
|
||
| - `simplified`: Uses basic acceleration and deceleration parameters. Suitable for high-level planning and simple simulations where detailed dynamics are not required. Parameters are defined in `trains.simplified_characteristics`. | ||
|
|
||
| - `detailed`: Uses detailed vehicle parameters including physical properties and effort tables. Appropriate for precise simulations where accurate force calculations are needed. Parameters are defined in `vehicles`. | ||
|
|
||
| A file may contain data for both fidelity levels, but only values from the selected level will be used in calculations. The attribute `model_fidelity` acts as a switch to select which level of detail to use, ensuring that the appropriate parameters are applied based on the chosen fidelity level. | ||
|
|
||
| The `model_fidelity` attribute is not only used at the top level but also plays a crucial role in lower-level objects such as `resistance`, `traction`, and `brakes`. This allows for varying levels of detail in the modeling of these components, ensuring that the appropriate parameters are applied based on the selected fidelity level. | ||
|
|
There was a problem hiding this comment.
I think the paragraph explains very well what the attribute is for.
Personally, however, I consider it to be a mixture of logic and the definition of properties. In my view, it should be the implementation logic of the interpreting program that chooses which model to use for a simulation or similar. I don't think I see model_fidelity as a property of rolling stock.
doc/Rolling-Stock.md
Outdated
| | `id` | required | Identifier of the train. | | ||
| | `description` | optional | Description of the train. | | ||
| | `train_type` | optional | Type of train service. See [Train Types](#train-types) below. | | ||
| | `simplified_characteristics` | optional[^2] | Basic motion parameters when using `simplified_characteristics` model fidelity. See [Simplified Characteristics](#simplified-characteristics) below. | |
There was a problem hiding this comment.
Basic motion parameters when using
simplified_characteristicsmodel fidelity
I think you mean simplified?
doc/Rolling-Stock.md
Outdated
| | `UUID` | optional | The unique identifier for a vehicle. | | ||
| | `vehicle_type` | required | Type of vehicle; values: `traction unit`, `freight`, `passenger`, or `multiple unit`. | | ||
| | `id` | required | Identifier of the vehicle | | ||
| | `vehicle_type` | required | Type of vehicle; values: `traction unit`, `freight`, `passenger`, `multiple unit`, or `non-revenue` | |
There was a problem hiding this comment.
vehicle_types should be snake case. Like long_distance and heavy_freight before
There was a problem hiding this comment.
i keeped the non-revenue and did not change it to non_revenue
doc/Rolling-Stock.md
Outdated
| | `UUID` | optional | The unique identifier for a vehicle. | | ||
| | `vehicle_type` | required | Type of vehicle; values: `traction unit`, `freight`, `passenger`, or `multiple unit`. | | ||
| | `id` | required | Identifier of the vehicle | | ||
| | `vehicle_type` | required | Type of vehicle; values: `traction unit`, `freight`, `passenger`, `multiple unit`, or `non-revenue` | |
There was a problem hiding this comment.
Why is vehicle_type required while train_type is not?
doc/Rolling-Stock.md
Outdated
|
|
||
| | Attributes | Necessity | Description | | ||
| | -------------------- | ------------- | ----------- | | ||
| | `model_fidelity` | required | Type of resistance model; values: `table` or `calculated`. | |
There was a problem hiding this comment.
Is it fidelity or should it be changed to just model?
The implicit behaviour is indeed viable for resistance, traction and brakes. However, I still think it makes sense at the top level. I thought of it as a switch between simplified characteristics and detailed calculations, so that a file can contain both. Does this makes sense? |
c858592 to
6074e7c
Compare
Changelog
Major change:
model_fidelityattribute on different levels for Rolling StockAdded
descriptionattribute (see Issue Running Path Schema - difference between id and uuid #5)trackto characteristic sections for grouping track sectionsgroupsarray to points_of_interest for categorizing pointsdescriptionattribute to trains and vehicles (see Issue Running Path Schema - difference between id and uuid #5)hydraulicandmiscto power_type optionsnon-revenueto vehicle_type optionssimplified_characteristicswith required fields and constraintscoastingparameter to simplified characteristicsemergency_decelerationto simplified characteristicsmodel_fidelityattribute on different levelsChanged
speed,resistance, ortrackattributespoints_of_interestcan now take three values: "front", "middle", and "rear"formationorsimplified_characteristicstrain_typeto include comprehensive list of train service typesRemoved
nameattribute (see Issue Running Path Schema - difference between id and uuid #5)UUIDattribute (see Issue Running Path Schema - difference between id and uuid #5)nameattribute from trains and vehicles (see Issue Running Path Schema - difference between id and uuid #5)UUIDattribute from trains and vehicles (see Issue Running Path Schema - difference between id and uuid #5)dieselfrom power_type options