serial stations / waiting bay as station

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
Post Reply
vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

serial stations / waiting bay as station

Post by vanatteveldt »

I usually build a waiting bay just behind a station so a train is ready to pull in to the station the moment the train before it leaves.

Then I thought: Why not also (un)load the waiting train?

Image

The basic idea is to just add a identical train stop just behind the existing one, but set a circuit connection to only activate it if the signal ahead of it is non-green. This can cause some false positives (a train could select the secondary station even if there is no train in the primary, e.g. because the train was just leaving), but in a running high-throughput experiment it seems to work pretty well. You could also condition it on a train actually being in the primary station, but that creates a lot of false negatives as it takes (relatively) long for the train to actually stop at the station, so in a high-throughput situation a train might already be waiting in the waiting bay by the time the station is activated (which is too late)

As you can see, 4 double stations can just about process two fully saturated input tracks, which would require 6-8 single stations; so I think a double stations has about 150% the throughput of a normal station plus waiting bay, in exactly the same area (but of course with higher material cost and potentially more bot distance and buffering)

Edit: close-up of station 'design' (the GIF is a bit too blurry to see details, not that there are many):

Image

This shows the 'secondary' station linked to the signal. Both stations are now occupied, the top engine is the last (pushing) engine of the top train, the bottom engine is the first engine of the bottom train.

mrvn
Smart Inserter
Smart Inserter
Posts: 5681
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: serial stations / waiting bay as station

Post by mrvn »

Why not have the train wait at the waiting-bay station till the next signal is green?

Disabling the waiting station when there is no train in the main stations should cause trains to re-path to a waiting station where there is a train in the main station. So I think trains would bunch up on busy stations leaving others completely empty.

hoosh
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue May 17, 2016 7:49 pm
Contact:

Re: serial stations / waiting bay as station

Post by hoosh »

Maybe im not seeing something because i dont have the game in front of me but...

Couldnt you just put a regular signal instead of the train stop with the unloaders? That would eliminate the need for any circuitry whatsoever. In theory if there was a train in front of it it would stop and the unloaders would work. If there wasnt it would just go forward anyway. Also as soon as the space is cleared it would stop unloading in the backup station.

I suppose if inserters dont work when its stopped at a signal as opposed to a station that might be a problem but being that ive stopped next to them in the wrong space before i dont think it would matter.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: serial stations / waiting bay as station

Post by vanatteveldt »

@hoosh: I think inserters won't work if the train is on automatic and is not stopped at the station. If it's on manual they will work.

@mrvan: that's actually a pretty cool idea. The only disadvantage would be the extra stop, so the train takes longer to get to the primary station. I'll do a throughput test with both options, see which works better. I've put a chain signal before the junction where they choose stations, so if both primary and secondary station are occupied they can't enter that path, and they will repath to an empty station. The pathing penalty for occupied blocks should also make them prefer an empty station?

mrvn
Smart Inserter
Smart Inserter
Posts: 5681
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: serial stations / waiting bay as station

Post by mrvn »

You can do more complex logic. E.g. disable waiting stations that have a train in the main station unless all of them have. That way trains will re-path to a waiting stations where they can drive on.

I'm afraid you can't have the trains skip the waiting stations because to do that you have to disable all of them so the train skips to the real station. But then all trains on the way do skip. Re-enabling stations later won't make them stop at a waiting station, their goal would be the real stations.

This would work so much better if one could set a trains target station using circuits.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: serial stations / waiting bay as station

Post by vanatteveldt »

Yeah... I wanted to avoid complex logic because I fear it would just, well, complicate things :)

I have to say I'm pretty happy with the behaviour with the simple solution [enable secondary station if green=0 on signal ahead] seems to work pretty well as you can see from the GIF, at least when the input is fully saturated. I'll test with less traffic as well, but in that case I think it shouldn't be a problem...

mrvn
Smart Inserter
Smart Inserter
Posts: 5681
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: serial stations / waiting bay as station

Post by mrvn »

I wonder if any train even waits at the waiting station and not just the signal?

