From f10d20b0b1a33448f11a18c1fda0e9275749a09b Mon Sep 17 00:00:00 2001 From: Martin Scheidt Date: Fri, 6 May 2022 00:26:25 +0200 Subject: [PATCH] Updated path schema to 2022.05 --- src/types.jl | 141 ++++--- test/data/paths/const.yaml | 36 +- test/data/paths/realworld.yaml | 718 +++++++++++++++++---------------- test/data/paths/slope.yaml | 52 +-- test/data/paths/speed.yaml | 52 +-- 5 files changed, 526 insertions(+), 473 deletions(-) diff --git a/src/types.jl b/src/types.jl index 8f9de9b..b457958 100644 --- a/src/types.jl +++ b/src/types.jl @@ -110,6 +110,7 @@ end #struct Settings Path is a datastruture for calculation context. The function Path() will create a running path for the train. +Supported formats are: railtoolkit/schema (2022.05) # Example ```jldoctest @@ -141,68 +142,112 @@ struct Path ## load from file if type == :YAML - path = YAML.load(open(file))["path"] + data = YAML.load(open(file)) + if data["schema"] != "https://railtoolkit.org/schema/running-path.json" + error("Could not load path file '$file'.\n + YAML format is not recognized. + Currently supported: railtoolkit/schema/running-path (2022.05)") + end + if data["schema_schema"] != "2022.05" + error("Could not load path file '$file'.\n + YAML format is not recognized. + Currently supported: railtoolkit/schema/running-path (2022.05)") + end ## JSON schema for YAML-file validation railtoolkit_schema = Schema("""{ - "required": [ "name", "id", "characteristic_sections" ], + "required": [ "schema", "schema_version", "paths" ], "properties": { - "characteristic_sections": { - "description": "", - "type": "array", - "minItems": 2, - "uniqueItems": true, - "items": { - "type": "array", - "minItems": 3, - "maxItems": 3, - "description": "", - "prefixItems": [ - { "type": "number" }, - { "type": "number" }, - { "type": "number" } - ] - } - }, - "id": { - "description": "Identifier of the path", - "type": "string" - }, - "name": { - "description": "Name of the path", - "type": "string" - }, - "points_of_interest": { - "description": "", - "type": "array", - "uniqueItems": true, - "items": { - "type": "array", - "minItems": 3, - "maxItems": 3, - "description": "", - "prefixItems": [ - { "type": "number" }, - { "type": "string" }, - { "enum": [ "front", "rear" ] } - ] - } - }, - "UUID": { - "description": "The unique identifier for a path", + "schema": { + "description": "Identifier of the schema", + "enum": [ "https://railtoolkit.org/schema/running-path.json" ] + }, + "schema_version": { + "description": "Version of the schema", "type": "string", - "format": "uuid" + "pattern": "[2-9][0-9][0-9][0-9].[0-1][0-9]" + }, + "paths": { + "type": "array", + "minItems": 1, + "items": { + "required": [ "name", "id", "characteristic_sections" ], + "type": "object", + "properties": { + "characteristic_sections": { + "description": "", + "type": "array", + "minItems": 2, + "uniqueItems": true, + "items": { + "type": "array", + "minItems": 3, + "maxItems": 3, + "description": "", + "prefixItems": [ + { + "description": "milage in meter", + "type": "number" + }, + { + "description": "speed in kilometers per hour", + "type": "number", + "exclusiveMinimum": 0 + }, + { + "description": "resistance in permil", + "type": "number" + } + ] + } + }, + "id": { + "description": "Identifier of the path", + "type": "string" + }, + "name": { + "description": "Name of the path", + "type": "string" + }, + "points_of_interest": { + "description": "", + "type": "array", + "uniqueItems": true, + "items": { + "type": "array", + "minItems": 3, + "maxItems": 3, + "description": "", + "prefixItems": [ + { "type": "number" }, + { "type": "string" }, + { "enum": [ "front", "rear" ] } + ] + } + }, + "UUID": { + "description": "The unique identifier for a path", + "type": "string", + "format": "uuid" + } + } } + } } }""") + paths = data["paths"] try - validate(railtoolkit_schema, path) + validate(railtoolkit_schema, paths) catch err error("Could not load path file '$file'.\n YAML format is not recognized. - Currently supported: railtoolkit/schema (2022.04)") + Currently supported: railtoolkit/schema/running-path (2022.05)") end + if length(paths) > 1 + println("WARNING: the loaded file contains more than one path. Using only the first!") + end + path = paths[1] ## set the variables if they exist in "settings" # required diff --git a/test/data/paths/const.yaml b/test/data/paths/const.yaml index 94ec59e..9511d70 100644 --- a/test/data/paths/const.yaml +++ b/test/data/paths/const.yaml @@ -1,19 +1,21 @@ %YAML 1.2 --- -path: - name: "10 km, no gradient, 160 km/h" - id: const - UUID: 23ff336e-9b9a-4535-bdb6-9db488b10945 - points_of_interest: - # [ station in m, name, front or rear ] - - [ 999.00, point_1, front ] - - [ 2000.00, point_2, front ] - - [ 3333.30, point_3, rear ] - - [ 5000.00, point_4, front ] - - [ 7777.00, point_5, front ] - - [ 9000.00, point_6, front ] - - [ 9500.95, point_7, front ] - characteristic_sections: - # [ station in m, speed limit in km/h, resistance in ‰ ] - - [ 0.0, 160, 0.00 ] - - [ 10000.0, 160, 0.00 ] +schema: https://railtoolkit.org/schema/running-path.json +schema_version: "2022.05" +paths: + - name: "10 km, no gradient, 160 km/h" + id: const + UUID: 23ff336e-9b9a-4535-bdb6-9db488b10945 + points_of_interest: + # [ station in m, name, front or rear ] + - [ 999.00, point_1, front ] + - [ 2000.00, point_2, front ] + - [ 3333.30, point_3, rear ] + - [ 5000.00, point_4, front ] + - [ 7777.00, point_5, front ] + - [ 9000.00, point_6, front ] + - [ 9500.95, point_7, front ] + characteristic_sections: + # [ station in m, speed limit in km/h, resistance in ‰ ] + - [ 0.0, 160, 0.00 ] + - [ 10000.0, 160, 0.00 ] diff --git a/test/data/paths/realworld.yaml b/test/data/paths/realworld.yaml index f8d7925..e19b325 100644 --- a/test/data/paths/realworld.yaml +++ b/test/data/paths/realworld.yaml @@ -1,360 +1,362 @@ %YAML 1.2 --- -path: - name: "'infra_Ostsachsen': track id='tr_80.6212_2' name='DG-DN' -> spp_5" - id: realworld - UUID: 2b31a0c5-85bc-4721-b7e0-66f9df95f7b6 - # source: https://www.railml.org/en/user/exampledata.html - # -> "Real world railway examples from professional tools" - # -> "East Saxony railway network by FBS" - # -> "Ostsachsen_V220.railml" - # -> 'infra_Ostsachsen': track id='tr_80.6212_2' name='DG-DN' -> spp_5 - characteristic_sections: - # [ s in m, v_limit in km/h, f_Rp in ‰ ] - - [ 0.0, 40, 0.0 ] - - [ 318.0, 40, 2.0 ] - - [ 399.0, 40, -3.0 ] - - [ 500.0, 40, 0.0 ] - - [ 579.0, 40, 1.0 ] - - [ 784.0, 40, 5.3 ] - - [ 868.0, 40, 20.0 ] - - [ 1082.0, 40, 16.1 ] - - [ 1287.0, 40, 18.1 ] - - [ 1800.0, 110, 18.1 ] - - [ 2242.0, 110, 15.4 ] - - [ 3295.0, 110, 11.0 ] - - [ 3880.0, 110, 11.1 ] - - [ 4680.0, 45, 11.1 ] - - [ 4686.0, 90, 11.1 ] - - [ 6122.0, 90, 0.0 ] - - [ 6487.0, 90, 1.5 ] - - [ 6588.0, 70, 1.5 ] - - [ 6589.0, 70, 2.4 ] - - [ 6608.0, 130, 2.4 ] - - [ 6723.0, 150, 1.3 ] - - [ 6928.0, 160, 1.3 ] - - [ 7030.0, 160, 7.5 ] - - [ 7300.0, 160, 8.0 ] - - [ 7552.0, 160, 5.0 ] - - [ 7675.0, 160, 6.7 ] - - [ 7800.0, 160, 7.4 ] - - [ 7920.0, 160, 7.0 ] - - [ 8020.0, 140, 7.0 ] - - [ 8100.0, 140, 6.3 ] - - [ 8168.0, 140, 7.4 ] - - [ 8226.0, 140, 8.4 ] - - [ 8300.0, 140, 7.4 ] - - [ 8381.0, 150, 7.4 ] - - [ 8600.0, 150, 7.8 ] - - [ 8900.0, 150, 6.7 ] - - [ 9100.0, 150, 7.8 ] - - [ 9600.0, 150, 8.0 ] - - [ 9845.0, 150, 7.3 ] - - [ 10005.0, 160, 7.3 ] - - [ 10600.0, 160, 6.0 ] - - [ 10748.0, 160, 7.3 ] - - [ 11100.0, 160, 4.5 ] - - [ 11280.0, 160, 3.6 ] - - [ 11450.0, 160, 7.2 ] - - [ 11800.0, 160, 6.8 ] - - [ 12100.0, 160, 7.3 ] - - [ 12590.0, 160, 7.6 ] - - [ 13100.0, 160, 7.3 ] - - [ 13500.0, 160, 7.1 ] - - [ 13800.0, 160, 7.3 ] - - [ 14138.0, 150, 7.3 ] - - [ 14330.0, 150, 0.3 ] - - [ 14640.0, 150, -1.8 ] - - [ 14764.0, 160, -2.8 ] - - [ 15000.0, 160, -3.3 ] - - [ 15500.0, 160, -0.9 ] - - [ 16000.0, 160, 0.0 ] - - [ 16470.0, 160, 1.2 ] - - [ 16572.0, 160, 2.2 ] - - [ 16700.0, 160, 3.8 ] - - [ 16949.0, 160, 3.5 ] - - [ 17086.0, 160, 3.2 ] - - [ 17232.0, 160, 1.3 ] - - [ 17339.0, 160, 4.5 ] - - [ 17406.0, 160, 3.4 ] - - [ 17727.0, 150, 3.4 ] - - [ 17807.0, 150, 4.6 ] - - [ 18049.0, 150, 3.0 ] - - [ 18210.0, 140, 3.0 ] - - [ 18300.0, 140, 4.6 ] - - [ 18680.0, 140, 3.2 ] - - [ 18761.0, 150, 3.2 ] - - [ 19047.0, 150, 5.1 ] - - [ 19305.0, 150, 3.0 ] - - [ 19406.0, 160, 3.0 ] - - [ 19414.0, 160, -0.3 ] - - [ 19900.0, 160, 3.0 ] - - [ 20150.0, 160, 1.8 ] - - [ 20470.0, 160, -4.0 ] - - [ 20940.0, 160, -3.6 ] - - [ 21150.0, 160, -1.5 ] - - [ 21390.0, 160, 0.0 ] - - [ 21702.0, 160, 1.5 ] - - [ 22188.0, 150, 1.5 ] - - [ 22294.0, 150, 1.8 ] - - [ 22383.0, 160, 1.8 ] - - [ 22500.0, 160, 2.6 ] - - [ 22900.0, 160, 4.6 ] - - [ 23542.0, 160, 0.2 ] - - [ 23736.0, 160, 0.9 ] - - [ 24124.0, 160, 7.0 ] - - [ 24918.0, 160, 7.6 ] - - [ 25100.0, 150, 7.1 ] - - [ 25580.0, 150, 7.4 ] - - [ 25708.0, 160, 7.4 ] - - [ 25810.0, 160, 7.1 ] - - [ 26040.0, 160, 3.2 ] - - [ 26330.0, 160, 1.8 ] - - [ 26593.0, 160, 2.1 ] - - [ 27020.0, 160, 3.5 ] - - [ 27195.0, 160, 5.8 ] - - [ 27253.0, 160, 1.1 ] - - [ 27310.0, 160, 3.5 ] - - [ 27595.0, 160, 3.4 ] - - [ 28530.0, 160, 4.6 ] - - [ 29115.0, 160, 0.0 ] - - [ 29700.0, 160, -5.2 ] - - [ 30055.0, 120, -4.3 ] - - [ 30301.0, 120, -6.2 ] - - [ 30487.0, 160, -6.2 ] - - [ 30537.0, 160, -4.8 ] - - [ 31130.0, 160, -0.3 ] - - [ 31293.0, 160, 3.7 ] - - [ 31400.0, 160, 2.9 ] - - [ 31640.0, 160, 4.1 ] - - [ 31795.0, 120, 4.1 ] - - [ 32010.0, 120, 3.2 ] - - [ 32138.0, 130, 3.2 ] - - [ 32365.0, 130, -4.0 ] - - [ 33000.0, 130, 6.1 ] - - [ 33426.0, 160, 6.1 ] - - [ 33907.0, 160, 7.1 ] - - [ 34220.0, 160, 8.4 ] - - [ 34300.0, 160, 7.9 ] - - [ 34440.0, 160, 7.1 ] - - [ 34610.0, 160, 4.4 ] - - [ 35000.0, 160, 5.6 ] - - [ 35173.0, 150, 5.6 ] - - [ 35400.0, 150, -0.2 ] - - [ 35597.0, 160, -0.2 ] - - [ 35900.0, 160, 0.0 ] - - [ 36700.0, 160, 3.9 ] - - [ 36938.0, 160, 0.0 ] - - [ 37700.0, 160, -0.3 ] - - [ 37978.0, 150, -5.6 ] - - [ 38063.0, 150, -1.9 ] - - [ 38141.0, 150, -3.1 ] - - [ 38210.0, 150, 0.0 ] - - [ 38406.0, 150, -7.0 ] - - [ 38900.0, 150, -7.5 ] - - [ 39200.0, 150, -8.7 ] - - [ 39298.0, 150, -6.4 ] - - [ 39476.0, 150, -7.2 ] - - [ 40400.0, 150, -6.9 ] - - [ 40676.0, 130, -6.9 ] - - [ 41000.0, 130, -7.3 ] - - [ 41406.0, 130, -7.5 ] - - [ 41571.0, 160, -7.3 ] - - [ 41816.0, 160, -6.8 ] - - [ 41923.0, 160, -7.1 ] - - [ 42139.0, 160, -1.3 ] - - [ 42343.0, 160, -2.4 ] - - [ 42432.0, 150, -2.4 ] - - [ 42952.0, 160, -2.4 ] - - [ 43000.0, 160, -4.6 ] - - [ 43264.0, 160, -2.5 ] - - [ 43388.0, 160, -0.6 ] - - [ 43700.0, 160, 0.8 ] - - [ 44030.0, 160, 2.7 ] - - [ 44430.0, 160, 0.0 ] - - [ 44708.0, 160, -7.2 ] - - [ 45477.0, 160, -7.8 ] - - [ 45890.0, 160, -1.0 ] - - [ 46562.0, 160, -1.6 ] - - [ 47000.0, 160, -6.9 ] - - [ 47500.0, 160, -7.7 ] - - [ 47800.0, 160, -6.8 ] - - [ 48700.0, 160, -4.3 ] - - [ 49218.0, 160, -5.3 ] - - [ 49514.0, 160, -2.5 ] - - [ 50000.0, 160, -2.2 ] - - [ 51150.0, 160, -5.7 ] - - [ 51406.0, 160, -6.3 ] - - [ 51710.0, 150, -5.8 ] - - [ 52000.0, 150, -6.7 ] - - [ 52215.0, 150, -6.1 ] - - [ 53213.0, 150, -6.8 ] - - [ 53567.0, 150, -5.6 ] - - [ 53943.0, 150, -6.5 ] - - [ 54129.0, 140, -6.5 ] - - [ 54212.0, 140, -10.5 ] - - [ 54247.0, 140, -5.4 ] - - [ 54326.0, 140, -6.1 ] - - [ 54450.0, 140, -6.5 ] - - [ 54482.0, 120, -6.5 ] - - [ 54550.0, 120, -6.2 ] - - [ 54855.0, 140, -6.2 ] - - [ 55307.0, 140, -0.3 ] - - [ 55651.0, 140, -1.2 ] - - [ 55788.0, 140, 0.0 ] - - [ 55918.0, 100, 0.0 ] - - [ 56433.0, 150, 0.0 ] - - [ 56560.0, 150, -2.1 ] - - [ 56624.0, 150, -6.7 ] - - [ 57012.0, 150, 1.3 ] - - [ 57260.0, 150, 6.6 ] - - [ 57800.0, 150, 5.3 ] - - [ 57987.0, 150, 0.0 ] - - [ 57990.0, 150, 7.6 ] - - [ 58321.0, 150, 6.4 ] - - [ 59090.0, 150, 6.9 ] - - [ 59468.0, 150, 9.2 ] - - [ 59600.0, 150, 0.2 ] - - [ 60683.0, 150, 4.1 ] - - [ 61156.0, 150, 2.3 ] - - [ 61181.0, 130, 2.3 ] - - [ 61325.0, 130, 0.0 ] - - [ 61605.0, 130, 7.3 ] - - [ 62108.0, 150, 7.3 ] - - [ 62246.0, 150, 6.6 ] - - [ 62279.0, 150, 5.1 ] - - [ 62454.0, 150, 0.9 ] - - [ 62777.0, 150, 5.5 ] - - [ 63802.0, 150, 4.6 ] - - [ 64344.0, 150, 0.2 ] - - [ 64932.0, 150, -0.6 ] - - [ 65100.0, 150, 0.0 ] - - [ 65690.0, 150, 1.8 ] - - [ 65878.0, 150, 2.5 ] - - [ 66266.0, 150, -1.0 ] - - [ 66339.0, 150, 6.3 ] - - [ 66448.0, 160, 6.3 ] - - [ 66587.0, 160, 0.0 ] - - [ 66856.0, 160, 3.2 ] - - [ 67480.0, 160, 3.6 ] - - [ 67697.0, 160, 2.2 ] - - [ 67800.0, 160, 6.0 ] - - [ 67851.0, 130, 6.0 ] - - [ 68027.0, 130, 2.7 ] - - [ 68172.0, 130, 0.6 ] - - [ 68328.0, 130, 2.5 ] - - [ 68357.0, 130, 0.0 ] - - [ 68479.0, 130, 7.1 ] - - [ 68783.0, 130, 7.4 ] - - [ 69056.0, 150, 7.4 ] - - [ 69500.0, 150, 6.8 ] - - [ 69741.0, 160, 6.8 ] - - [ 69900.0, 160, 6.6 ] - - [ 70757.0, 160, 3.6 ] - - [ 71384.0, 160, 6.0 ] - - [ 71568.0, 160, 7.1 ] - - [ 71800.0, 160, 7.4 ] - - [ 72100.0, 160, 7.3 ] - - [ 73919.0, 150, 7.3 ] - - [ 74317.0, 140, 7.3 ] - - [ 74448.0, 140, 1.5 ] - - [ 74590.0, 140, -1.5 ] - - [ 74620.0, 140, -5.0 ] - - [ 74950.0, 140, -4.3 ] - - [ 75100.0, 140, -1.8 ] - - [ 75154.0, 130, -1.8 ] - - [ 75260.0, 130, -6.2 ] - - [ 75873.0, 130, -5.6 ] - - [ 76062.0, 100, -5.6 ] - - [ 76100.0, 100, -6.4 ] - - [ 76350.0, 100, -5.7 ] - - [ 76476.0, 100, -7.0 ] - - [ 76600.0, 100, -6.4 ] - - [ 76601.0, 90, -6.4 ] - - [ 76726.0, 90, -6.2 ] - - [ 77256.0, 90, -2.1 ] - - [ 77285.0, 80, -2.1 ] - - [ 77299.0, 80, -14.0 ] - - [ 77331.0, 80, -1.6 ] - - [ 77379.0, 90, -1.6 ] - - [ 77425.0, 110, -1.6 ] - - [ 77455.0, 110, -4.9 ] - - [ 77498.0, 110, 0.0 ] - - [ 77505.0, 160, 0.0 ] - - [ 77555.0, 160, -5.6 ] - - [ 77662.0, 160, 0.0 ] - - [ 78085.0, 160, -4.0 ] - - [ 78223.0, 160, -6.8 ] - - [ 78337.0, 130, -6.8 ] - - [ 78856.0, 130, -6.6 ] - - [ 78875.0, 130, -7.2 ] - - [ 79345.0, 150, -7.2 ] - - [ 79600.0, 150, -6.5 ] - - [ 79792.0, 150, -0.2 ] - - [ 80537.0, 150, -5.2 ] - - [ 81300.0, 150, -4.8 ] - - [ 81634.0, 110, -4.8 ] - - [ 81943.0, 110, -5.4 ] - - [ 82166.0, 110, 0.0 ] - - [ 82408.0, 110, 4.8 ] - - [ 82790.0, 110, 5.9 ] - - [ 83137.0, 120, 5.9 ] - - [ 83300.0, 120, 0.0 ] - - [ 83519.0, 150, 0.0 ] - - [ 83597.0, 150, -7.8 ] - - [ 83827.0, 150, -8.1 ] - - [ 84150.0, 150, -7.2 ] - - [ 84391.0, 150, 0.0 ] - - [ 84966.0, 150, -4.0 ] - - [ 85529.0, 130, -2.3 ] - - [ 85589.0, 130, -4.0 ] - - [ 86081.0, 130, 0.0 ] - - [ 86514.0, 130, 7.8 ] - - [ 86577.0, 120, 7.8 ] - - [ 87554.0, 90, 7.8 ] - - [ 87690.0, 90, 7.9 ] - - [ 87842.0, 90, 1.7 ] - - [ 88007.0, 110, 1.7 ] - - [ 88100.0, 110, 3.4 ] - - [ 88260.0, 110, 5.3 ] - - [ 88376.0, 160, 5.3 ] - - [ 88450.0, 160, 6.7 ] - - [ 89050.0, 160, 7.4 ] - - [ 89350.0, 160, -7.1 ] - - [ 90365.0, 160, 0.0 ] - - [ 90700.0, 160, -7.3 ] - - [ 92000.0, 160, -7.9 ] - - [ 92166.0, 160, -4.0 ] - - [ 92460.0, 160, -5.4 ] - - [ 93330.0, 160, 0.0 ] - - [ 93901.0, 160, 0.7 ] - - [ 94156.0, 160, 5.2 ] - - [ 94440.0, 160, -2.8 ] - - [ 94530.0, 160, -0.8 ] - - [ 94630.0, 160, -6.8 ] - - [ 94830.0, 160, -4.4 ] - - [ 95090.0, 160, -4.6 ] - - [ 95500.0, 160, -4.8 ] - - [ 96500.0, 160, -4.4 ] - - [ 96700.0, 160, -5.6 ] - - [ 97000.0, 160, -4.6 ] - - [ 97590.0, 160, 0.0 ] - - [ 97858.0, 120, 0.0 ] - - [ 98224.0, 120, -1.5 ] - - [ 98264.0, 120, 0.0 ] - - [ 98577.0, 120, 7.5 ] - - [ 98738.0, 120, 0.0 ] - - [ 99055.0, 130, 0.0 ] - - [ 99427.0, 130, -2.0 ] - - [ 99610.0, 130, -3.1 ] - - [ 99906.0, 120, -3.1 ] - - [ 99980.0, 120, -1.3 ] - - [100190.0, 120, -6.8 ] - - [100832.0, 120, -7.2 ] - - [100980.0, 120, -8.1 ] - - [101100.0, 120, -7.4 ] - - [101245.0, 120, -6.3 ] - - [101332.0, 100, -6.3 ] - - [101365.0, 100, -2.4 ] - - [101551.0, 110, -2.4 ] - - [101800.0, 110, 0.0 ] +schema: https://railtoolkit.org/schema/running-path.json +schema_version: "2022.05" +paths: + - name: "'infra_Ostsachsen': track id='tr_80.6212_2' name='DG-DN' -> spp_5" + id: realworld + UUID: 2b31a0c5-85bc-4721-b7e0-66f9df95f7b6 + # source: https://www.railml.org/en/user/exampledata.html + # -> "Real world railway examples from professional tools" + # -> "East Saxony railway network by FBS" + # -> "Ostsachsen_V220.railml" + # -> 'infra_Ostsachsen': track id='tr_80.6212_2' name='DG-DN' -> spp_5 + characteristic_sections: + # [ s in m, v_limit in km/h, f_Rp in ‰ ] + - [ 0.0, 40, 0.0 ] + - [ 318.0, 40, 2.0 ] + - [ 399.0, 40, -3.0 ] + - [ 500.0, 40, 0.0 ] + - [ 579.0, 40, 1.0 ] + - [ 784.0, 40, 5.3 ] + - [ 868.0, 40, 20.0 ] + - [ 1082.0, 40, 16.1 ] + - [ 1287.0, 40, 18.1 ] + - [ 1800.0, 110, 18.1 ] + - [ 2242.0, 110, 15.4 ] + - [ 3295.0, 110, 11.0 ] + - [ 3880.0, 110, 11.1 ] + - [ 4680.0, 45, 11.1 ] + - [ 4686.0, 90, 11.1 ] + - [ 6122.0, 90, 0.0 ] + - [ 6487.0, 90, 1.5 ] + - [ 6588.0, 70, 1.5 ] + - [ 6589.0, 70, 2.4 ] + - [ 6608.0, 130, 2.4 ] + - [ 6723.0, 150, 1.3 ] + - [ 6928.0, 160, 1.3 ] + - [ 7030.0, 160, 7.5 ] + - [ 7300.0, 160, 8.0 ] + - [ 7552.0, 160, 5.0 ] + - [ 7675.0, 160, 6.7 ] + - [ 7800.0, 160, 7.4 ] + - [ 7920.0, 160, 7.0 ] + - [ 8020.0, 140, 7.0 ] + - [ 8100.0, 140, 6.3 ] + - [ 8168.0, 140, 7.4 ] + - [ 8226.0, 140, 8.4 ] + - [ 8300.0, 140, 7.4 ] + - [ 8381.0, 150, 7.4 ] + - [ 8600.0, 150, 7.8 ] + - [ 8900.0, 150, 6.7 ] + - [ 9100.0, 150, 7.8 ] + - [ 9600.0, 150, 8.0 ] + - [ 9845.0, 150, 7.3 ] + - [ 10005.0, 160, 7.3 ] + - [ 10600.0, 160, 6.0 ] + - [ 10748.0, 160, 7.3 ] + - [ 11100.0, 160, 4.5 ] + - [ 11280.0, 160, 3.6 ] + - [ 11450.0, 160, 7.2 ] + - [ 11800.0, 160, 6.8 ] + - [ 12100.0, 160, 7.3 ] + - [ 12590.0, 160, 7.6 ] + - [ 13100.0, 160, 7.3 ] + - [ 13500.0, 160, 7.1 ] + - [ 13800.0, 160, 7.3 ] + - [ 14138.0, 150, 7.3 ] + - [ 14330.0, 150, 0.3 ] + - [ 14640.0, 150, -1.8 ] + - [ 14764.0, 160, -2.8 ] + - [ 15000.0, 160, -3.3 ] + - [ 15500.0, 160, -0.9 ] + - [ 16000.0, 160, 0.0 ] + - [ 16470.0, 160, 1.2 ] + - [ 16572.0, 160, 2.2 ] + - [ 16700.0, 160, 3.8 ] + - [ 16949.0, 160, 3.5 ] + - [ 17086.0, 160, 3.2 ] + - [ 17232.0, 160, 1.3 ] + - [ 17339.0, 160, 4.5 ] + - [ 17406.0, 160, 3.4 ] + - [ 17727.0, 150, 3.4 ] + - [ 17807.0, 150, 4.6 ] + - [ 18049.0, 150, 3.0 ] + - [ 18210.0, 140, 3.0 ] + - [ 18300.0, 140, 4.6 ] + - [ 18680.0, 140, 3.2 ] + - [ 18761.0, 150, 3.2 ] + - [ 19047.0, 150, 5.1 ] + - [ 19305.0, 150, 3.0 ] + - [ 19406.0, 160, 3.0 ] + - [ 19414.0, 160, -0.3 ] + - [ 19900.0, 160, 3.0 ] + - [ 20150.0, 160, 1.8 ] + - [ 20470.0, 160, -4.0 ] + - [ 20940.0, 160, -3.6 ] + - [ 21150.0, 160, -1.5 ] + - [ 21390.0, 160, 0.0 ] + - [ 21702.0, 160, 1.5 ] + - [ 22188.0, 150, 1.5 ] + - [ 22294.0, 150, 1.8 ] + - [ 22383.0, 160, 1.8 ] + - [ 22500.0, 160, 2.6 ] + - [ 22900.0, 160, 4.6 ] + - [ 23542.0, 160, 0.2 ] + - [ 23736.0, 160, 0.9 ] + - [ 24124.0, 160, 7.0 ] + - [ 24918.0, 160, 7.6 ] + - [ 25100.0, 150, 7.1 ] + - [ 25580.0, 150, 7.4 ] + - [ 25708.0, 160, 7.4 ] + - [ 25810.0, 160, 7.1 ] + - [ 26040.0, 160, 3.2 ] + - [ 26330.0, 160, 1.8 ] + - [ 26593.0, 160, 2.1 ] + - [ 27020.0, 160, 3.5 ] + - [ 27195.0, 160, 5.8 ] + - [ 27253.0, 160, 1.1 ] + - [ 27310.0, 160, 3.5 ] + - [ 27595.0, 160, 3.4 ] + - [ 28530.0, 160, 4.6 ] + - [ 29115.0, 160, 0.0 ] + - [ 29700.0, 160, -5.2 ] + - [ 30055.0, 120, -4.3 ] + - [ 30301.0, 120, -6.2 ] + - [ 30487.0, 160, -6.2 ] + - [ 30537.0, 160, -4.8 ] + - [ 31130.0, 160, -0.3 ] + - [ 31293.0, 160, 3.7 ] + - [ 31400.0, 160, 2.9 ] + - [ 31640.0, 160, 4.1 ] + - [ 31795.0, 120, 4.1 ] + - [ 32010.0, 120, 3.2 ] + - [ 32138.0, 130, 3.2 ] + - [ 32365.0, 130, -4.0 ] + - [ 33000.0, 130, 6.1 ] + - [ 33426.0, 160, 6.1 ] + - [ 33907.0, 160, 7.1 ] + - [ 34220.0, 160, 8.4 ] + - [ 34300.0, 160, 7.9 ] + - [ 34440.0, 160, 7.1 ] + - [ 34610.0, 160, 4.4 ] + - [ 35000.0, 160, 5.6 ] + - [ 35173.0, 150, 5.6 ] + - [ 35400.0, 150, -0.2 ] + - [ 35597.0, 160, -0.2 ] + - [ 35900.0, 160, 0.0 ] + - [ 36700.0, 160, 3.9 ] + - [ 36938.0, 160, 0.0 ] + - [ 37700.0, 160, -0.3 ] + - [ 37978.0, 150, -5.6 ] + - [ 38063.0, 150, -1.9 ] + - [ 38141.0, 150, -3.1 ] + - [ 38210.0, 150, 0.0 ] + - [ 38406.0, 150, -7.0 ] + - [ 38900.0, 150, -7.5 ] + - [ 39200.0, 150, -8.7 ] + - [ 39298.0, 150, -6.4 ] + - [ 39476.0, 150, -7.2 ] + - [ 40400.0, 150, -6.9 ] + - [ 40676.0, 130, -6.9 ] + - [ 41000.0, 130, -7.3 ] + - [ 41406.0, 130, -7.5 ] + - [ 41571.0, 160, -7.3 ] + - [ 41816.0, 160, -6.8 ] + - [ 41923.0, 160, -7.1 ] + - [ 42139.0, 160, -1.3 ] + - [ 42343.0, 160, -2.4 ] + - [ 42432.0, 150, -2.4 ] + - [ 42952.0, 160, -2.4 ] + - [ 43000.0, 160, -4.6 ] + - [ 43264.0, 160, -2.5 ] + - [ 43388.0, 160, -0.6 ] + - [ 43700.0, 160, 0.8 ] + - [ 44030.0, 160, 2.7 ] + - [ 44430.0, 160, 0.0 ] + - [ 44708.0, 160, -7.2 ] + - [ 45477.0, 160, -7.8 ] + - [ 45890.0, 160, -1.0 ] + - [ 46562.0, 160, -1.6 ] + - [ 47000.0, 160, -6.9 ] + - [ 47500.0, 160, -7.7 ] + - [ 47800.0, 160, -6.8 ] + - [ 48700.0, 160, -4.3 ] + - [ 49218.0, 160, -5.3 ] + - [ 49514.0, 160, -2.5 ] + - [ 50000.0, 160, -2.2 ] + - [ 51150.0, 160, -5.7 ] + - [ 51406.0, 160, -6.3 ] + - [ 51710.0, 150, -5.8 ] + - [ 52000.0, 150, -6.7 ] + - [ 52215.0, 150, -6.1 ] + - [ 53213.0, 150, -6.8 ] + - [ 53567.0, 150, -5.6 ] + - [ 53943.0, 150, -6.5 ] + - [ 54129.0, 140, -6.5 ] + - [ 54212.0, 140, -10.5 ] + - [ 54247.0, 140, -5.4 ] + - [ 54326.0, 140, -6.1 ] + - [ 54450.0, 140, -6.5 ] + - [ 54482.0, 120, -6.5 ] + - [ 54550.0, 120, -6.2 ] + - [ 54855.0, 140, -6.2 ] + - [ 55307.0, 140, -0.3 ] + - [ 55651.0, 140, -1.2 ] + - [ 55788.0, 140, 0.0 ] + - [ 55918.0, 100, 0.0 ] + - [ 56433.0, 150, 0.0 ] + - [ 56560.0, 150, -2.1 ] + - [ 56624.0, 150, -6.7 ] + - [ 57012.0, 150, 1.3 ] + - [ 57260.0, 150, 6.6 ] + - [ 57800.0, 150, 5.3 ] + - [ 57987.0, 150, 0.0 ] + - [ 57990.0, 150, 7.6 ] + - [ 58321.0, 150, 6.4 ] + - [ 59090.0, 150, 6.9 ] + - [ 59468.0, 150, 9.2 ] + - [ 59600.0, 150, 0.2 ] + - [ 60683.0, 150, 4.1 ] + - [ 61156.0, 150, 2.3 ] + - [ 61181.0, 130, 2.3 ] + - [ 61325.0, 130, 0.0 ] + - [ 61605.0, 130, 7.3 ] + - [ 62108.0, 150, 7.3 ] + - [ 62246.0, 150, 6.6 ] + - [ 62279.0, 150, 5.1 ] + - [ 62454.0, 150, 0.9 ] + - [ 62777.0, 150, 5.5 ] + - [ 63802.0, 150, 4.6 ] + - [ 64344.0, 150, 0.2 ] + - [ 64932.0, 150, -0.6 ] + - [ 65100.0, 150, 0.0 ] + - [ 65690.0, 150, 1.8 ] + - [ 65878.0, 150, 2.5 ] + - [ 66266.0, 150, -1.0 ] + - [ 66339.0, 150, 6.3 ] + - [ 66448.0, 160, 6.3 ] + - [ 66587.0, 160, 0.0 ] + - [ 66856.0, 160, 3.2 ] + - [ 67480.0, 160, 3.6 ] + - [ 67697.0, 160, 2.2 ] + - [ 67800.0, 160, 6.0 ] + - [ 67851.0, 130, 6.0 ] + - [ 68027.0, 130, 2.7 ] + - [ 68172.0, 130, 0.6 ] + - [ 68328.0, 130, 2.5 ] + - [ 68357.0, 130, 0.0 ] + - [ 68479.0, 130, 7.1 ] + - [ 68783.0, 130, 7.4 ] + - [ 69056.0, 150, 7.4 ] + - [ 69500.0, 150, 6.8 ] + - [ 69741.0, 160, 6.8 ] + - [ 69900.0, 160, 6.6 ] + - [ 70757.0, 160, 3.6 ] + - [ 71384.0, 160, 6.0 ] + - [ 71568.0, 160, 7.1 ] + - [ 71800.0, 160, 7.4 ] + - [ 72100.0, 160, 7.3 ] + - [ 73919.0, 150, 7.3 ] + - [ 74317.0, 140, 7.3 ] + - [ 74448.0, 140, 1.5 ] + - [ 74590.0, 140, -1.5 ] + - [ 74620.0, 140, -5.0 ] + - [ 74950.0, 140, -4.3 ] + - [ 75100.0, 140, -1.8 ] + - [ 75154.0, 130, -1.8 ] + - [ 75260.0, 130, -6.2 ] + - [ 75873.0, 130, -5.6 ] + - [ 76062.0, 100, -5.6 ] + - [ 76100.0, 100, -6.4 ] + - [ 76350.0, 100, -5.7 ] + - [ 76476.0, 100, -7.0 ] + - [ 76600.0, 100, -6.4 ] + - [ 76601.0, 90, -6.4 ] + - [ 76726.0, 90, -6.2 ] + - [ 77256.0, 90, -2.1 ] + - [ 77285.0, 80, -2.1 ] + - [ 77299.0, 80, -14.0 ] + - [ 77331.0, 80, -1.6 ] + - [ 77379.0, 90, -1.6 ] + - [ 77425.0, 110, -1.6 ] + - [ 77455.0, 110, -4.9 ] + - [ 77498.0, 110, 0.0 ] + - [ 77505.0, 160, 0.0 ] + - [ 77555.0, 160, -5.6 ] + - [ 77662.0, 160, 0.0 ] + - [ 78085.0, 160, -4.0 ] + - [ 78223.0, 160, -6.8 ] + - [ 78337.0, 130, -6.8 ] + - [ 78856.0, 130, -6.6 ] + - [ 78875.0, 130, -7.2 ] + - [ 79345.0, 150, -7.2 ] + - [ 79600.0, 150, -6.5 ] + - [ 79792.0, 150, -0.2 ] + - [ 80537.0, 150, -5.2 ] + - [ 81300.0, 150, -4.8 ] + - [ 81634.0, 110, -4.8 ] + - [ 81943.0, 110, -5.4 ] + - [ 82166.0, 110, 0.0 ] + - [ 82408.0, 110, 4.8 ] + - [ 82790.0, 110, 5.9 ] + - [ 83137.0, 120, 5.9 ] + - [ 83300.0, 120, 0.0 ] + - [ 83519.0, 150, 0.0 ] + - [ 83597.0, 150, -7.8 ] + - [ 83827.0, 150, -8.1 ] + - [ 84150.0, 150, -7.2 ] + - [ 84391.0, 150, 0.0 ] + - [ 84966.0, 150, -4.0 ] + - [ 85529.0, 130, -2.3 ] + - [ 85589.0, 130, -4.0 ] + - [ 86081.0, 130, 0.0 ] + - [ 86514.0, 130, 7.8 ] + - [ 86577.0, 120, 7.8 ] + - [ 87554.0, 90, 7.8 ] + - [ 87690.0, 90, 7.9 ] + - [ 87842.0, 90, 1.7 ] + - [ 88007.0, 110, 1.7 ] + - [ 88100.0, 110, 3.4 ] + - [ 88260.0, 110, 5.3 ] + - [ 88376.0, 160, 5.3 ] + - [ 88450.0, 160, 6.7 ] + - [ 89050.0, 160, 7.4 ] + - [ 89350.0, 160, -7.1 ] + - [ 90365.0, 160, 0.0 ] + - [ 90700.0, 160, -7.3 ] + - [ 92000.0, 160, -7.9 ] + - [ 92166.0, 160, -4.0 ] + - [ 92460.0, 160, -5.4 ] + - [ 93330.0, 160, 0.0 ] + - [ 93901.0, 160, 0.7 ] + - [ 94156.0, 160, 5.2 ] + - [ 94440.0, 160, -2.8 ] + - [ 94530.0, 160, -0.8 ] + - [ 94630.0, 160, -6.8 ] + - [ 94830.0, 160, -4.4 ] + - [ 95090.0, 160, -4.6 ] + - [ 95500.0, 160, -4.8 ] + - [ 96500.0, 160, -4.4 ] + - [ 96700.0, 160, -5.6 ] + - [ 97000.0, 160, -4.6 ] + - [ 97590.0, 160, 0.0 ] + - [ 97858.0, 120, 0.0 ] + - [ 98224.0, 120, -1.5 ] + - [ 98264.0, 120, 0.0 ] + - [ 98577.0, 120, 7.5 ] + - [ 98738.0, 120, 0.0 ] + - [ 99055.0, 130, 0.0 ] + - [ 99427.0, 130, -2.0 ] + - [ 99610.0, 130, -3.1 ] + - [ 99906.0, 120, -3.1 ] + - [ 99980.0, 120, -1.3 ] + - [100190.0, 120, -6.8 ] + - [100832.0, 120, -7.2 ] + - [100980.0, 120, -8.1 ] + - [101100.0, 120, -7.4 ] + - [101245.0, 120, -6.3 ] + - [101332.0, 100, -6.3 ] + - [101365.0, 100, -2.4 ] + - [101551.0, 110, -2.4 ] + - [101800.0, 110, 0.0 ] diff --git a/test/data/paths/slope.yaml b/test/data/paths/slope.yaml index 5922df6..00371a7 100644 --- a/test/data/paths/slope.yaml +++ b/test/data/paths/slope.yaml @@ -1,27 +1,29 @@ %YAML 1.2 --- -path: - name: "10 km, different gradient, 160 km/h" - id: slope - UUID: ffd243a9-0223-4210-8c7d-e6c90fde70d3 - points_of_interest: - # [ station in m, name, front or rear ] - - [ 850.00, view_point_1, front ] - - [ 1000.00, distant_signal_1, front ] - - [ 2000.00, main_signal_1, front ] - - [ 9000.00, main_signal_3, front ] - - [ 9050.00, clearing_point_1, rear ] - characteristic_sections: - # [ station in m, speed limit in km/h, resistance in ‰ ] - - [ 0.0, 160, 0.00 ] - - [ 1000.0, 160, 1.00 ] - - [ 2000.0, 160, 2.00 ] - - [ 3000.0, 160, 5.00 ] - - [ 4000.0, 160, -3.00 ] - - [ 5000.0, 160, 5.00 ] - - [ 6000.0, 160, -10.00 ] - - [ 7000.0, 160, 15.00 ] - - [ 8000.0, 160, -10.00 ] - - [ 8500.0, 160, 20.00 ] - - [ 9000.0, 160, 0.00 ] - - [ 10000.0, 160, 0.00 ] +schema: https://railtoolkit.org/schema/running-path.json +schema_version: "2022.05" +paths: + - name: "10 km, different gradient, 160 km/h" + id: slope + UUID: ffd243a9-0223-4210-8c7d-e6c90fde70d3 + points_of_interest: + # [ station in m, name, front or rear ] + - [ 850.00, view_point_1, front ] + - [ 1000.00, distant_signal_1, front ] + - [ 2000.00, main_signal_1, front ] + - [ 9000.00, main_signal_3, front ] + - [ 9050.00, clearing_point_1, rear ] + characteristic_sections: + # [ station in m, speed limit in km/h, resistance in ‰ ] + - [ 0.0, 160, 0.00 ] + - [ 1000.0, 160, 1.00 ] + - [ 2000.0, 160, 2.00 ] + - [ 3000.0, 160, 5.00 ] + - [ 4000.0, 160, -3.00 ] + - [ 5000.0, 160, 5.00 ] + - [ 6000.0, 160, -10.00 ] + - [ 7000.0, 160, 15.00 ] + - [ 8000.0, 160, -10.00 ] + - [ 8500.0, 160, 20.00 ] + - [ 9000.0, 160, 0.00 ] + - [ 10000.0, 160, 0.00 ] diff --git a/test/data/paths/speed.yaml b/test/data/paths/speed.yaml index d35e33c..378e33f 100644 --- a/test/data/paths/speed.yaml +++ b/test/data/paths/speed.yaml @@ -1,27 +1,29 @@ %YAML 1.2 --- -path: - name: "10 km, no gradient, different speed limits" - id: speed - UUID: 401b8ce7-fa75-4576-8a4a-43be2eb55e50 - points_of_interest: - # [ station in m, name, front or rear ] - - [ 999.00, point_1, front ] - - [ 2000.00, point_2, front ] - - [ 3333.30, point_3, rear ] - - [ 5000.00, point_4, front ] - - [ 7777.00, point_5, front ] - - [ 9000.00, point_6, front ] - - [ 9500.95, point_7, front ] - characteristic_sections: - # [ station in m, speed limit in km/h, resistance in ‰ ] - - [ 0.0, 160, 0.00 ] - - [ 3000.0, 60, 0.00 ] - - [ 4000.0, 160, 0.00 ] - - [ 5000.0, 60, 0.00 ] - - [ 6000.0, 160, 0.00 ] - - [ 6500.0, 60, 0.00 ] - - [ 6700.0, 65, 0.00 ] - - [ 6800.0, 70, 0.00 ] - - [ 7000.0, 120, 0.00 ] - - [ 10000.0, 160, 0.00 ] +schema: https://railtoolkit.org/schema/running-path.json +schema_version: "2022.05" +paths: + - name: "10 km, no gradient, different speed limits" + id: speed + UUID: 401b8ce7-fa75-4576-8a4a-43be2eb55e50 + points_of_interest: + # [ station in m, name, front or rear ] + - [ 999.00, point_1, front ] + - [ 2000.00, point_2, front ] + - [ 3333.30, point_3, rear ] + - [ 5000.00, point_4, front ] + - [ 7777.00, point_5, front ] + - [ 9000.00, point_6, front ] + - [ 9500.95, point_7, front ] + characteristic_sections: + # [ station in m, speed limit in km/h, resistance in ‰ ] + - [ 0.0, 160, 0.00 ] + - [ 3000.0, 60, 0.00 ] + - [ 4000.0, 160, 0.00 ] + - [ 5000.0, 60, 0.00 ] + - [ 6000.0, 160, 0.00 ] + - [ 6500.0, 60, 0.00 ] + - [ 6700.0, 65, 0.00 ] + - [ 6800.0, 70, 0.00 ] + - [ 7000.0, 120, 0.00 ] + - [ 10000.0, 160, 0.00 ]