Simple train manager (STM) deprecated


Simple train manager (STM) based on priority for a multiple producer/consumer traffic control

Content
3 years ago
1.0
5
Trains
Owner:
Telkine2018
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
3 years ago
Latest Version:
0.0.4 (3 years ago)
Factorio version:
1.0
Downloaded by:
5 users

Objective

This mod is dedicated to the managmenent of a simplified train network based on a system of priority.

It adds a new kind of train stop (STM train stop).

When a train leaves a STM train stop, the mod finds the name of the next station in the schedule, then computes the priority of each station which has this name, and routes the train to the station which has the greater priority (using a temporary train stop).

If no station is found, the train waits until a station become available.

If the priority is negative or lower than the minimum priority, the corresponding station is removed from the candidate list.

The priority is made of a based priority minus a penalty for each incoming train to the station.

You can also define the maximum number of incoming train to a station and a penalty based on the distance between the train and the destination station.

All values (based priority, minimum priority, incoming train penalty, max incoming train, distance penalty) are dynamically defined by specific virtual signals wired to the destination station.

Fuel management

You can add a station whose name begins with "FuelStop" to a schedule. If a train has more than 120 seconds of fuel, it will skip the train stop.

Selector

A Selector is an object looking like a lamp which may be put near an existing trainstop. In the editor of the selector, you can define the name of a station.
For all train coming from this station, you can set a specific set of signals wired to the selector. The purpose of the selector is to manage trains coming from different producer stations.
For example, you can have the same station receiving iron plate from a station and copper plate from another. They are managed by two different selectors.

Usage

For a producer station:
- define a base priority for a station. The stations with the highest priority will get the empty trains
- set the signal base priority to the base priority plus the number of items stored in the station
- set the signal penalty to the capacity of the trains coming to the station
- set the signal max incoming train count to the size of the stacker + 1

For a consumer station:
- define a base priority for a station. The stations with the hightest priority will be serviced first.
- set the signal base priority to the base priority minus the number of items stored in the station
- set the signal minimum priority to the base priority minus the number of items expected in the station
- set the signal penalty to the capacity of the trains coming to the station
- set the signal max incoming train count to the size of the stacker + 1

Commands

/stm_log
Toggle log messages (also send to standard factorio log)

/stm_manual "station"
Set all train whose schedule has a train stop whose name contains "station" to manual mode
If "station" is omitted, set all trains to manual mode
STM waits the trains to be stopped before setting to manual mode (to avoid crash)

/stm_auto "station"
Set all train whose schedule has a train stop whose name contains "station" to automatic mode
If "station" is omitted, set all trains to automatic mode except if the schedule is empty

/stm_stations "station"
List stations with status possibly filtering the ones that contains "station"
Send a virtual-X signal to a station to have it appear with a (*) in the list

/stm_unfreeze fix
Detect and fix some freeze situation for trains

/stm_train {id train}
Display some useful informations about a train

Example

A demonstration game

A demonstration game using selectors

A megabase using STM

  • this base (~4300 spm) is made of three distinct bases:

    • a starter base producing about 120 spm
    • a mid-game base producing 1000 spm fully managed by STM
    • a end-game base using direct insertion producing 3000 spm (only the ore trains are managed by STM)

Speed: 50-60 ups on my computer