Transits and the Transit Table

What is a Transit?

A Transit is a group of two or more connected Sections that describes a route around the layout of a Train traveling in a given direction using JMRI Dispatcher.
A Section may be in multiple Transits, and may be in a given Transit multiple times. Sections are kept in order—the first Section is connected to the second, the second is connected to the third, etc. That means a Section in a Transit must be connected to the Section before it (if there is one) and to the Section after it (if there is one). The order of the Sections determines the direction of travel in the Transit. Trains travel from Sections with lower sequence numbers toward Sections with higher sequence numbers. Normally Transits would only be defined for mainline track, and sometimes staging yard track.

In user-specified areas of a Transit, alternate Sections may be designated. For example, to move between the "2nd" and "4th" Sections in a Transit, there may be multiple "3rd" Sections, any of which might be used to travel between the 2nd and 4th Sections. Alternate Sections provide for passing tracks and staging yards. Transits also provide for reverse loops. To provide for back-and-forth running, e.g. for trolley cars, an option is provided in Dispatcher to automatically reverse the direction of running through a Transit when the Train reaches the end of its Transit, and have the Train run in reverse to the beginning of its Transit.

Transits support both Manual and Automatic operation of Trains. When a Train is running in automatic mode, Transits provide for Actions to be activated when the Train reaches a designated Section in the Transit. An Action may be initiated by a number of events, for example, when the Train enters a Section, or when the Train stops. A variety of actions are possible, such as pausing the Train for a user-designated number of fast clock minutes (a station stop), reverting to manual mode for local manual operation, or sounding the horn on a sound decoder.

How are Transits Activated and Used?

Transits are static objects. They specify itineraries for Trains to follow around the layout. Transits do not run trains, or keep track of running trains.
A Transit becomes part of the train running process when it is activated by being assigned to an Active Train. Transits are saved as part of a Panel/Configuration file, only need to be set up once, and can be reused.
Active Trains, on the other hand, are dynamic and transient. Active Trains are not saved to disk, and must be set up each time they are used.

Transits are activated in the Dispatcher window, where a Transit is linked to a Train to create an Active Train. When an Active Train is created, a Transit is selected, a Train is selected, and a starting Block (Train location at start) and ending Block (Train location when travel is complete) are specified, along with options. This process results in an Active Train, which can then be dispatched. A Transit may be used by only one Active Train at a time.
When an Active Train is done, its Transit isdeactivated, and may be reused for a subsequent Active Train.

A Train may start from a Block outside of the Transit, but connected to a Block within the Transit, or a train may start from a Block within a Section in the Transit. A train moves through a Transit in only one direction--defined by the order in which Sections are included in the Transit. Trains move from lower sequence number Sections toward higher sequence number Sections. The only exception to this is the back-and-forth option that allows a train to run in reverse through its Transit back to the beginning of the Transit.

When an Active Train is initiated, an allocation request is placed for a starting Section. If the Section is free, the Section will be allocated to the train. Allocation means that the Section is assigned the Active Train, and the train is authorized by the dispatcher to proceed to the end of that Section.

When an Active Train is created, it may be activated for running by an engineer using a throttle, or automatically by a virtual engineer. Dispatching consists of allocating Sections, one by one, to the Active Train. The actual dispatching may be done by a dispatcher sitting at the computer running JMRI, or semi-automatically by the computer. If a requested Section is currently in use, a request for assignment is placed in the dispatcher's queue. When a Section is freed, the queue is scanned for the highest priority train requesting it.

Using the Transit Table to Set Up Transits

Transits are set up in the Transit Table. When set up, Transits are independent of the Trains that use them.

All Transits that currently exist can be referenced using the Transits tool under Tables in the Tools menu of most JMRI programs. There are seven columns in the Transit Table:

To define a new Transit, click the Add... button. An Add/Edit Transit window will be brought up that will allow you to designate the Sections in the new Transit. (Obviously, Sections must be defined before any Transit can be created.) Since a Transit may be used in only one Active Train at a time, the Duplicate option (see above) may save time when creating multiple copies of the same Transit.

Using the Layout Editor to Set Up Transits

If you are using a Layout Editor Panel to define and generate the Logic for Signal Masts and Sections, it is possible to create a basic Transit from the Layout Editor. To do this, bring up the context menu (right-click) of a Signal Mast on the panel. If things have been set up correctly you will see the option to Create Transit From Here. After selecting that option you can progress along your route and select each facing Signal Mast, bringing up the context menu on each and selecting Add to Transit. When you are at the final destination Signal Mast on your route, select Add to Transit and Complete in the context menu of that last Signal Mast.
Please note that you will have to manually save the Transits to disk (see below).

Setting up for Continuous Running

A Transit may be set up for continuous running, allowing an Active Train to travel through its Transit multiple times without being terminated and re-activated. Provided its Transit is set up for continuous running, each time an Active Train completes traveling through its Transit, the Active Train optionally may be automatically reset by Dispatcher so it is ready to run through its Transit again. For continuous running, an Active Train must start and end in the same Section, and must be pointed in the same direction when starting and when ending. For a Transit to be capable of continuous running, its first Section and its last Section must be the same, and both must be set up for running in the same direction. This applies to both Manual and Automatic running of Trains.
For more information on setting the continuous running option, visit the Activate New Train Help.

Specifying Actions for Automatic Running

Transits support a variety of Actions that automatically happen when a Train is run through the Transit in Automatic mode. One or more Actions may be specified with each Section in the Transit. Action are initiated when their associated Section in the Transit is entered by the Automatically run Train.
Each Action has two parts:

A commonly used Action, for example, is "When the train starts, turn on its headlight." More information on Actions is located in the Actions. Read more on Actions.

Saving Transits to Disk

Use the Store item in the File menu to save Transit information to disk. This information is saved with the configuration in an XML file, along with control panel setup and similar items. To store your panels in the same file (recommended), select File -> Store > Store Configuration and Panels To File... or select Panels > Store panels... in the main JMRI window.

Back to the Transits help intro.