Equalising 3 train unloader

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
jarifle
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jun 13, 2018 8:21 pm
Contact:

Equalising 3 train unloader

Post by jarifle »

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.
Knipsel.PNG
Knipsel.PNG (1.12 MiB) Viewed 3975 times
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.
Kinson25
Inserter
Inserter
Posts: 36
Joined: Mon Mar 20, 2017 11:14 pm
Contact:

Re: Equalising 3 train unloader

Post by Kinson25 »

Posting a picture of your setup, and maybe a save file would really help the forums help you.
jarifle
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jun 13, 2018 8:21 pm
Contact:

Re: Equalising 3 train unloader

Post by jarifle »

Kinson25 wrote:Posting a picture of your setup, and maybe a save file would really help the forums help you.
See edit for picture
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Equalising 3 train unloader

Post by quyxkh »

You get a simpler circuit and good results by opening the stops with below-average content, and an even simpler circuit and better results by opening only stops that have less than 44 stacks of content in the buffers.
jarifle
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jun 13, 2018 8:21 pm
Contact:

Re: Equalising 3 train unloader

Post by jarifle »

quyxkh wrote:You get a simpler circuit and good results by opening the stops with below-average content, and an even simpler circuit and better results by opening only stops that have less than 44 stacks of content in the buffers.
That is true but i't not what i want.
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.
thedarkbunny
Inserter
Inserter
Posts: 46
Joined: Mon Oct 23, 2017 10:46 pm
Contact:

Re: Equalising 3 train unloader

Post by thedarkbunny »

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.
jarifle
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jun 13, 2018 8:21 pm
Contact:

Re: Equalising 3 train unloader

Post by jarifle »

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.
Oke and how would i go about this?
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3714
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Equalising 3 train unloader

Post by DaveMcW »

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.
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Equalising 3 train unloader

Post by quyxkh »

You can get this down to 3N-3 combinators if you're willing to go a little old-school on it.

After the first stop, each new stop feeds the previous least amount and the current stop into a comparator, Each-to-Each *-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.
aober93
Filter Inserter
Filter Inserter
Posts: 453
Joined: Tue Aug 30, 2016 9:07 pm
Contact:

Re: Equalising 3 train unloader

Post by aober93 »

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.
Post Reply

Return to “Gameplay Help”