---
title: "Retrieve the space, speed and time curve of a given train"
method: GET
path: "/train_schedules/{id}/simulation"
tags: ["train_schedule"]
---

# Retrieve the space, speed and time curve of a given train

`GET /train_schedules/{id}/simulation`

## Path parameters

- `id` integer, required

## Query parameters

- `infra_id` integer, required
- `electrical_profile_set_id` integer
- `exception_id` integer

## Response `200`

Simulation Output

- union
  - object
    - `base` CoreReportTrain, required
      - `energy_consumption` number, double, required — Total energy consumption
      - `path_item_times` integer[], required — Time in ms at which the train *arrives* at each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one, the total time of the simulation (end of the path) In case multiple path items are at the same position, the stop duration of the earlier ones are added to the path item time of the next. For example, if A and B are at the same position, and A has a stop duration of 2s, then the path item time of B will be equal to the path item time of A plus 2s.
      - `positions` integer[], required — List of positions of a train Both positions (in mm) and times (in ms) must have the same length
      - `speeds` number[], required — List of speeds associated to a position
      - `times` integer[], required
    - `electrical_profiles` object, required
      - `boundaries` integer[], required — List of `n` boundaries of the ranges (block path). A boundary is a distance from the beginning of the path in mm.
      - `values` union[], required — List of `n+1` values associated to the ranges
        - union
          - object
            - `electrical_profile_type` 'no_profile', required
          - object
            - `electrical_profile_type` 'profile', required
            - `handled` boolean, required
            - `profile` string, nullable
    - `final_output` object, required — Simulation that takes into account the regularity margins and the schedule item times
      - `energy_consumption` number, double, required — Total energy consumption
      - `path_item_times` integer[], required — Time in ms at which the train *arrives* at each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one, the total time of the simulation (end of the path) In case multiple path items are at the same position, the stop duration of the earlier ones are added to the path item time of the next. For example, if A and B are at the same position, and A has a stop duration of 2s, then the path item time of B will be equal to the path item time of A plus 2s.
      - `positions` integer[], required — List of positions of a train Both positions (in mm) and times (in ms) must have the same length
      - `speeds` number[], required — List of speeds associated to a position
      - `times` integer[], required
      - `routing_requirements` CoreRoutingRequirement[], required
        - `begin_time` integer, required — Time in ms since a reference point that depends on which struct embeds this one: - in `TrainRequirements` & `TrainRequirementsById` (conflict detection & timetable requirements): a request-wide origin shared by all trains, `work_schedules` and the response (`1970-01-01T00:00:00Z` for calendar timetables, the timetable start for hourly ones); - in `CompleteReportTrain` (simulation results): the train's own `start_time`.
        - `route` string, required
        - `zones` CoreRoutingZoneRequirement[], required
          - `end_time` integer, required — Time in ms since a reference point that depends on which struct embeds this one: - in `TrainRequirements` & `TrainRequirementsById` (conflict detection & timetable requirements): a request-wide origin shared by all trains, `work_schedules` and the response (`1970-01-01T00:00:00Z` for calendar timetables, the timetable start for hourly ones); - in `CompleteReportTrain` (simulation results): the train's own `start_time`.
          - `entry_detector` string, required
          - `exit_detector` string, required
          - `switches` object, required
          - `zone` string, required
      - `signal_critical_positions` CoreSignalCriticalPosition[], required
        - `position` integer, required — Position in mm
        - `signal` string, required
        - `state` string, required
        - `time` integer, required — Time in ms
      - `spacing_requirements` CoreSpacingRequirement[], required
        - `begin_time` integer, required — Time in ms since a reference point that depends on which struct embeds this one: - in `TrainRequirements` & `TrainRequirementsById` (conflict detection & timetable requirements): a request-wide origin shared by all trains, `work_schedules` and the response (`1970-01-01T00:00:00Z` for calendar timetables, the timetable start for hourly ones); - in `CompleteReportTrain` (simulation results): the train's own `start_time`.
        - `end_time` integer, required — Time in ms: see begin_time
        - `zone` string, required
      - `zone_updates` CoreZoneUpdate[], required
        - `is_entry` boolean, required
        - `position` integer, required
        - `time` integer, required
        - `zone` string, required
    - `mrsp` object, required — A MRSP computation result (Most Restrictive Speed Profile)
      - `boundaries` integer[], required — List of `n` boundaries of the ranges (block path). A boundary is a distance from the beginning of the path in mm.
      - `values` object[], required — List of `n+1` values associated to the ranges
        - `source` union — source of the speed-limit if relevant (tag used)
          - object
            - `speed_limit_source_type` 'given_train_tag', required
            - `tag` string, required
          - object
            - `speed_limit_source_type` 'fallback_tag', required
            - `tag` string, required
          - object
            - `speed_limit_source_type` 'unknown_tag', required
        - `speed` number, double, required — in meters per second
    - `provisional` CoreReportTrain, required
      - `energy_consumption` number, double, required — Total energy consumption
      - `path_item_times` integer[], required — Time in ms at which the train *arrives* at each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one, the total time of the simulation (end of the path) In case multiple path items are at the same position, the stop duration of the earlier ones are added to the path item time of the next. For example, if A and B are at the same position, and A has a stop duration of 2s, then the path item time of B will be equal to the path item time of A plus 2s.
      - `positions` integer[], required — List of positions of a train Both positions (in mm) and times (in ms) must have the same length
      - `speeds` number[], required — List of speeds associated to a position
      - `times` integer[], required
    - `status` 'success', required
  - object
    - `pathfinding_failed` union, required
      - object
        - `error_type` 'invalid_path_items', required
        - `items` object[], required
          - `index` integer, required
          - `path_item` union, required — The location of a path waypoint
            - object
              - …
            - object
              - …
        - `failed_status` 'pathfinding_input_error', required
      - object
        - `error_type` 'not_enough_path_items', required
        - `failed_status` 'pathfinding_input_error', required
      - object
        - `error_type` 'rolling_stock_not_found', required
        - `rolling_stock_name` string, required
        - `failed_status` 'pathfinding_input_error', required
      - object
        - `error_type` 'zero_length_path', required
        - `failed_status` 'pathfinding_input_error', required
      - object
        - `error_type` 'not_found_in_blocks', required
        - `length` integer, required
        - `track_section_ranges` CoreTrackRange[], required
          - `begin` integer, required — The beginning of the range in mm.
          - `direction` 'START_TO_STOP' | 'STOP_TO_START', required
          - `end` integer, required — The end of the range in mm.
          - `track_section` string, required — The track section identifier.
        - `failed_status` 'pathfinding_not_found', required
      - object
        - `error_type` 'not_found_in_routes', required
        - `length` integer, required
        - `track_section_ranges` CoreTrackRange[], required
          - `begin` integer, required — The beginning of the range in mm.
          - `direction` 'START_TO_STOP' | 'STOP_TO_START', required
          - `end` integer, required — The end of the range in mm.
          - `track_section` string, required — The track section identifier.
        - `failed_status` 'pathfinding_not_found', required
      - object
        - `error_type` 'not_found_in_tracks', required
        - `failed_status` 'pathfinding_not_found', required
      - object
        - `error_type` 'incompatible_constraints', required
        - `incompatible_constraints` CoreIncompatibleConstraints, required
          - `incompatible_electrification_ranges` CoreIncompatibleOffsetRangeWithValue[], required
            - `range` CoreOffsetRange, required
              - …
            - `value` string, required
          - `incompatible_gauge_ranges` CoreIncompatibleOffsetRange[], required
            - `range` CoreOffsetRange, required
              - …
          - `incompatible_signaling_system_ranges` CoreIncompatibleOffsetRangeWithValue[], required
            - `range` CoreOffsetRange, required
              - …
            - `value` string, required
        - `relaxed_constraints_path` CorePathfindingResultSuccess, required — A successful pathfinding result. This is also used for STDCM response.
          - `backtrack_path_items` integer[], nullable — The indexes of the path items where the train backtracks
          - `length` integer, required — Length of the path in mm
          - `path` CoreTrainPath, required — A valid train path, as returned from the pathfinding. Can be used as-is as input for other endpoints.
            - `blocks` CoreObjectRange[], required — Block ranges, in order.
              - …
            - `routes` CoreObjectRange[], required — Route ranges, in order.
              - …
            - `track_section_ranges` CoreTrackRange[], required — Track section ranges, in order.
              - …
          - `path_item_positions` integer[], required — The path offset in mm of each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one is always equal to the `length` of the path in mm
        - `failed_status` 'pathfinding_not_found', required
    - `status` 'pathfinding_failed', required
  - object
    - `core_error` InternalError, required
      - `context` object, required
      - `message` string, required
      - `status` integer
      - `type` string, required
    - `status` 'simulation_failed', required

---

[API](https://skmtc.net/openrailassociation/apis/osrd-editoast.md) · [All operations](https://skmtc.net/openrailassociation/apis/osrd-editoast/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openrailassociation/osrd-editoast/versions/1840dbbd64ac/schema)
