Handling more Trains than Stations?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
drachma
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Nov 06, 2017 8:19 pm
Contact:

Handling more Trains than Stations?

Post by drachma »

I have several outposts but many of them are far away from my base. So in the time it takes a train to transit from base-outpost or outpost-base I could have filled up another train. To keep throughput up I would ideally be constantly loading / unloading trains.

One potential solution I thought of is having more trains than I have stations for them, but this introduces a lot of problems I'm not sure how to solve.

Chiefly, trains stop dead on their route when their target trainstop is disabled and there are no other substitutes. Right now I disable occupied stations, so it's likely that this will happen when Ntrains > Nstations.

How have other people handled this issue? Brute force by just building more outposts? One idea I had was to build train stackers at every outpost but have it be an actual train station for every lane in the stacker, with train leave conditions set to "0 seconds inactivity". If a train's valid stops were disabled while mid route, they would just pick the nearest outpost stacker and queue up until the load station was free. This is the simplest solution I think, but there is a probability that many trains would stack up all at one station instead of distributing reasonably.

I was trying to avoid a global circuit network but I may have to go back and retrofit my rails for that. Just wondering if there were any creative alternatives I'm not seeing. Thanks!

Loewchen
Global Moderator
Global Moderator
Posts: 8308
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Handling more Trains than Stations?

Post by Loewchen »

I don't understand your your train schedules. You either have have several outposts in one schedule of one train and deactivate stations without enough required/requested. Or you have dedicated trains for every single outpost, but then you obviously can not deactivate stations but you can have as many trains running for one outpost as you like. I generally dislike deactivating stations because of that exact reason that there is no good way to deal with the there-is-no-active-station case.

DaleStan
Filter Inserter
Filter Inserter
Posts: 368
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: Handling more Trains than Stations?

Post by DaleStan »

drachma wrote:If a train's valid stops were disabled while mid route, they would just pick the nearest outpost stacker
This is strictly true, but highly misleading. If you put stations in the outpost stacker, trains will always pick the nearest outpost stacker, regardless of which proper outpost stations are enabled.

Based on your description, I'd make these changes to your network:
1) Change the disable-station condition to "Disable if available cargo < $threshold", for some appropriate threshold. You could set the threshold as high as "full load capacity of one train" or to any lower value that seems good to you.
2) Optional: Add an additional wait conditions so trains will also leave your outposts if an empty train is waiting to load. This requires reading a signal that will be held at red by a waiting train, and needs some extra work behind it. You can require sure that the empty train has been waiting for at least $timeperiod, or you can require that the loading train has been loading for at least $timeperiod, or you can require that the loading train have at least $threshold cargo. (Or any combination.)
3) Adjust your network so that there's always a route from all points in the network to all stations a train at that point might use. This way, if all your outposts disable themselves, the trains will return to the appropriate unloader. This gives you a centralized location for handling trains, instead of having trains stop in arbitrary locations and gumming up the works for other cargos.
4) As necessary: Add stacker capacity near your unloaders to handle any queues that develop while waiting for the unloader stations.

drachma
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Nov 06, 2017 8:19 pm
Contact:

Re: Handling more Trains than Stations?

Post by drachma »

Thanks for the replies DaleStan.
DaleStan wrote:
drachma wrote:If a train's valid stops were disabled while mid route, they would just pick the nearest outpost stacker
This is strictly true, but highly misleading. If you put stations in the outpost stacker, trains will always pick the nearest outpost stacker, regardless of which proper outpost stations are enabled.
I think this is the behavior I had imagined. It is far from optimal since they won't go to a station that's closest to "ready," but workable. I think I could disable outpost stacker stations based on the state of the outpost available cargo.
1) Change the disable-station condition to "Disable if available cargo < $threshold", for some appropriate threshold. You could set the threshold as high as "full load capacity of one train" or to any lower value that seems good to you.
If I am correct, this will ONLY work if the outpost stackers have stations, since you could have a condition where no outpost has >$threshold and stop all trains dead in their tracks. I had thought about this but avoided it so far since I don't have stations in my stackers yet.
2) Optional: Add an additional wait conditions so trains will also leave your outposts if an empty train is waiting to load. This requires reading a signal that will be held at red by a waiting train, and needs some extra work behind it. You can require sure that the empty train has been waiting for at least $timeperiod, or you can require that the loading train has been loading for at least $timeperiod, or you can require that the loading train have at least $threshold cargo. (Or any combination.)
I did not even realize you could read signals on the circuit network. That opens up some possibilities. That's a good tip. However I don't quite get why I would want this, the way I read it, I would have partially-filled trains leaving my outposts to go unload. Surely this is an underutilization.
3) Adjust your network so that there's always a route from all points in the network to all stations a train at that point might use. This way, if all your outposts disable themselves, the trains will return to the appropriate unloader. This gives you a centralized location for handling trains, instead of having trains stop in arbitrary locations and gumming up the works for other cargos.
Okay, I believe I already have this feature by placing loops on any dead-ends in my track. Trains appear to re-route successfully when their current target station is disabled.
4) As necessary: Add stacker capacity near your unloaders to handle any queues that develop while waiting for the unloader stations.
I keep a big stacker near the unloader already for sure.

