TL;DR
Way for modders to inject their pieces of code into train pathfinder or into the way train pathfinder graph is being built.What ?
Most important case for me in this regard is adding ability for modders to convince pathfinding algorythm that two pieces of rail not connected physically are actually connected in some third party way - for example a teleport by an entity overseeing that piece of rail.Why ?
There is already mod (although looks abbandoned) called Train Tunnels which works on basis of additional ("underground") game layer and "Tunel Entrances/Exits" (further called Interfaces) that teleport pieces of train between layers. I believe this mod is not without its flaws but with some improvements has potential to be great and fulfill dreams of many Factorio players about tunnels/viaducts. One of annoyances is inability of pahtfinder to actually consider those tunnels on its own. Currtnely, the Tunnel Interfaces are implemented as train stations that have to be added to train shedule without wait condition. Train reaches the Tunnel Interface and seeing lack of further tracks slows down but is still teleported to another surface. If modders would be a ble to convince pathfinder graph that end pieces of rail on two different layers are actually connected, it would be possible to make trains cross those tunnels without making a wierd trainstation workaround and would also allow trains to dynamically choose any tunnel, not just he one hardcoded in train shedule.Video example
3:00 - 3:20 : working train tunnel (manual mode)3:20 - 4:10 : explanation of automatic mode trainstation workaround for tunnels + display of working underground tunnel in automated mode
https://youtu.be/yVZi97ZCw4M?t=180