Equalising 3 train unloader

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?

Equalising 3 train unloader

Postby jarifle » Wed Jun 13, 2018 8:23 pm

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

Re: Equalising 3 train unloader

Postby Kinson25 » Wed Jun 13, 2018 8:45 pm

Posting a picture of your setup, and maybe a save file would really help the forums help you.
Kinson25
Manual Inserter
Manual Inserter
 
Posts: 3
Joined: Mon Mar 20, 2017 11:14 pm

Re: Equalising 3 train unloader

Postby jarifle » Thu Jun 14, 2018 6:40 pm

Kinson25 wrote:Posting a picture of your setup, and maybe a save file would really help the forums help you.

See edit for picture
jarifle
Manual Inserter
Manual Inserter
 
Posts: 4
Joined: Wed Jun 13, 2018 8:21 pm

Re: Equalising 3 train unloader

Postby quyxkh » Thu Jun 14, 2018 7:25 pm

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.
quyxkh
Filter Inserter
Filter Inserter
 
Posts: 464
Joined: Sun May 08, 2016 9:01 am
Location: California

Re: Equalising 3 train unloader

Postby jarifle » Thu Jun 14, 2018 8:33 pm

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

Re: Equalising 3 train unloader

Postby thedarkbunny » Thu Jun 14, 2018 9:12 pm

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.
thedarkbunny
Inserter
Inserter
 
Posts: 33
Joined: Mon Oct 23, 2017 10:46 pm

Re: Equalising 3 train unloader

Postby jarifle » Thu Jun 14, 2018 9:45 pm

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

Re: Equalising 3 train unloader

Postby DaveMcW » Thu Jun 14, 2018 11:01 pm

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.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
 
Posts: 2418
Joined: Tue May 13, 2014 11:06 am

Re: Equalising 3 train unloader

Postby quyxkh » Fri Jun 15, 2018 4:07 am

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.
quyxkh
Filter Inserter
Filter Inserter
 
Posts: 464
Joined: Sun May 08, 2016 9:01 am
Location: California

Re: Equalising 3 train unloader

Postby aober93 » Fri Jun 15, 2018 7:31 am

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.
aober93
Filter Inserter
Filter Inserter
 
Posts: 443
Joined: Tue Aug 30, 2016 9:07 pm


Return to Gameplay Help

Who is online

Users browsing this forum: No registered users and 8 guests