Skip to main content
The Dispatcher System is a set of Python tools to extend the capabilities of the Dispatcher.
This is an automated system designed to enable you to run trains using the Dispatcher system between locations (normally sidings or stations, but really any set of blocks) designated by yourself.
Provided you have set up a system as described in System Requirements, by pressing a few buttons on theSystem Generation Panel, a complete system will be set up for you complete with Transits, Train Info files, and buttons for you to press which will route trains across your layout.
A network will be set up behind the scenes which will find the best route from the train's location to the required location, and set in place a set of transits which will guide the train to the required location.
The train will either stop at all stations on the route, or travel without stopping at intermediate stops, depending on whether express or stopping mode is selected
Provision is made for multiple train operation, the trains stopping for each other. This is a feature of Dispatcher, but the system allows easy selecting of each train to control each one.
There are several stages to set up the system for automatic train running:
Fulfil the prerequisites, which include having speed profiled your locos that you wish to run with the system
To use the Dispatcher System there are several prerequisites
Run DispatcherSystem.py in the main jython directory. You will get something like this:
You are prompted to run Stage1 which adds all the icons required to run the system on a new panel.
if the old panel name was WR.xml, the new panel will be WR_icons.xml
Some checks are done first
The following checks are made
If no trains are present in the roster with speed profiles, this will be picked up, and can be corrected at run time.
When the icons file is produced, a message similar to the following will be produced:
A new panel has been created. You should close down and load the new panel, instead of the original.
The panel will have been created by loading the original xml file (in this case WR.ml), editing the details and saving to a new file (WR_icons.xml).
If there were any unsaved edits in the original file these will not be present in the new file, but you will not lose them provided you save them either to the original file or another file once Stage1 has completed. We advise saving all edits before running Stage1, so they are picked up.
PanelPro should be restarted and the icons file produced in stage 1 should be loaded.
A screen similar to the following will be produced:
Once the Stage2 button is pressed one gets a confirmatory messages:
The signal logic is produced, then the following confirmatory message appears:
Transits required to move the train from stop to stop will be produced, and corresponding train-info files which contain the information required for running the train are produced. Some of the information is overwritten when the train-info files are used such as the train name, so train info files do not have to be produced for each train.
Train-info files are produced for each route allowed, and all routes are allowed which are physically possible to travel. Train-info files are produced for forward and reverse operation, so there can be quite a number produced.
Once the transits and train-info files are produced we get a message:
You should then restart JMRI and load the run panel instead of the icons panel, in this example WR_run.xml
Restart JMRI and load the newly produced run panel, in our example WR_run.xml
Run dispatcher System again to get
Click Stage3 and one gets two screens opening,the Dispatcher options screen and another saying the options that need to be set for the Dispatcher system to work
Set the required option and we get a message reminding you to save the changed options
Select the dispatcher window that has opened automatically and click => Save Options
To run the system it is advised to have the thread monitor running (Panels => Thread Monitor)
You will notice several buttons in the top RH corner.
The first two start and end the threads required for the program to run. The threads need to be in operation for the other buttons to work. The threads can be viewed by clicking Panels | Thread Monitor on the PanelPro Window.
To run the system the following needs to be set up
Press the run button. The Express Train and the Run Dispatch options will be highlighted and the run Dispatch option will cause the following prompt to be displayed:
The first step is to register a train in a siding or at a stop. If you are simulating the system to see whether it will work before running trains you may press the bottom left hand small button which will make the section occupied. Drive a train to the required stop, and press Setup Train in Siding.
We need to tell the system which way the train is pointing.
suppose we have the following layout
Choosing the Train
We click SetupTrain in siding
If the train is siding 1b as indicated one gets the following message
Where if we click the dropdown we get all the trains in the system with a speed profile. We choose the required train and click OK
Register the Direction the train is facing
The following message then pops up
Select the correct direction and click OK.
The train will appear in the memory location for the block
To set up a dispatch a train (or several trains bust be registered with the system, and located in a stop).
Clicking a red button will allow a dispatch to be set up to that location.
Suppose one has the following layout with a train in siding1. Click the Passing Loop button as indicated to set up a dispatch to Passing Loop.
There is an express icon. If set the train type will default to express (moves without stopping at intermediate stations), If unset, will default to stopping as shown.
Select the required train from the drop down, and a dispatch will be set up to the next stop (Siding1A).
The train will start moving, and the speed indicated in the Auto trains window.
The train will move to Siding1B, stop and the dispatch will terminate, another dispatch will start up to the next stop which will be to passing loop.
Click 'Setup Route'. The following message will be displayed:
You now press the red section (station) buttons to set the route. The first button will be the start of the route.
The subsequent buttons will be the intermediate stations. At each station you will be asjked:
You will be told what station you have selected and be asked whether to:
If you press complete route, a route will be automatically set up with the name being the amalgam of the start station and the end section. If a route already exists with that name, an index will be appended. The name of the route can be changed bu clicking the 'View / Edit Route' button or the View Route button on the pop-up.
To run a route a route must already have been set up. Click Run Route
You will be prompted with all the routes you have set up
Choose the required route and click OK.
If you have no train in a station registered with the system, or all trains registered are being dispatched you will get the following message:
Put a train in a station, register it and try again. In the below example we have one train available 'Class 20'
You will then get the following message:
To store the routes we have used the mechanism provided by Operations which normally provides instructions to move trains manually. To schedule the trains we use the scheduling mechanism of Operations.
To check that we have some routes setup we press 'View/Edit Routes'.
To schedule these routes we press 'View/Edit Scheduled Trains'. Here we have set up 3 trains to be scheduled.
To setup a new train press 'Add...'. To see the route press Edit for the particular train. For instructions on how to set up the trains you can l ook at the help for Operations which can be seen by pressing Help | Window Help.
The mechanism is quite straightforward and you probably can setup the train without any further help.
On Add train you will get the following pop-up
Note that you have to fill in
All other entries can be ignored as the Dispatcher System does not use them.
If the trains have been scheduled in the Operations scheduler as described above pressing the 'Start Scheduler' button will start the scheduler at a midnight on a fast clock 1 times the normal speed.
If you wish to change the start time (trains may start later) or wish to change other parameters press Set scheduler start time.
I recommend changing the fast clock to 10 times normal speed, and the fast clock time to whatever you require, but at least a few minutes before the first train to be scheduled.
You may wish to view the fast clock. I like the analog clock so there is a button 'Show Analog Clock', but if you wish to see another clock change the code or use the menu on PanelPro | Tools | Clocks.
To start the scheduler press 'Start Scheduler' and the clock will start and the trains set up to be dispatched will start when the fast clock gets to the correct time.
Copyright © 1997 - 2022 JMRI Community. JMRI®, DecoderPro®, PanelPro™, DispatcherPro™, OperationsPro™, SignalPro™, SoundPro™, TrainPro™, Logix™, LogixNG™ and associated logos are our trademarks. Additional information on copyright, trademarks and licenses is linked here.