In a continuous exchange of ideas with Frank Buchholz and thanks to Frank’s programming skills we’re happy to present version 2 of the EEP Lua Automatic Train Control. The previous version was posted earlier on this forum: link to version 1 thread.
The original idea is still the same: trains run fully automatically from block to block, whereby the user can define which trains are allowed in which blocks and if there are scheduled stopping times per train and block.
What's new is that it’s easier than ever to prepare your EEP layout for automatic train traffic. All that is needed is a stop signal at the end of each block and an entry sensor at the beginning. The "memory signals" that were required in version 1 have been eliminated. Tool tips are available that can help identify turnouts and signals.
Another improvement is that the somewhat tedious way of placing trains is replaced by fully automatic train detection. A new train can simply be placed in front of the pre-signal of any block, be given a name and a speed, and as it approaches the signal the Lua code automatically detects it.
A new feature is that "allowed blocks" can be configured as groups. If multiple trains are allowed in the same blocks, it can be beneficial to name a group, such as “intercity” or “cargo shuttle”, and define the allowed blocks for that group. This way the same allowed blocks don’t have to be kept repeated in the trains table, which also becomes much better readable this way.
The new version 2 also includes a provision to avoid “deadlocks”. With some layouts it could happen that opposing trains can not find a free block in front of them anymore. This is avoided by defining "anti-deadlock" paths. An example of such a path: {{3,4,5}, 6, {7,8}}, where 3,4,5,7,8 are dead ends and 6 is a "via" block. This definition means that a train in block 3,4 or 5 will only depart via block 6 if at least one of the blocks 7 or 8 is free. Without this provision a train could enter block 6, which would lead to a deadlock if there already are trains in both block 7 and 8.
And then perhaps the greatest new feature is a tool that can automatically generate the Lua tables to define the layout. Simply enter your .anl3 file in the tool and it will create the tables that can then be copy & pasted into your Lua code, saving quite some work. Please have a look at the user manual, chapter “Tools for Generating Lua Configuration Tables”, to see how to do this.
A ZIP file can be downloaded here: EEP Lua Automatic Train Control v2. It contains:
- the Lua control file, which must be placed in the EEP installation folder \LUA.
- several demo layouts explaining how to configure Lua tables to enable automatic train traffic
- a user manual in English and in German
If you’d like to have a look at the user manual beforehand, the pdf can be downloaded here:
- English: User Manual EEP Lus Automatic Train Control v2
- Deutsch: Benutzerhandbuch EEP Lua Automatische Zugsteuerung v2
Have fun, Frank Buchholz & Rudy Boer.