Overall sounds like it is worth a try. I will implement and see what happens, then add a whole bunch of trains to see if it breaks.

Loewchen wrote:I don't understand your your train schedules. You either have have several outposts in one schedule of one train and deactivate stations without enough required/requested. Or you have dedicated trains for every single outpost, but then you obviously can not deactivate stations but you can have as many trains running for one outpost as you like. I generally dislike deactivating stations because of that exact reason that there is no good way to deal with the there-is-no-active-station case.
Right now I have exactly 1 train per mining outpost, all outposts named the same, and disable loading stations only when a train is present. Train schedules are simple Goto Unload/Leave when Empty, Goto Load/Leave when full.

I thought to scale to multiple trains per outpost I would need to uniquely name each outpost station, and have each train's schedule try to stop at each one (e.g. Load 1, Load 2, Load 3). this has the benefit of making auto-train-personal-transport much easier for me, allowing me to select particular outposts to travel to, but seems to break DaleStan's method. To fix it might require quite long train schedules, adding the uniquely named outpost stacker station in between each uniquely named outpost station, so the schedule would look like "Load Stack 1, Load 1, Load Stack 2, Load 2, .... Load Stack N, Load N" Which I guess is OK, just requires a lot of train maintenance when adding an outpost. Wouldn't this have a side effect of a full train from Load 1 trying to stop at Load 2 next? How to prevent this? Make the schedule more like Load Stack 1, Load 1, Unload, Load Stack 2, Load 2, Unload... but then this would have the side effect of a potentially empty train re-pathing to Unload whenever it's first target is disabled. Am I missing something?

DaleStan
Filter Inserter
Filter Inserter
Posts: 368
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: Handling more Trains than Stations?

Post by DaleStan »

drachma wrote:I think I could disable outpost stacker stations based on the state of the outpost available cargo.
You could, yes, but then you'll end up in the same place you are now. All the outpost stacker stations could be disabled, and then the trains again don't know where to go.
drachma wrote:you could have a condition where no outpost has >$threshold and stop all trains dead in their tracks.
You also could have the condition where all stops are disabled because a train is present, and the trains stop dead in their tracks anyway. But this way, assuming there's enough cargo available, you can have one or more trains headed for a stop while another train is actively loading.

Are you disabling both your outpost and unloader stops? If so, stop disabling your unloader stops, and trust the pathfinder to route trains correctly from the stacker to the stops.
If not, I expect that "No Path" stopped train is outbound, and doesn't have a route to all the outposts. All the outposts it can route to get a train, and disable themselves, and then the train has no path and stops. If all the outpost stops disable, it'll advance, and return, empty, to the unloader. If, instead, a train leaves one of the accessible outpost stops, the train will route to that, and start moving again.
drachma wrote:I did not even realize you could read signals on the circuit network. That opens up some possibilities. That's a good tip. However I don't quite get why I would want this, the way I read it, I would have partially-filled trains leaving my outposts to go unload. Surely this is an underutilization.
This is definitely a matter of taste. You are underutilizing the train that's currently loading, but you have another train waiting to load, so you'll have minimal loss in loading utilization at that stop, and the train that's waiting to load is also being underutilized. The benefit is this: If, for some reason, all your trains head to the same outpost, you can start sending them back to unload more quickly than normal, so they can unload and get rerouted to other outposts. This behavior is somewhat covered by disabling the stop with a cargo threshold, but then you have to wait for the stop to drop below the threshold before the trains will redirect. On the other hand, they'll redirect without returning through the unload stops. So take your pick.
drachma wrote:I thought to scale to multiple trains per outpost I would need to uniquely name each outpost station, and have each train's schedule try to stop at each one (e.g. Load 1, Load 2, Load 3). this has the benefit of making auto-train-personal-transport much easier for me, allowing me to select particular outposts to travel to, but seems to break DaleStan's method.
I guessed that you had all outpost stops with the same name, and tried to supply a solution that would work without renaming everything. If you do rename everything, you want Optera's LTN. Which is an entirely new layer of complexity, but once you get it working, you never have to mess with schedules again.

Post Reply

Return to “Gameplay Help”