You are here: Wiki > start > usertrack > ttuse > xml_timetable

Table of Contents

Current XML Timetable File Format
Specification
Sample timetable
Future Ideas

Current XML Timetable File Format

Older SimSig simulations used WTT and WTR files which are in a custom, binary format which limits its portability and expandability.

The Loader now uses a single file format containing rules and train schedules using the ever-popular XML notation.

Specification

A timetable file is a zip file containing two XML files within it, called "SavedTimetable.xml" and "TimetableHeader.xml". The file SavedTimetable.xml contains the entire timetable. The file TimetableHeader.xml is an extract from it, containing only some of the top-level data.

Entities are either data entities, holding one specific item of data about the timetable, or "grouping" entities, that hold other entities. Each data entity has a default value; in general, the core code will not create an entity containing its default value, but it will correctly handle one that appears in the timetable. Most data entities are strings, numbers, or booleans (in which case the only values are "True" or "False"); the type can be deduced from the default specified in the information below. Any entity that represents a time is given in seconds or seconds since midnight.

Where a default value is a number and is then followed by a list of names in { braces }, these names give the meaning for the values 0, 1, 2, etc. E.g. { red, yellow, green } means that 0 represents red, 1 represents yellow, and 2 represents green.

Grouping entities are usually two level. One entity contains a single list entity, which then contains one or more instances of another entity. So, for example, train categories are found within the <SimSigTimetable> like this:

<SimSigTimetable>

<TrainCategories>

<TrainCategory ID="XXX">

... data about category XXX

</TrainCategory>

<TrainCategory ID="YYY">

... data about category YYY

</TrainCategory>

<TrainCategory ID="ZZZ">

... data about category ZZZ

</TrainCategory>

</TrainCategories>

</SimSigTimetable>

Here <TrainCategories> is the list entity and <TrainCategory> is the grouping entity at the next level.

Both files contain one <SimSigTimetable> entity. The file TimetableHeader.xml only contains the attributes and entities marked with "[TH]" in the following description.

Each block consists of the grouping entity, any attributes, and then the entities that it contains.

<SimSigTimetable>
attribute ID simulation identifier, used to make sure it's a timetable for the right simulation [TH]
attribute Version string; the version number of the core code used to create the timetable [TH]
<Name> default %%''%% [TH]
<Description> default %%''%% '\n' represents a new line [TH]
<StartTime> default 0 [TH]
<VMajor> default 0 [TH]
<VMinor> default 0 [TH]
<VBuild> default 0 [TH]
<FinishTime> default 0
<CautionSpeedSets> list contains <CautionSpeedSet>
<TTClassOfServiceRules> list contains <TTCOSRule>
<TrainCategories> list contains <TrainCategory>
<Timetables> list contains <Timetable>
<TimetableRules> list contains <TimetableRule>
<CautionSpeedSet>
attribute ID
<Name> default %%''%%
<CautionSpeeds> list contains <CautionSpeed>
<CautionSpeed>
<AspectPassed> default 0 { R, sub, Y, FY, YY, FYY, G }
<FromLineSpeed> default 0
<ToLineSpeed> default 0
<ReduceNowValue> default 0
<ApproachNextValue> default 0
<ApproachNextDistance> default 0
<NowValueType> default 0 { NotApplicable, Absolute, Percent }
<NextValueType> default 0 { NotApplicable, Absolute, Percent }
<TTCOSRule>
<ClassOfService> default 3 { Passenger, ECS, Excursion, Goods, Light engine }
<IDmatch> default %%''%%
<Freight> default 0 { Either, Passenger, Freight }
<SpeedClassMatchType> default 0 { Ignore, Any, All, None }
<MatchSpeedClass> default 0 [SC] [2]
<TrainCategory>
attribute ID an empty or missing value is replaced by a random 8 digit hexadecimal number
<Description> default %%''%%
<AccelBrakeIndex> default 0
<IsFreight> default False use goods speeds
<CanUseGoodsLines> default False
<MaxSpeed> default 0
<TrainLength> default 0
<SpeedClass> default 0 [SC]
<PowerToWeightCategory> default 0 { Normal, Light, Heavy }
<Electrification> default %%''%% [3]
<CautionSpeedSet> default %%''%% contains the ID attribute of a <CautionSpeedSet>
<DwellTimes> list contains <DwellTime>
<Timetable>

The timetable of a single train

