Dev:Common state repository: Difference between revisions

From railML 3 Wiki
Jump to navigation Jump to search
[checked revision][checked revision]
No edit summary
No edit summary
Line 10: Line 10:
It is possible to specify states that apply to the whole railML document.
It is possible to specify states that apply to the whole railML document.


<gallery widths=1000px heights=500px>File:2024-11-08 railML stateDiagram.png|thumb|draft suggestion</gallery>
<gallery widths=1000px heights=500px>File:2024-11-08 railML stateDiagram.png|thumb|Behavior model draft suggestion</gallery>


<syntaxhighlight lang=xml>
<syntaxhighlight lang=xml>

Revision as of 09:25, 20 January 2025

https://development.railml.org/railml/version3/-/issues/552 https://www.railml.org/forum/index.php?t=msg&th=996&start=0&

With this it is possible from railML 3.3 onward to also encode the planning for interlocking and rollingstock between applications.

The general idea is to define the general status in the common section, while making sure that the states defined there do no overlap in time. Wherever an element, such as an overcrossing deviates from the state defined for the document under common, an element state can be defined to express that. These element states by nature can and should overlap in time with the states defined under common, however they should not overlap with each other (within the same element).

Elements in infrastructure, interlocking and rollingstock have an optional repeatable element called <elementState>. This element state allows specifying an overriding status for the enclosing element. The states in common as well as the element state each provide child elements to specify their validities.

It is possible to specify states that apply to the whole railML document.


<?xml version="1.0" encoding="UTF-8"?><railML xmlns="https://www.railml.org/schemas/3.3" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:gml4rail3="https://www.railml.org/schemas/3.3/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.3" xsi:schemaLocation="https://www.railml.org/schemas/3.3 https://www.railml.org/schemas/3.3/railml3.xsd">
  <common id="co1">
    <states>
      <state id="st01" value="operational">
        <name language="en" name="Operational 2024"/>
        <validity>
          <period from="2024-01-01T00:00:00Z" to="2024-12-31T09:00:00"/>
        </validity>
      </state>
      <state id="st02" value="operational">
        <name language="en" name="Operational 2025"/>
        <validity>
          <period from="2025-01-01T00:00:00Z" to="2025-12-31T09:00:00"/>
        </validity>
      </state>
    </states>
  </common>
  <infrastructure id="is01">
    <functionalInfrastructure>
      <tracks>
        <track id="t01">
          <designator entry="XXX1" register="_nrv"/>
        </track>
        <track id="t02">
          <designator entry="XXX2" register="_nrv"/>
        </track>
        <track id="t03">
          <designator entry="XXX3" register="_nrv"/>
          <elementState value="disabled">
            <name language="en" name="Construction May24"/>
            <validity>
              <period from="2024-05-10T02:00:00Z" to="2024-05-15T22:00:00Z"/>
            </validity>
            <validity>
              <period from="2024-05-18T02:00:00Z" to="2024-05-19T22:00:00Z"/>
            </validity>
          </elementState>
        </track>
        <track id="t04">
          <designator entry="XXX4" register="_nrv"/>
          <elementState value="closed">
            <name language="en" name="Track closure for dismanteling"/>
            <validity>
              <period from="2025-08-20T00:00:00Z" to="2025-08-31T09:00:00"/>
            </validity>
          </elementState>
          <elementState value="dismantled">
            <validity>
              <period from="2025-09-01T00:00:00Z" to="2025-12-31T09:00:00"/>
            </validity>
          </elementState>
        </track>
        <track id="t05">
          <designator entry="XXX5" register="_nrv"/>
        </track>
        <track id="t06">
          <designator entry="XXX6" register="_nrv"/>
          <elementState value="planned">
            <name language="en" name="New track planned to be operational q3 of 2025"/>
            <validity>
              <period from="2024-01-01T00:00:00Z" to="2025-12-31T09:00:00"/>
            </validity>
          </elementState>
          <elementState value="planned">
            <name language="en" name="New track planned to be operational q3 of 2025"/>
            <validity>
              <period from="2025-01-01T00:00:00Z" to="2025-08-31T09:00:00"/>
            </validity>
          </elementState>
          <!--no need to specify the rest of the year as it is in line with the common state-->
        </track>
      </tracks>
    </functionalInfrastructure>
  </infrastructure>
  <rollingstock>
    <vehicles>
      <vehicle id="v01">
        <designator entry="1234-5678-1X" register="_BN"/>
      </vehicle>
      <vehicle id="v02">
        <designator entry="1234-5678-2X" register="_BN"/>
      </vehicle>
      <vehicle id="v03">
        <designator entry="1234-5678-3X" register="_BN"/>
      </vehicle>
      <vehicle id="v04">
        <designator entry="1234-5678-4X" register="_BN"/>
      </vehicle>
      <vehicle id="v05">
        <designator entry="1234-5678-5X" register="_BN"/>
        <elementState value="dismantled"/> <!--dismantled for year 2025 -->
      </vehicle>
      <vehicle id="v06">
        <designator entry="1234-5678-6X" register="_BN"/>
      </vehicle>
    </vehicles>
  </rollingstock>
</railML>