Station Platform Selector for variable platforms

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
Gieke85
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Jun 16, 2017 8:56 pm
Contact:

Station Platform Selector for variable platforms

Post by Gieke85 » Fri Jun 16, 2017 9:43 pm

Howdy folks,

I've been messing about with getting trains to pick the right station platforms ever since I started using trains on a large scale.

This design is based on all the items in the buffer chests being added up and then averaged. If a station has less than the average number or items it gets locked with a red signal (I don't like disabling the station itself because trains won't know where to go anymore, I want them in my waiting area, not running around like headless chickens not knowing where to go).
Every station has its own constant combinator outputting a signal to the wire bus connecting the stations. The total number output from the constant combinators is used for the averaging meaning it doesn't matter whether your station has just 2 platforms or 10.
Because it uses averages it is possible for 2 platforms to have above average items, so it can still pick the non-max platform on rare occasions. But it will never pick the worst ones.
It also uses a signal to read whether a platform is occupied by a train and, if so, cancels out all signals that station puts on the bus, effectively removing the station from the calculation of the other stations, making sure the other stations still calculate which platform a train should pick.

This design works for both terminus and ro-ro train systems and both pickup and unload stations.

Clean picture so the wiring is visible.
Image

Picture with more explanation.
Image

Train stop position (tail end)
Image


Code with a 2 station build I made, should be easy to put down in the middle of nowhere, alter for your purposes and redeploy somewhere else.
For this design I used 1-4-1 trains.

Code: Select all

0eNrlXV1uIzmSvoseZ6zZ5D9ZWOwR+mX3bdEwZDurSliXZEhyYwoNH2AOMhebk6wyVZblZEYoIkgXmtMvZbgkk5lfMH5IfhHx++Lu8bl/2q03h8Wn3xfr++1mv/j0v78v9usvm9Xj8H+H70/94tNifei/LW4Wm9W34bfdav24eLlZrDcP/d8Xn9TLzdU/6f/+tOv3++Vht9rsn7a7w/KufzxcDKJffr1Z9JvD+rDuTw8x/vL9dvP87a7fHWc5j7XarQ9fv/WH9f3yfvvtbr1ZHba741RP2/3xr7eb4SGOIy5VvFl8H36av7njRA/rXX9/+tzfLI7vethtH2/v+q+r39bHvz/+0dvAt8ePH8bB9sM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3etzWsKcsLhEnXVd4WuKCrIy3vOoPKOCflrcPT73T7v1Zhjwt363P33fWu1idD75l5f/BwxyI24=

MadZuri's chest balancer and inspiration for this design:
https://www.reddit.com/r/factorio/comme ... ion_guide/


Feedback is greatly appreciated :)

Good luck and watch out for the trains!

Xtrafresh
Fast Inserter
Fast Inserter
Posts: 103
Joined: Mon Jun 12, 2017 4:57 pm
Contact:

Re: Station Platform Selector for variable platforms

Post by Xtrafresh » Tue Jun 20, 2017 12:12 pm

It's a chest balancer for stations! Nice work, I think I'll actually use this :)

Post Reply

Return to “Railway Setups”

Who is online

Users browsing this forum: No registered users