Page 1 of 1

Train Full Cargo - Mixed loading

Posted: Fri Sep 02, 2016 10:05 am
by Honvor
No idea if this is the right subforum, but there is a problem with 0.13 train orders and mixed loading:

given a platform which receives multiple kinds of ore, like this one:
Mixed platform
Mixed platform
platform.png (183.45 KiB) Viewed 6986 times
There is an obvious deadlock: a wagon with room for stone will never be filled (all inserters are holding copper), does not register as fully loaded, which leads to the train never leaving.

I am working around this by filtering ore so chests get filled with a single ore type, so inserters don't block my trains. But I cannot see an easy or obvious solution to this sneaky deadlock problem.

Re: Train Full Cargo - Mixed loading

Posted: Fri Sep 02, 2016 10:36 am
by Martc
I usually add another condition, that train will leave after 2 minutes of waiting. This isn't best solution but at least train is not deadlocked.

Re: Train Full Cargo - Mixed loading

Posted: Fri Sep 02, 2016 10:52 am
by Deadly-Bagel
Add train wait condition:

Inventory full
OR wait 10 seconds (tweak for loading time)

Had this problem with a merged copper and iron deposit. You'll end up with a train filled up to 49 less than capacity, not the end of the world.

Re: Train Full Cargo - Mixed loading

Posted: Fri Sep 02, 2016 11:06 am
by Honvor
When I said "I don't see an easy or obvious solution" I meant I don't see an effortless solution ;) Wait until empty, wait until full, connect everything up and go. Yeah, no. I don't mind, I only run into this at my temporary stations, but it took me a while to figure out why my trains were all standing still.

Re: Train Full Cargo - Mixed loading

Posted: Mon Sep 05, 2016 3:31 pm
by person3triple0
I've had the same issue with a mixed copper/coal depot. the best you can do is to filter the chests: first, load into passive chests, then use green inserters to load into blue chests requesting the correct type of ore. You'll need about 100 robots to do it efficiently.

Re: Train Full Cargo - Mixed loading

Posted: Tue Sep 06, 2016 12:05 pm
by Deadly-Bagel
You'll run into the same problem, all your copper chests fill up so the belts stop moving but your coal chest only has 53 coal in it. It loads 53 coal into the train, but as the belt is full of copper the coal chest can't keep loading so there's a slot in the train with only 3 coal that never reaches a full stack, so the train never leaves.

Easiest solution currently is to add a max wait time condition, ie WAIT until train cargo full OR 20 seconds passed.

Re: Train Full Cargo - Mixed loading

Posted: Thu Sep 29, 2016 7:12 pm
by SirLANsalot
Use Filter Inserts. 3 set to stone 3 set to copper if unloading on one side only, or just do another set 6 on the other side. That is how I do my stations that load up multiple items. Same for unloading as well.

Re: Train Full Cargo - Mixed loading

Posted: Fri Sep 30, 2016 9:54 am
by Deadly-Bagel
Hopefully with 0.15 or 0.16 we'll be able to read train contents, then you'll be able to set up a circuit that tells filter inserters only to work if either there is a non-full stack of that item in the train OR at least a full stack in the chest. Probably would be a complex circuit, but it's the most complete solution.

Re: Train Full Cargo - Mixed loading

Posted: Sat Aug 03, 2019 11:03 pm
by Oktokolo
Had the same problem with my "waste ore" trains while playing with heavily mixed ore fields (DivOresity mod). Now, that we can indeed send train content to the circuit network, the following works fine:
- Configure the train stop to send train content to the circuit network and send ciruit network signals to train.
- Configure train to either wait for full cargo or circuit signal S > any value indicating a reasonably full train (i use 1.75k for each ore cargo wagon).
- Set up an arithmetic combinator connected to the train stop with input and output using differently colored wires and set it to S = each + 0.