The coherence page already computes the factory's link graph — good X flows from block A to block B at rate R — and rows already get belt/inserter/loader math from lib/logistics.ts. Links should get the equivalent for trains: given the user's rolling stock, how much does one train carry, and how often must one arrive to keep the link fed?
Model (deliberately no round-trip time — trip time depends entirely on the user's layout and differs per route, so trains-in-rotation is out of scope):
- Train config: a factory-level default declaring the consist (e.g. 1-4) and wagon choice — cargo wagon for items, fluid wagon for fluids — with per-link overrides for goods that run dedicated trains. Same header-default + per-row-override pattern as the belt/inserter controls.
- Payload per trip: wagons x wagon slots x good stack size for items; wagons x wagon fluid capacity for fluids. Wagon prototypes come from the data dump (a small import addition alongside the existing belts/inserters/loaders tables — read Py's actual wagon inventory sizes, don't assume vanilla's 40 slots).
- Cadence per link: link rate / payload = required train frequency, displayed as "a full train every N" in the link's row on coherence (and wherever links surface). The cadence is the practicality signal: a train every 40 minutes says rail is comfortable; a train every 30 seconds says belt or pipe it.
Pure math over existing link data, like the logistics column — computed client-side so config changes are instant.
Natural follow-up (separate scope): derive Cybersyn requests from the same links and feed the mod's existing request-combinator planner, so a planned import becomes a generated combinator at the consuming station.
Part of #31.
The coherence page already computes the factory's link graph — good X flows from block A to block B at rate R — and rows already get belt/inserter/loader math from
lib/logistics.ts. Links should get the equivalent for trains: given the user's rolling stock, how much does one train carry, and how often must one arrive to keep the link fed?Model (deliberately no round-trip time — trip time depends entirely on the user's layout and differs per route, so trains-in-rotation is out of scope):
Pure math over existing link data, like the logistics column — computed client-side so config changes are instant.
Natural follow-up (separate scope): derive Cybersyn requests from the same links and feed the mod's existing request-combinator planner, so a planned import becomes a generated combinator at the consuming station.
Part of #31.