Did you test if unloading works when automatic trains wait at a signal?

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: serial stations / waiting bay as station

Post by vanatteveldt »

I'm pretty sure they don't work at a signal. You can see in the GIF on the second line (from left) that the train heading to the front station has to wait at the signal halfway in the back station and the inserters don't work.

You can also see that there's a delay between the first train and the second train leaving, and the second train does not stop at the front station (but is set to wait until full)

SuicideJunkie
Fast Inserter
Fast Inserter
Posts: 123
Joined: Wed Aug 23, 2017 10:17 pm
Contact:

Re: serial stations / waiting bay as station

Post by SuicideJunkie »

What if you have the wait condition of the waiting bay be 'until Signal', and that signal is set based on the main unloader in that lane being free?

Have the main station transmit the train ID to the waiting bay station in the same lane. When that signal goes away, the waiting train will pull ahead and then stay at the main station until full/empty.
No complex logic, just one wire between each pair of stations.

Cribbit
Fast Inserter
Fast Inserter
Posts: 199
Joined: Mon Oct 09, 2017 9:35 pm
Contact:

Re: serial stations / waiting bay as station

Post by Cribbit »

The goal of any set of train stations is that every station should be able to be used at once. This is a simple metric to see if maximum throughput is being achieved.

This means that any new train coming in should be able to get to an empty station unless every station is already full.

This means that a train must be able to leave as soon as it is done (empty/full depending on station).

This is solved trivially in a one-deep set of stations, the two+ deep setup is an interesting one.

An immediate issue you have (not unique to this style) is that outbound trains can block a 1st slot while waiting for the outbound line to be open for travel. This can be easily solved by having a longer section of track before merging them to the outbound line.

The real question is whether it's worth it to move trains forward to a 1st slot from a 2nd slot when the train infront of them leaves. However, I think this is not something to actually worry about. 12 fully upgraded stack inserters should fill/empty a train fast enough that the time spend accelerating and then stopping again to pull forward is more detrimental than simply letting it fill and leaving.

You can also minimize this issue by prioritizing the 2nd slot where you just filled the 1st slot. The 1st slot will always fill and leave first, the 2nd slot will do the same right after. Thus the 2nd slot will spend as little time as possible blocking that 1st slot. You'll want some sort of timer so that if the 2nd slot doesn't fill fast enough after the 1st slot does then it goes back to prioritizing the next 1st slot. If all 1st slots are filled prioritize the 2nd slot behind the most recently filled 1st slot.

mrvn
Smart Inserter
Smart Inserter
Posts: 5681
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: serial stations / waiting bay as station

Post by mrvn »

As mentioned with stack inserters the loading/unloading time is low while acceleration and deceleration of long trains take forever. So in the time a train stopped at the secondary station moved up to the primary station you might as well have unloaded it. Basically you don't want the train to stop twice. It should pick either the primary or the secondary station to unload.

So maybe that can be done using circuits. Instead of having primary and secondary stations why not name all stations the same and deactivate all stations but one primary station. When a train arrives at the active primary station disable that station and at the same time enable the secondary station of that lane. The next train will then pull up behind the first and they can unload in parallel. When a train arrives at the secondary station disable it and at the same time enable the next primary station, making that one the active primary station.

So you would send trains to each station in a round-robin pattern, two trains per lane before switching to the next. One additional advantage of this would be to keep all buffer chests balanced.

Variants:

1) if the train leaves the primary station before the secondary has a train incoming you can reactivate the primary station. But that would only have an effect when no trains are present in the station at all and then who cares what station the next train picks?
2) If buffer chests aren't drained equally you must skip stations that don't have enough buffer space to unload.
3) Timing might be tricky and if ever all stations are deactivated then all trains will skip to the next stop. To guard against that add a branch at the end with a dummy station that is always enabled but blocked by a red signal. Trains should repath there only if no other station is available (since they are all closer) but not advance to it because of the red signal. Then when a proper stations activates again they repath to that.

Post Reply

Return to “Railway Setups”