<ID> default %%''%% headcode
<UID> default %%''%%
<AccelBrakeIndex> default 0
<AsRequired> default False
<AsRequiredPercent> default 0
<Delay> default 0
<DelayWarned> default False
<DepartTime> default 0 actually the entry time
<Description> default %%''%%
<SeedPoint> default %%''%%
<EntryPoint> default %%''%%
<ActualEntryPoint> default %%''%% [SG]
<MaxSpeed> default 0
<SpeedClassIndex> default 0 [4]
<SpeedClass> default 0 [SC]
<Started> default False train started or cancelled [SG]
<IsFreight> default False use goods speeds
<CanUseGoodsLines> default False
<TrainLength> default 0
<IncrementOnTransfer> default False
<PowerToWeightCategory> default 0 { Normal,Light, Heavy }
<ClassOfService> default -1 { Passenger, ECS, Excursion, Goods, Light engine }; -1 means "use rules"
<Electrification> default %%''%% [3]
<StartTraction> default %%''%% [3]
<STP> default False
<BonusScore> default False
<AsRequiredTested> default False [SG]
<RunOnTime> default False
<EntryWarned> default 0 { No, OnPhone, OnPhone2, ReadyToEnter, OnEntryQueue } [SG]
<EntryAlerted> default False [SG]
<BeenRerouted> default False [SG]
<Category> default %%''%%
<Trips> list contains <Trip>

In addition, all the child properties of a <DwellTime> may be used without an actual <DwellTime> being present.

<Trip>

A single location within a train's timetable

<Location> default %%''%% [1]
<AutoInserted> default False
<SetDownOnly> default False
<DepPassTime> default 0
<ArrTime> default 0 if non-zero and <DepPassTime> is 0, then this is also the DepPassTime value
<Platform> default %%''%%
<Line> default %%''%%
<Path> default %%''%%
<AutoPlatform> default False indicates <Platform> was auto-inserted
<AutoLine> default False indicates <Line> was auto-inserted
<AutoPath> default False indicates <Path> was auto-inserted
<EngAllowance> default 0
<PathAllowance> default 0
<IsPassTime> default False
<AllowStopsOnThroughLines> default False
<StopLocation> default 0 { Default, Near, Far, NearExact, FarExact }
<StopAdjustment> default 0
<DwellTime> default 0
<BerthsHere> default False
<DownDirection> default False [5]
<PrevPathEndDown> default False [5]
<NextPathStartDown> default False [5]
<Activities> list contains <Activity>
<Activity>
<Activity> default 0 { Next, DividesRear, DividesFront, Joins, DetachesRear, DetachesFront, DropsRear,DropsFront, Joins2, PlatformShare }
<AssociatedTrain> default %%''%%
<AssociatedUID> default %%''%%
<CrewChange> default False
<ACIFlag> default 0
<TimetableRule>
<Train> default %%''%%
<TrainUID> default %%''%%
<Rule> default 0 { PostEnters, PostExits, PostArrives, SingleXOR, PostDeparts, DepartsPostEnters,DepartsPostExits, PostJoins, PostDivides, PostFormed, MultipleXOR,EntersPostJoins, EntersPostDivides, EntersPostFormed, Alternative }
<Location> default %%''%% [1]
<Time> default 0
<Train2> default %%''%%
<Train2UID> default %%''%%
<Achieved> default False [SG]
<XOREntered> default False [SG]
<TimeElapsed> default 0 [SG]
<DwellTimes>
<RedSignalMoveOff> default 0
<StationForward> default 0
<StationReverse> default 0
<TerminateForward> default 0
<TerminateReverse> default 0
<Join> default 0
<Divide> default 0
<CrewChange> default 0

Notes

[SC] The value is the sum of the numbers in the following table that correspond to the speed classes selected:

EPS-E 1
EPS-D 2
HST 4
EMU 8
DMU 16
SP 32
CS 64
MGR 128
TGV 256
LH 512
Metro 1024
WES 2048
Trip 4096
Steam 8192
Sim1 16777216
Sim2 33554432
Sim3 67108864
Sim4 134217728

E.g. 38 represents SP,HST,EPS-D.

[SG] Only used in saved games, not in timetables.


[TH] Also found in the TimetableHeader.xml file.


[1] There may be more than one location name that represents the same location; any of the names may be used.


[2] This is only read or stored if the <SpeedClassMatchType> is not "Ignore".


[3] The value is a string with each letter representing a power type: 'O' (overhead), '3' (3rd rail), '4' (4th rail), 'D' (diesel)


[4] This property is no longer used and I can't remember what it was for.


[5] Provided for debugging purposes only; this is normally overwritten during timetable loading.

Sample timetable

This is an extract from a real timetable. It does not necessarily show all the features.

<SimSigTimetable ID="aston" Version="4.0.27">

<Name>Aston 20091015 (0000 start) v4.0</Name>

<Description>Timetable based on Thursday 15th October 2009, seeded to start at 00:00. This timetable is fully compatable with the other timetables for the same date.\n\n(TT version 4.0, dated March 14th 2014)</Description>

<StartTime>0</StartTime>

<FinishTime>89940</FinishTime>

<VMajor>0</VMajor>

<VMinor>0</VMinor>

<VBuild>0</VBuild>

<TrainCategories>

<TrainCategory ID="HST2+5">

<Description>NR HST(2+5)</Description>

<AccelBrakeIndex>2</AccelBrakeIndex>

<IsFreight>True</IsFreight>

<MaxSpeed>110</MaxSpeed>

<TrainLength>152</TrainLength>

<SpeedClass>4</SpeedClass>

<PowerToWeightCategory>0</PowerToWeightCategory>

<DwellTimes/>

<Electrification>D</Electrification>

</TrainCategory>

<TrainCategory ID="3323AC">

<Description>LM 3/323</Description>

<AccelBrakeIndex>4</AccelBrakeIndex>

<IsFreight>False</IsFreight>

<MaxSpeed>90</MaxSpeed>

<TrainLength>69</TrainLength>

<SpeedClass>8</SpeedClass>

<PowerToWeightCategory>0</PowerToWeightCategory>

<DwellTimes/>

<Electrification>O</Electrification>

</TrainCategory>

</TrainCategories>

<Timetables>

<Timetable>

<ID>1Q24-0</ID>

<AccelBrakeIndex>2</AccelBrakeIndex>

<AsRequired>True</AsRequired>

<AsRequiredPercent>50</AsRequiredPercent>

<DepartTime>27420</DepartTime>

<Description>0650 Derby RTC - Derby (NR NMT(2+5))</Description>

<EntryPoint>EWICHNRJ</EntryPoint>

<MaxSpeed>110</MaxSpeed>

<IsFreight>True</IsFreight>

<TrainLength>152</TrainLength>

<Electrification>D</Electrification>

<StartTraction>D</StartTraction>

<Category>HST2+5</Category>

<Trips>

<Trip>

<Location>ALRWAS</Location>

<DepPassTime>27540</DepPassTime>

<PathAllowance>36</PathAllowance>

<IsPassTime>True</IsPassTime>

</Trip>

<Trip>

<Location>LCHTTVJ</Location>

<DepPassTime>29010</DepPassTime>

<IsPassTime>True</IsPassTime>

</Trip>

<Trip>

<Location>LCHTTVL</Location>

<DepPassTime>29160</DepPassTime>

<PathAllowance>1</PathAllowance>

<IsPassTime>True</IsPassTime>

<DownDirection>True</DownDirection>

<PrevPathEndDown>True</PrevPathEndDown>

</Trip>

</Trips>

</Timetable>

<Timetable>

<ID>1Q24-3</ID>

<AccelBrakeIndex>2</AccelBrakeIndex>

<AsRequired>True</AsRequired>

<AsRequiredPercent>50</AsRequiredPercent>

<DepartTime>59670</DepartTime>

<Description>0650 Derby RTC - Derby (NR NMT(2+5))</Description>

<EntryPoint>ELCHTTVL</EntryPoint>

<MaxSpeed>110</MaxSpeed>

<IsFreight>True</IsFreight>

<TrainLength>152</TrainLength>

<Electrification>D</Electrification>

<StartTraction>D</StartTraction>

<Category>HST2+5</Category>

<Trips>

<Trip>

<Location>LCHTTVJ</Location>

<DepPassTime>59790</DepPassTime>

<PathAllowance>18</PathAllowance>

<IsPassTime>True</IsPassTime>

<PrevPathEndDown>True</PrevPathEndDown>

</Trip>

<Trip>

<Location>ALRWAS</Location>

<DepPassTime>60690</DepPassTime>

<PathAllowance>6</PathAllowance>

<IsPassTime>True</IsPassTime>

</Trip>

<Trip>

<Location>WICHNRJ</Location>

<DepPassTime>60960</DepPassTime>

<IsPassTime>True</IsPassTime>

</Trip>

</Trips>

</Timetable>

<Timetable>

<ID>1Q25-0</ID>

<AccelBrakeIndex>2</AccelBrakeIndex>

<AsRequired>True</AsRequired>

<AsRequiredPercent>50</AsRequiredPercent>

<DepartTime>27420</DepartTime>

<Description>0650 Derby RTC - Derby (NR NMT(2+5))</Description>

<EntryPoint>EWICHNRJ</EntryPoint>

<MaxSpeed>110</MaxSpeed>

<IsFreight>True</IsFreight>

<TrainLength>152</TrainLength>

<Electrification>D</Electrification>

<StartTraction>D</StartTraction>

<Category>HST2+5</Category>

<Trips>

<Trip>

<Location>ALRWAS</Location>

<DepPassTime>27540</DepPassTime>

<PathAllowance>36</PathAllowance>

<IsPassTime>True</IsPassTime>

</Trip>

<Trip>

<Location>LCHTTVJ</Location>

<DepPassTime>29010</DepPassTime>

<IsPassTime>True</IsPassTime>

</Trip>

<Trip>

<Location>LCHTTVL</Location>

<DepPassTime>29160</DepPassTime>

<PathAllowance>1</PathAllowance>

<IsPassTime>True</IsPassTime>

<DownDirection>True</DownDirection>

<PrevPathEndDown>True</PrevPathEndDown>

</Trip>

</Trips>

</Timetable>

<Timetable>

<ID>1Q25-3</ID>

<AccelBrakeIndex>2</AccelBrakeIndex>

<AsRequired>True</AsRequired>

<AsRequiredPercent>50</AsRequiredPercent>

<DepartTime>59670</DepartTime>

<Description>0650 Derby RTC - Derby (NR NMT(2+5))</Description>

<EntryPoint>ELCHTTVL</EntryPoint>

<MaxSpeed>110</MaxSpeed>

<IsFreight>True</IsFreight>

<TrainLength>152</TrainLength>

<Electrification>D</Electrification>

<StartTraction>D</StartTraction>

<Category>HST2+5</Category>

<Trips>

<Trip>

<Location>LCHTTVJ</Location>

<DepPassTime>59790</DepPassTime>

<PathAllowance>18</PathAllowance>

<IsPassTime>True</IsPassTime>

<PrevPathEndDown>True</PrevPathEndDown>

</Trip>

<Trip>

<Location>ALRWAS</Location>

<DepPassTime>60690</DepPassTime>

<PathAllowance>6</PathAllowance>

<IsPassTime>True</IsPassTime>

</Trip>

<Trip>

<Location>WICHNRJ</Location>

<DepPassTime>60960</DepPassTime>

<IsPassTime>True</IsPassTime>

</Trip>

</Trips>

</Timetable>

</Timetables>

<TimetableRules>

<TimetableRule>

<Train>1Q24-3</Train>

<Rule>1</Rule>

<Time>18000</Time>

<Train2>1Q24-0</Train2>

</TimetableRule>

<TimetableRule>

<Train>1Q25-3</Train>

<Rule>1</Rule>

<Time>18000</Time>

<Train2>1Q25-0</Train2>

</TimetableRule>

<TimetableRule>

<Train>1Q25-0</Train>

<Rule>10</Rule>

<Train2>1Q24-0</Train2>

</TimetableRule>

</TimetableRules>

</SimSigTimetable>

Future Ideas

  • Define custom acceleration/braking curves and profiles (eg minimum time to start from a red signal stop)
  • Specify minimum and maximum entry times, overriding simulation defaults (except headway)

Associations

* Subject to change *

These are where one train forms another, joins, or divides.

Dates

The association date must match the schedule's starting date. For example, if a train starts at 11pm Monday to Friday, arrives 1am Tuesday to Saturday, and forms a second train a short time later, then the association runs from the Monday to Friday as that was when the train started.

Multiple Associations

A single schedule can have multiple associations. For example, a train that runs Monday to Friday would often have a different association on a Friday night. For this, a Monday to Thursday association can be created, along with a Friday-only association.

Joins

Trains 1 and 2 arrive and form train 3. The associations should be:

- Train 1 forms train 3

- Train 2 joins train 1

Note that this is different than from previous versions of SimSig.


Last edited by Gwasanaethau on 12/06/2021 at 17:53