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 two 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
In addition the block table should have been edited to indicate the blocks where the train should stop
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 pane, and generates transits
If the old panel name was WR.xml, the new panel will be backed up to WR_backup_xx.xml where _xx is an incremental number which is added if previous backups exist
Some checks are done first, we check that:
If all checks pass we get a message:
Further details of the checks can be viewed if required. If the checks do not pass detailsof the errors are given
If no trains are present in the roster with speed profiles, this will be picked up at run time, and can be corrected then.
The following items are then produced automatically, with countdown timwer showing the progression
The following confirmatory message appears:
It is recommended that the panel is saved after testing. The current filename can be used if desired as a backup has been done automatically.
Click Stage2 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.
To add a new station or track
Trains will normally stop at the end of the last block. If the parameter is modified then the given proportion of the last section is used for stopping. A facility is provided so that the user can instead supply the distance (in cm) that the train will stop before the end of the last block. This needs to be done for each route, as even if a train stops at the same station for two routes, the last section may be different, and different parameters need to be calculated.
To set a stopping distance
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.
Thanks and congratulations to all who contributed! Contact us via the JMRI users Groups.io group.
Copyright © 1997 - 2023 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.
View the