Ensuring trains visit all stops with the same name fairly.
Ensuring trains visit all stops with the same name fairly.
I am currently transitioning my base into a rail-based megafactory for the endgame.
The plan is to have most of the intermediate products for research and launches produced in individual bases and transported by rail. Each output of one base (e.g. circuits) is delivered by train to one of many stations, all with the same name. Once a station has more than enough of this intermediate, a circuit condition disables the stop.
I've done some testing, and while everything functions perfectly when there is a slight overpressure of starting materials (i.e. where slightly more of each starting material is produced than is consumed), it doesn't work so well when starting material supply is diminished.
When material is consumed faster than it can be replenished, the train stops are perpetually enabled, and the train only ever chooses to go to the nearest station, rather than visiting all stations fairly.
How do I ensure that trains all visit all stations fairly when they can't supply enough to disable any one station? Are there clever circuit conditions I can use?
Also, I don't have terribly much experience with these sort of rail megabases. Any other general pieces of advice about layout and design are welcome.
The plan is to have most of the intermediate products for research and launches produced in individual bases and transported by rail. Each output of one base (e.g. circuits) is delivered by train to one of many stations, all with the same name. Once a station has more than enough of this intermediate, a circuit condition disables the stop.
I've done some testing, and while everything functions perfectly when there is a slight overpressure of starting materials (i.e. where slightly more of each starting material is produced than is consumed), it doesn't work so well when starting material supply is diminished.
When material is consumed faster than it can be replenished, the train stops are perpetually enabled, and the train only ever chooses to go to the nearest station, rather than visiting all stations fairly.
How do I ensure that trains all visit all stations fairly when they can't supply enough to disable any one station? Are there clever circuit conditions I can use?
Also, I don't have terribly much experience with these sort of rail megabases. Any other general pieces of advice about layout and design are welcome.
Re: Ensuring trains visit all stops with the same name fairly.
Why do you need them to be fair? The production line that is getting more will back up eventually and stop demanding supplies. You can speed up the process by minimizing the use of buffers.
Re: Ensuring trains visit all stops with the same name fairly.
Okay. When starting material production is greater than consumption there is no problem.
I am not referring to that situation. I am referring to situations where because of a depleted mining base or because of a train deadlock (which seeing as I still don't truly understand train signals, is pretty likely), materials get consumed faster than they get produced.
If iron is needed by both the gears base and the circuits base, and not enough iron gets produced to satisfy both, both train stations requesting iron will be perpetually on. In that case, the station that's closest (let's say gears) will always receive iron, and the circuits base will never receive iron.
The situation is akin to using spaghetti belts rather than a main bus and splitters.
to reiterate my question:
How do I ensure that trains all visit all stations fairly when they can't supply enough to disable any one station? Are there clever circuit conditions I can use?
I am not referring to that situation. I am referring to situations where because of a depleted mining base or because of a train deadlock (which seeing as I still don't truly understand train signals, is pretty likely), materials get consumed faster than they get produced.
If iron is needed by both the gears base and the circuits base, and not enough iron gets produced to satisfy both, both train stations requesting iron will be perpetually on. In that case, the station that's closest (let's say gears) will always receive iron, and the circuits base will never receive iron.
The situation is akin to using spaghetti belts rather than a main bus and splitters.
to reiterate my question:
How do I ensure that trains all visit all stations fairly when they can't supply enough to disable any one station? Are there clever circuit conditions I can use?
Re: Ensuring trains visit all stops with the same name fairly.
A counter ? Every station counts "+1" whenever supplied, and you always deliver to the lowest count needing supplies.
Koub - Please consider English is not my native language.
Re: Ensuring trains visit all stops with the same name fairly.
The gear station produces gears.
The gears are delivered to the inserter station.
The inserter station does not produce anything because it has no circuits.
The inserter station fills up with gears.
The gear station fills up with gears.
The gear station fills up with iron.
Iron is delivered to the circuit station.
Problem solved!
The smaller your buffers are, the faster the problem will solve itself.
Re: Ensuring trains visit all stops with the same name fairly.
I do not know enough about circuits to implement this. How would you add a +1 count to a station? How do you compare multiple signals to find the lowest? And how do you get a train to go to the station selected as the lowest?
I feel like if you answer these questions, I should be able to figure it out from there. Thanks.
Re: Ensuring trains visit all stops with the same name fairly.
I'd just use the simple solution of letting backpressure balance things. In general you don't want the a true even distribution scheme, since some stations need more resources than others. eg circuit and gears both need lots of iron plates, however by comparison inserters needs relatively few iron plates.
Re: Ensuring trains visit all stops with the same name fairly.
Nobody seems to have mentioned the obvious solution of increasing your supply. If all the iron is going to gears and not circuits then increase iron production to compensate.
- 5thHorseman
- Smart Inserter
- Posts: 1193
- Joined: Fri Jun 10, 2016 11:21 pm
- Contact:
Re: Ensuring trains visit all stops with the same name fairly.
Yeah it's just one stop in the perpetual Factorio loop of too much/too little. You always have too much of something and too little of something else, and you generally want too much of things closer to the start.
You want too much ore going to your smelters.
You want too many plates going to your intermediates.
You want too many intermediates going to your production.
Whenever this is not the case, you tend to have issues. Your setup (which I've done) just shows it far more quickly than most other setups.
Solution: MOAR SMELTING
You want too much ore going to your smelters.
You want too many plates going to your intermediates.
You want too many intermediates going to your production.
Whenever this is not the case, you tend to have issues. Your setup (which I've done) just shows it far more quickly than most other setups.
Solution: MOAR SMELTING
Re: Ensuring trains visit all stops with the same name fairly.
I ran into the same problem when I started playing train based bases: The iron train trying to deliver to multiple clients didn't work as you found out. I tried a circuit train, going to get the inputs I needed for my circuits, and that didn't work (too much iron, no room to get copper, not using the iron I had because my factories stopped because they were out of copper). The solution I have that is working so far is one train for one purpose: one train for iron for circuits. One train for copper for circuits (actually I now have two trains for copper for circuits, one train wasn't enough). One train for iron for inserters. One train for circuits for inserters. It makes for a LOT of trains (120 trains and counting) but my problems are not from trains not delivering what is needed.
Good luck with your trains!
Good luck with your trains!
My own personal Factorio super-power - running out of power.
-
- Filter Inserter
- Posts: 365
- Joined: Mon Jul 03, 2017 9:14 am
- Contact:
Re: Ensuring trains visit all stops with the same name fairly.
there is no good vanilla solution for this.
most obvious, produce more.
Your demand seems to be far from that what you can supply.
most obvious, produce more.
Your demand seems to be far from that what you can supply.
Re: Ensuring trains visit all stops with the same name fairly.
You need something like LTN to solve this easily.
The other way without waiting for backpressure to build up across all of creation is to use circuits to produce items only at a speed relative to the least filled station. So if circuit boards run out of iron the gear factory stops too and the iron can much quicker fill back up. It cuts down on the delay due to buffering at all the train stations.
And the third way is to use a transfer station, which you probably want anyway:
Create a station with N unloading stops and add N trains that collect all the iron plates form all the smelters. Unload the iron plates unto belts, merge, balance, split it up onto M loading stops. Create M trains and send them to deliver the iron plates to the various consumers. E.g. M=2 with one train going to the gear factory and one to the circuit board factory.
The other way without waiting for backpressure to build up across all of creation is to use circuits to produce items only at a speed relative to the least filled station. So if circuit boards run out of iron the gear factory stops too and the iron can much quicker fill back up. It cuts down on the delay due to buffering at all the train stations.
And the third way is to use a transfer station, which you probably want anyway:
Create a station with N unloading stops and add N trains that collect all the iron plates form all the smelters. Unload the iron plates unto belts, merge, balance, split it up onto M loading stops. Create M trains and send them to deliver the iron plates to the various consumers. E.g. M=2 with one train going to the gear factory and one to the circuit board factory.
Re: Ensuring trains visit all stops with the same name fairly.
It can be done with a small round-robin setup that manually flags signals red and reads them - as the signal is read, the next station in the chain's red signal is cleared so it can receive a train. It's critical to put a chain signal in front of the manually switched ones. I'm at work and can't provide a visual example unfortunately.
Played with the idea for some time, got it to work but it was far too much hassle to deal with in the long run. If you don't have enough incoming trains, make more mines, much easier. Oh, and if you want to almost halve the amount of traffic on your rail grid, put smelters at the mines and drag iron/copper plates home instead. Muuuuch more efficient as long as you can deal with pollution at the remote mines.
Played with the idea for some time, got it to work but it was far too much hassle to deal with in the long run. If you don't have enough incoming trains, make more mines, much easier. Oh, and if you want to almost halve the amount of traffic on your rail grid, put smelters at the mines and drag iron/copper plates home instead. Muuuuch more efficient as long as you can deal with pollution at the remote mines.
Re: Ensuring trains visit all stops with the same name fairly.
That gets rather complex with multiple trains and handling trains waiting to be filled, trains on the way and trains unloading, ...Aeternus wrote: ↑Mon Dec 10, 2018 1:48 pmIt can be done with a small round-robin setup that manually flags signals red and reads them - as the signal is read, the next station in the chain's red signal is cleared so it can receive a train. It's critical to put a chain signal in front of the manually switched ones. I'm at work and can't provide a visual example unfortunately.
Played with the idea for some time, got it to work but it was far too much hassle to deal with in the long run. If you don't have enough incoming trains, make more mines, much easier. Oh, and if you want to almost halve the amount of traffic on your rail grid, put smelters at the mines and drag iron/copper plates home instead. Muuuuch more efficient as long as you can deal with pollution at the remote mines.
Re: Ensuring trains visit all stops with the same name fairly.
It can but not neccesarily. You just need to have a stacker and chain signal between the receiving stations and the arriving trains. The chain signal will prevent the arriving trains from pathing to the wrong station and repath if the active receiver changed.