Equalising 3 train unloader
Equalising 3 train unloader
I've got a train station consisting of 3 unload bay. i would like a circuit system to check what bay is least filled and open the signal corrisponing to that bay.
How would i go about doing this? I'm really bad at circuit networks. As you can see in the picture i have 3 lanes.
Say
lane 1 has 1000 ore
Lane 2 has 2000 ore
Lane 3 has 0 ore
Then i want all trains to go to 3
How would i go about doing this? I'm really bad at circuit networks. As you can see in the picture i have 3 lanes.
Say
lane 1 has 1000 ore
Lane 2 has 2000 ore
Lane 3 has 0 ore
Then i want all trains to go to 3
Last edited by jarifle on Thu Jun 14, 2018 6:40 pm, edited 1 time in total.
Re: Equalising 3 train unloader
Posting a picture of your setup, and maybe a save file would really help the forums help you.
Re: Equalising 3 train unloader
See edit for pictureKinson25 wrote:Posting a picture of your setup, and maybe a save file would really help the forums help you.
Re: Equalising 3 train unloader
You get a simpler circuit and good results by opening the stops with belowaverage content, and an even simpler circuit and better results by opening only stops that have less than 44 stacks of content in the buffers.
Re: Equalising 3 train unloader
That is true but i't not what i want.quyxkh wrote:You get a simpler circuit and good results by opening the stops with belowaverage content, and an even simpler circuit and better results by opening only stops that have less than 44 stacks of content in the buffers.
Reason being is that every station corresponds to 1 line on my main bus and i want every line to be at least partially full for maximum throughput.

 Inserter
 Posts: 45
 Joined: Mon Oct 23, 2017 10:46 pm
Re: Equalising 3 train unloader
Calculating maximum or minimum out of a group of signals is, generally speaking, a pain. Simplifying to "below average" saves a lot of combinators, with relatively little risk of starving one of your stations.
Re: Equalising 3 train unloader
Oke and how would i go about this?thedarkbunny wrote:Calculating maximum or minimum out of a group of signals is, generally speaking, a pain. Simplifying to "below average" saves a lot of combinators, with relatively little risk of starving one of your stations.
Re: Equalising 3 train unloader
3 is a small enough number that you can calculate an exact answer.
Decider combinator: Iron ore (station 1 chests + negative station 2) ≤ 0 → Green = 1
Decider combinator: Iron ore (station 1 chests + negative station 3) ≤ 0 → Green = 1
Signal 1: Green = 2
Arithmetic combinator: Each (station 1 chests) * 1 → Each (negative station 1)
Decider combinator: Iron ore (station 2 chests + negative station 1) ≤ 0 → Green = 1
Decider combinator: Iron ore (station 2 chests + negative station 3) ≤ 0 → Green = 1
Signal 2: Green = 2
Arithmetic combinator: Each (station 2 chests) * 1 → Each (negative station 2)
Decider combinator: Iron ore (station 3 chests + negative station 1) ≤ 0 → Green = 1
Decider combinator: Iron ore (station 3 chests + negative station 2) ≤ 0 → Green = 1
Signal 3: Green = 2
Arithmetic combinator: Each (station 3 chests) * 1 → Each (negative station 3)
Use green wires for positive numbers and red wires for negative numbers. All 3 red wires need dedicated electric poles to prevent them from touching. If you try to scale this beyond 3, the combinators required is equal to the number of stations squared.
Decider combinator: Iron ore (station 1 chests + negative station 2) ≤ 0 → Green = 1
Decider combinator: Iron ore (station 1 chests + negative station 3) ≤ 0 → Green = 1
Signal 1: Green = 2
Arithmetic combinator: Each (station 1 chests) * 1 → Each (negative station 1)
Decider combinator: Iron ore (station 2 chests + negative station 1) ≤ 0 → Green = 1
Decider combinator: Iron ore (station 2 chests + negative station 3) ≤ 0 → Green = 1
Signal 2: Green = 2
Arithmetic combinator: Each (station 2 chests) * 1 → Each (negative station 2)
Decider combinator: Iron ore (station 3 chests + negative station 1) ≤ 0 → Green = 1
Decider combinator: Iron ore (station 3 chests + negative station 2) ≤ 0 → Green = 1
Signal 3: Green = 2
Arithmetic combinator: Each (station 3 chests) * 1 → Each (negative station 3)
Use green wires for positive numbers and red wires for negative numbers. All 3 red wires need dedicated electric poles to prevent them from touching. If you try to scale this beyond 3, the combinators required is equal to the number of stations squared.
Re: Equalising 3 train unloader
You can get this down to 3N3 combinators if you're willing to go a little oldschool on it.
After the first stop, each new stop feeds the previous least amount and the current stop into a comparator, EachtoEach *1, <0, 0. The previous value's redwired to the first (negator) and third (isolator) inputs, the current stop's value is greenwired and the negator output is redwired to the decider's input, whose output's greenwired to the isolator's input. So the decider gets the current stop minus the previous value, and if that's less than zero, the difference is subtracted from the previous value producing either the previous value or this one, whichever's less. The final isolator is a *1, its output's redwired to the entry signal at each stop, which is also greenwired to the buffer chests and is set to close if anything > 0. So only the stop(s) with the least amount can be green, put them behind a chain signal and the trains will do what you want.
edit: fixed braino'd isolator constant.
After the first stop, each new stop feeds the previous least amount and the current stop into a comparator, EachtoEach *1, <0, 0. The previous value's redwired to the first (negator) and third (isolator) inputs, the current stop's value is greenwired and the negator output is redwired to the decider's input, whose output's greenwired to the isolator's input. So the decider gets the current stop minus the previous value, and if that's less than zero, the difference is subtracted from the previous value producing either the previous value or this one, whichever's less. The final isolator is a *1, its output's redwired to the entry signal at each stop, which is also greenwired to the buffer chests and is set to close if anything > 0. So only the stop(s) with the least amount can be green, put them behind a chain signal and the trains will do what you want.
edit: fixed braino'd isolator constant.
Re: Equalising 3 train unloader
This is what i solved with this circuit, only 3 combinators per bay.
viewtopic.php?f=193&t=44038&hilit=train+balancer
But since 0.15 i am shutting down the station instead of the signal, to avoid rare deadlocks. Ive changed it abit, i can upload it if u want.
viewtopic.php?f=193&t=44038&hilit=train+balancer
But since 0.15 i am shutting down the station instead of the signal, to avoid rare deadlocks. Ive changed it abit, i can upload it if u want.