Skip to content

Improved Version of RailToolKit/schema#23

Open
kaat0 wants to merge 24 commits intomainfrom
development
Open

Improved Version of RailToolKit/schema#23
kaat0 wants to merge 24 commits intomainfrom
development

Conversation

@kaat0
Copy link
Contributor

@kaat0 kaat0 commented Feb 25, 2025

Changelog

Major change:

  • model_fidelity attribute on different levels for Rolling Stock

Added

  • running path:
    • added description attribute (see Issue Running Path Schema - difference between id and uuid #5)
    • added track to characteristic sections for grouping track sections
    • added groups array to points_of_interest for categorizing points
    • added comprehensive test suite with valid and invalid test cases
    • added example file with block sections and signals
  • rolling stock:
    • added description attribute to trains and vehicles (see Issue Running Path Schema - difference between id and uuid #5)
    • added hydraulic and misc to power_type options
    • added non-revenue to vehicle_type options
    • added complete schema for simplified_characteristics with required fields and constraints
    • added coasting parameter to simplified characteristics
    • added emergency_deceleration to simplified characteristics
    • added model_fidelity attribute on different levels
    • added comprehensive brake model configuration with multiple fidelity levels
    • added detailed brake types: eddy_current_brake, electrodynamic_brake, and friction_brake
    • added brake timing parameters: reaction_time, response_time, threshold_time
    • added new train types: snow_removal, construction, emergency
    • added comprehensive documentation for all attributes and model fidelity levels

Changed

  • running path:
  • rolling stock:
    • changed tractive_effort to require at least 3 unique pairs
    • changed rotation_mass description to specify >= 1
    • changed train requirements to need either formation or simplified_characteristics
    • changed train_type to include comprehensive list of train service types
    • changed brake modeling to support multiple fidelity levels
    • changed model_fidelity to be required at top level and component levels
    • refined train_type categories into passenger, freight, and special groups
    • improved documentation with detailed explanations of model fidelity rationale

Removed

@kaat0 kaat0 requested a review from gwehrle February 25, 2025 22:37
Copy link
Collaborator

@gwehrle gwehrle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Direct values / table
Attributes Necessity Description
rated_power required Rated power of the vehicle (kW).
initial_tractive_force required Initial tractive force (kN).
  1. As list of speed-force pairs
Attributes Necessity Description
speed required Speed at which the brake effort is applied (km/h)
force required Brake force applied at the specified speed (kN)

| `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). |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is at least one of trains or vehicles required?
It wouldn't make sense, but I think the file should still be valid.

| `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). |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to use a more common word instead of array like list?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you agree to change it: There are several appearances. I'll only comment this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in 8a048b5

Comment on lines +19 to +30
### 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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do see your point!

| `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. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic motion parameters when using simplified_characteristics model fidelity

I think you mean simplified?

| `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` |
Copy link
Collaborator

@gwehrle gwehrle Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vehicle_types should be snake case. Like long_distance and heavy_freight before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i keeped the non-revenue and did not change it to non_revenue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see issue #26

| `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` |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is vehicle_type required while train_type is not?


| Attributes | Necessity | Description |
| -------------------- | ------------- | ----------- |
| `model_fidelity` | required | Type of resistance model; values: `table` or `calculated`. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it fidelity or should it be changed to just model?

@kaat0 kaat0 mentioned this pull request Aug 25, 2025
@kaat0
Copy link
Contributor Author

kaat0 commented Aug 25, 2025

"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:

  1. Direct values / table

Attributes
Necessity
Description

rated_power
required
Rated power of the vehicle (kW).

initial_tractive_force
required
Initial tractive force (kN).

  1. As list of speed-force pairs

Attributes
Necessity
Description

speed
required
Speed at which the brake effort is applied (km/h)

force
required
Brake force applied at the specified speed (kN)

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?

@kaat0 kaat0 force-pushed the development branch 2 times, most recently from c858592 to 6074e7c Compare August 25, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants