|
|
The editor
Once the user has experienced how difficult it is to manage a line or a station
when there is intense traffic, it is possible to start experimenting with the
editor, both to modify one of the existing layouts (for example adding a
platform to allow more trains to arrive on time), and to create your own
layout.
Clicking on the "Edit+Edit" menu, the tool bar is shown in place of
the general schedule pane. On this tool bar the program lists all possible track
elements that can be placed on the layout. The following table shows the
different track types:
 |
Horizontal tracks |
 |
Vertical tracks |
 |
Crossing tracks |
 |
Diagonal tracks |
 |
Horizontal switched |
 |
Vertical switches |
 |
Protection signals |
 |
Automatic block signals |
To place a track element, select the desired track type (the current track type
is indicated with a white border around the track type), and then click on the
layout on the position where you want to put the element. It is advisable to
draw the entire layout on paper, so that you leave enough space for all the
tracks and signals.
The button is used to
remove a line element from the layout.
The button
represent a platform or a station's building. It is used only as a decoration,
since it doesn't affect the train's behavior.
The button with the camera is used to specify a user-created icon. These icons are contained
in a file with the .xpm extension. To specify the file name, place the
camera on the layout, then open the track properties dialog, by clicking with
the right button on the camera, and enter the name of the file in the "Station"
field. To create an .xpm file, one can use any graphic editing program,
such as the excellent Icon Collector Graphics
Editor, with which one can also convert icons from the .bmp format
to the .xpm format, and viceversa.
The buttons
are used to place descriptions. To change the text of a description after having
put it on the layout, click on the text with the right button and change the
text in the dialog.
The "Link..." and "...to..." buttons require a more detailed
description. These tools are used to link different points of the layout. First
you have to select the tool, then click on the first object to be linked;
this automatically selects the tool; then click on the second object to be linked; the "Link..."
tool will be selected again to show that the link has been properly set up.
More precisely:
-
It is possible to link two switches so that, when simulating, clicking on
a switch will automatically throw the linked switch.
-
It is also possible to link two terminal points of a line, so that a
train that would exit the layout from the first point will re-enter the layout
from the second point. This trick is used to break a long line.
-
Each signal placed on the layout must be linked to the track
protected by that signal.
-
It is necessary to define every point of entry or exit from the layout
with some text. This text can be a letter, number or a word. After you placed
the text with the "Abc..." tool, you must link the text with the track by using
the "Link...to..." tools, so that that track becomes an entry/exit point.
To speed up the creation of many layouts, it is possible to create your own
standard elements and place them several times on the layout being created.
These macros are simply mini-layouts that are created with the
same editor and saved on disk in the same way as used for normal layouts.
Obviously, there will not be any schedule file associated with a macro file.
To use a macro, one must first select the desired macro by clicking on .
Traindir will ask the name of the file containing the macro. Once specified the
file name, the program will automatically select the
button, to tell the user that he has to place the selected macro at the desired
position on the layout. From now on, until the user selects a new tool, every
time one clicks on the layout, the selected macro will be placed on the layout,
including all the additional elements like signals, platforms, links etc.
A typical macro is used in the construction of several sections in a
2-tracks line, or of a number of stations with sidings on a 1-track line.
To create your own macro, just start with an empty layout, and place the
track elements as if you were building a real layout. The only requirement is
that you must place the elements as close as possible to the upper-left corner
(e.g. at the 0,0 coordinate). As an excercise, try to modify the 2 macros
provided with the program, called "2tracks" and "southst".
The button is used to
place on the layout a button to select an itinerary. After you've placed the
button on the layout, right-click on the button's icon, and enter the name of
the itinerary. For the creation of an itinerary, see the specific
chapter.
The buttons are
used to move rectangular areas of the layout to a new position. They work as
follows:
- Click on the first button (with the arrow towards the upper left corner) and
mark with the mouse the initial coordinate of the rectangle to move;
- The second button (with the arrow towards the lower right corner) is
automatically selected. Now mark with the mouse the final coordinate of the
rectangle to move;
- The area to move is highlighted on the layout, and the third button (with
the two rectangles) is automatically selected. Now click on the new position of
the upper-left corner of the rectangle. The program will move all elements
(tracks, signals, icons etc.) to the new position, and will recompute all the
links to the moved elements.
While the coordinates are shown on the layout it is also possible to
delete/insert whole rows/columns. To do this, move the mouse on the coordinate
of the row (or column) that you want to operate on, and click the right button
of the mouse. A pop-up menu simular to the following will appear. Now select the
command you want to perform.
After having placed and linked every track element, you must define the
lengths and maximum speeds for each line block, so that trains can occupy
that line block for an appropriate amount of time. To do this, click with the
right mouse button on each line element where you want to define a length and/or
a speed limit. A dialog will popup with the current properties of that track
element. Just modify or enter new values for the properties.
If you enter a text in the "Station" field, that track element will be
considered a station where trains can stop even when the next signal is green,
and where the program will record the arrival and departure times, according to
the train's timetable.
You can enter in the "Speed" field 4 speed limits, according to the train
type. Type 1 trains (see the timetable description) will obey the first speed
limit, type 2 trains will obey the second and so on. If you enter only one
limit, that limit will be obeyed by all trains. Each limit is separated by a
slash from the next. For example, 120/100/80/60.
The fields labeled "Linked to west" and "Linked to east"
show whether that track element has been linked to other track elements by using
the "Link...to..." buttons. Sometimes it is useful to enter the coordinates
manually, or, if one wants to unlink the tracks, one can enter the value "0,0"
in one of the fields.
After the layout has been created, all the entry/exit points have been
defined, the signals and switches have been linked, the stations and the lengths
and speed limits have been defined, it is possible to save the layout with the
command "Edit+Save".
If you change your mind and you want to erase the layout completely and start
afresh, use the command "Edit+News".
Itineraries
An itinerary is a sequence of tracks and switches delimited by two signals. When
the itinerary is selected by clicking on the itinerary button which was put on
the layout by the author of the scenario, Traindir will try to throw all the
switches to the proper position, and then the signal at the start of the
itinerary will be set to green. Of course, if there is another train that
occupies any of the tracks defined by the itinerary, or if for some reason it is
not possible to throw one of the switches, the signal will not be cleared.
To create a new itinerary one must enter in the itinerary editor, by using the
menu "Edit+Itinerary".
The list of the itineraries will be shown in place of the edit tools.
The first step in defining the itinerary is to manually throw all the switches
and to clear the signal at the start of the itinerary. Once Traindir has set the
section to green, one must click with the right mouse button on the start
signal, to show the following dialog:

One must then enter the name of the itinerary. This name is completely
arbitrary, although it should remind the user of the end-points of the
itinerary.
The second field in the dialog is used to link several itineraries in a
sequence. Every single itinerary is always delimited by 2 signals. However, if
one desires to control multiple sections of a line, one can first create the
single itineraries, one per section, and then link them by entering in the
second field of the dialog above the name of the next itinerary.
The final step in setting an itinerary is to place the activation button on the
layout, possibly adding a label to it so that the user will know which itinerary
will be activated by clicking on the button. Itinerary buttons are placed on the
layout when Traindir is in "Edit+Edit" mode.
Triggers
In editing mode, if you click on the tool
the program shows a subset of tools, among which you can see the trigger tools: .
Triggers are linked - similarly to signals - to a track element. When a train
(or multiple trains, according to the trigger's properties) crosses the track
element, the trigger may execute a few functions to modify the train's or
layout's state.
By right-clicking while in Edit mode on a trigger, you'll see the following
dialog:
In the drop-menu on the left you can see all possible actions:
- click x,y where 'x,y' are the coordinates of a signal (which will change
its state), of a switch (which will be thrown), or of an itinerary button (which
will become active);
- rclick x,y where 'x,y' are the coordinates of an object; similar to the
above, but simulates a right-click of the mouse on the object. For example,
rclick-ing on a green automatic block signal will set the signal to green-green.
- fast is used to increase the time multiplier;
- slow is used to decrease the time multiplier;
- shunt train (e.g. shunt R12345) will start shunting train R12345;
- reverse train (e.g. reverse R12345) will flip train R12345's direction;
- traininfo train (e.g. traininfo R12345) will show train R12345's properties
dialog;
- stationinfo station (e.g. stationinfo Piovarolo) will show Piovarolo
station's property dialog;
- decelerate speed train (e.g. decelerate 20 R12345) will slow down train
R12345 by 20 km/h. This action is canceled the next time the train crosses a
speed limit indicator: for example, if the train was running at 60 km/h and it
was slowed down to 40 km/h, a subsequent 100 km/h speed limit signal will make
the train speed up to 100 km/h (not to 80 km/h).
- accelerate speed train has the effect of speeding up a train, by reversing
the effect of a previous "decelerate" command. In any case, it's not possible
for the train to run faster than the maximum speed limit for that line section.
One of the boxes in the "Trigger Properties" dialog is the "Probabilities" box.
In this box you can enter how likely it will be for each train type to activate
the trigger. Note that a "1" probability indicates the lowest probability (i.e.
no train will ever activate the trigger), while a "100" value indicates the
maximum probability (i.e. all trains will activate the trigger). If you don't
enter a probability value, (i.e. the value is all "0"s), the program assumes the
maximum probability (100%). For example, entering 1/1/0/0 in this box, will
always activate the trigger for all trains of type 3 and 4; it will never
activate the trigger for trains of types 1 and 2. This is equivalent to
specifying a value of 1/1/100/100.
When a command accepts the name of a train on which the command applies, it's
possible to specify the character "@" in place of the name of the train. This
character is a substitute for the name of the train that activated the trigger.
For example, writing "reverse @" will reverse the direction of all the trains
that cross the trigger. This is very useful on terminus stations or to
automatically revert the direction of shuttle trains.
It is also possible to specify one or more than one train that will activate the
trigger. If you enter the name(s) of the train(s) between the characters "{" and
"}", the trigger will be activated (according to the specified probabilities)
only by the train(s) listed between the { } characters. For example, entering
{ES9876} click x,y the trigger will be activated only by train ES9876.
Similarly, the command {ES9876,IC45} click x,y will activate the trigger only
when either train ES9876 or train IC45 will cross the trigger.
Finally, it's possible to assign more than one action to a trigger by using the
following notation: click x1,y1; click x2,y2; click x3,y3;reverse R1234
that is by separating the various actions by a semicolon ";". Note however that
it's only possible to specify the list of train between "{" and "}" once, even
when the actions to be performed are more than one. For example, the command
{T1,T2,T3} shunt T4; shunt T5; {T6,T7} shunt T8
is illegal, because there are two train lists between { }. Only the first list
will be considered, because when the program sees {T6,T7} it finds a
contradiction, since it will have already executed some of the actions.
The schedule
Each scenario comes with a timetable of all the trains that run on that layout.
The timetable is defined in a text file with the same name as the layout but
with an extension .sch ("schedule").
Unfortunately at the moment it is not possible to enter the timetable from
inside the program. Actually, it would be really cumbersome to have to open a
dialog for each train and enter by hand the names of the stations and the
arrival and departure times.
Such data can be downloaded from a few web sites and processed automatically
to create the schedule file. A site that is particularly useful is the DB site
(Deutsche Bahn), at the address
http://reiseauskunft.bahn.de. The
schedule files of the scenarios that I created and that are available from the
download page, have been created by a program (gentt.exe) that
automatically downloads the data and converts it in the format required by
Traindir.
For more information about the use of gentt, please read the
description of the program.
It is also possible to create your own schedule file with any text editor.
If one uses Word, one must save the file in MS-DOS text format. Files saved in
.doc format will not be recognized by Traindir.
Here's an example of the timetable of two trains that shows the syntax of a
.sch file:
# Example from the Alessandria schedule file.
Start: 5:50
Type: 3 e646w.xpm e646e.xpm
Train: R20374
Length: 200
0:00, 5:32, Voghera
5:38, 5:39, Pontecurone
5:46, 5:47, Tortona
5:53, 5:54, S.Giuliano Piemonte
Enter: 5:59, F2
6:00, 6:01, Spinetta
6:07, -, Alessandria
Stock: R20377
When: 167
Notes: Note relative al treno...
.
Train: R20377
Wait: R20374 240
Enter: 6:31, Alessandria@1
6:36, 6:37, Spinetta
6:38, -, F1
6:43, 6:44, S.Giuliano Piemonte
6:51, 6:52, Tortona
6:58, 6:59, Pontecurone
7:05, -, Voghera
.
The lines that start with '#' are comments, and are ignored. Empty lines are
also ignored.
Start: tells Train Director to set the clock of the simulation to the
specified time. Normally the simulation would start at 0:00, but if the first
train enters the scenario at 5:50, then there's no point in simulating the time
between 0:00 and 5:50.
Type: specifies the type of the following trains. Train Director supports
4 train types. Normally type 1 trains are fast trains (IC, ES), type 2 for
mid-range trains, type 3 for regional and commuter trains, and type 4 for
freight or other slow trains. Each train type is identified on the layout by a
different color. It is also possible to specify the name of 2 .xpm files which
contain the definition of the icons to be used for that train type. The first
file specifies the icon of west-bound trains, the second file specifies the icon
of east-bound trains.
Train: defines the beginning of the data for a specific train. It must be
at the start of the line in the file. It is followed by the name of the train.
Length: specifies the length of the train. Trains with a length may
occupy more than one track element when they are running on the layout.
Wait: tells Train Director that the current train cannot enter the layout
before the specified train has arrived to its final destination. This is useful
for shuttle trains, where the same rolling stock is used for multiple trains.
The number after the train name tells how many seconds must pass before Traindir
alert the user that the train cannot depart because its rolling stock has not
been assigned.
Stock: defines which train will receive the rolling stock of the current
train after the current train arrives at its final destination.
Enter: defines the time and point of entry in the layout. Note that that
point may not be a station. If the train enters from an open-ended track
element, you mush specify a time that will allow the train to arrive at the next
station, which of course will depend by the distance and speed limits between
the open-track line and the station. All the entries preceding the Enter: line
will be ignored.
When there is a dash in place of the departure time of a train it means that
that line defines the final destination of the train. When the train reaches
that point, it will either disappear from the screen, or become availabe to be
assigned to another train or to be shunted to the depot.
A dash in place of the arrival time of a train means that that train will not
stop at that station. Train Director will record the time at which the train
will go through the station, but no penalty will be assigned for late trains.
When:, if present, specifies the days the trains runs on. Use the digit 1
for Monday, 2 for Tuesday, 7 for Sunday.
Notes:, if present, is used to add up to 5 descriptive lines to the
train. The lines will be shown in various placed during the simulation.
Obviously the names of the stations in the schedule file must match the names of
the stations defined during the creation of the layout. A @ character
after a station name identifies a platform number. If the train arrives at a
different platform than the one specified, it will still stop, but the program
will add a penalty.
To see how the schedule files look like, just open the schedule file of one of
the provided layouts.
How to Specify Late Times
From version 3.7 it is possible to specify random delays for each train.
It's possible to specify late entries or late departure for any of the
stations where the train is schedule to stop.
The late times are specified with the '!' character after the entry time
or the departure time as in the following example:
Train: T1
Type: 1
Length: 300
Enter: 0:01!120/10,60/25 A
0:05, 0:06!120/10,60/20 S
0:20, -, B
.
In this example the train has a scheduled entry time of 0:01. However 10% of the times
it will enter 120 seconds late, or 25% of the times it will enter 60 seconds late.
Similarly, the train is scheduled to depart from station S at 0:06; however 10% of
the times it will depart 120 seconds late, or 20% of the times it will depart 60 seconds
late.
It's possible to specify an unlimited number of delays, even though we recommend
to specify the larger delays with the lower probabilities first.
This page is maintained by g_caprino@gmail.com
(remove the _ before sending your message.)
Created on: August 6, 2000
|
|