I have 4 train unloading stations (S1, ... S4). Equally named to unload the same things. And depending on demand I calculate how many supply trains (T) should go there. As I want to optimize throughput, I am distributing the supply trains to the 4 stations as equal as possible, using the train limit feature and a combinator setup.
Because if R4 was 3 then the Split3 is 1 and the remainder will be split evenly among S1 ... S3. If it was lower than 3 then the result is 0 and there is no threeway split.
Hmm... It seems you assume consumption of the materials is always equal for each unload station.
Why not look at the # of items in each station to determine where the next rain has to go?
i am building a trainbase where all load and unload stations have the same name per material shipped, and use trainlimit 0/1 for each. For the unload stations I calculated (roughly) how much time the trains need to get to their destination, and set the minimum buffer needed to bridge that gap based on full throughput accordingly.
Re: Even split of remainder
Posted: Mon May 24, 2021 1:57 pm
by Impatient
Ah, yes of course. Logic instead of arithmetic. This simplifies the combinator setup considerably:
evenSplitRemainderOf4.2.jpg (45.35 KiB) Viewed 3498 times
That is off topic, but since I failed to hide the context good enough to not make readers curious :
Context
All 4 stations feed into the same supply line, which needs 24k steam/s unloaded from 1-2 trains (for 2 GW of power). Each "station" unloads at 6k/s and in reality is a twin unloading station (1 train moves up from the stacker while another unloads from one of the twin stations).
4xtwin.jpg (208.87 KiB) Viewed 3492 times
Twin stations, so I have a guranteed steady stream of supply, not interrupted by several trains empty at the same time.
4 Twins because each twin provides 6k/s (limited by the fluid system) for a total of 24k/s, unloading a train in roughly 7 seconds, which leaves just enough time for the next train to move from the stacker into the twin. For that to work each twin has its own stacker (4 trains would not be able to move through a single stackers bottleneck in that time). And the 4 twins with their 4 stackers are the reason i need to divide the total number of incoming trains by 4 and also split the remainder.
Setting the train limit of each station (or twin station) to 1 just wont do. I give the trains 30 seconds to get there. If at peak consumption of power, steam falls below a limit, in that time I am down 30 x 24k = 720k. I have a buffer of 1M. But after the 30 secs the unloading has to run smoothly with the trains needed already waiting in the stackers.
Re: Even split of remainder
Posted: Mon May 24, 2021 4:03 pm
by disentius
Aha, context is king:)
So each station has to have a guaranteed throughput of 3K/s -> 1 train every 16.6 seconds. Correct?
Re: Even split of remainder
Posted: Mon May 24, 2021 4:30 pm
by Impatient
More off topic
disentius wrote: Mon May 24, 2021 4:03 pm
Aha, context is king:)
So each station has to have a guaranteed throughput of 3K/s -> 1 train every 16.6 seconds. Correct?
No. Each twin station has to have a continuous tp of 6k/s (2 pipes limited at 3k/s). The trains unload from the two twins of a twin station alternatingly (circuit controlled). (50k steam/train)/(6ksteam/s) = 8.33 s/train .
With 4 pairs of twins I achieve a continuous tp of 24k/s .
Within those 8.33 s 4 trains need to move out of their unloading station and 4 new trains need to move from their parking position to their unloading station.
That is not the same as 8 singles with a tp of 3k/s as I see it. 8 singles could be emtpty at a random point in time, in the worst case all at the same time. Then the continuous tp is stopped until 8 new moved from their waiting slot to the stations.
Hm, ... I think the culprit here, to clarify it, are the limitations introduced by the fluid system. One pipeline, with pumps, u-pipes and corners is limited to a tp of 3k/s. I use tank>pump>tank>pump to increase that to 24k/s. I could unload from 8 singles @6k/s per station, but that would increase the needed tp to 48k/s to fill up the buffer. But that would mean two parallel lines of tank>pump>tank>pump, which I am not willing to do at the moment.
In any case, 4 pairs of twins or 8 singles, I would need to divide the total number of requested trains by the number of stations and also split the remainder.
Where are you aiming at with your questions?
Re: Even split of remainder
Posted: Mon May 24, 2021 4:54 pm
by disentius
Wandering mind.... Something along the lines of trainlimits adjusted per time passed.
If you have enough trains and an oversupply of steam, you could also use a constant limit of 2. with 1-2 trains you can get each train its own stacker for the second one if you have room.
2021-05-24 18_53_23-Factorio 1.1.34.png (397.51 KiB) Viewed 3474 times
Re: Even split of remainder
Posted: Mon May 24, 2021 5:05 pm
by Impatient
even more off topic
Yes, but that would mean I also could use dedicated trains. Because, what if I just need 250k steam there? That would be 5 trains, not 16. Part of the context is, that all steam supply on the whole map is handled by a lot of 1-2 trains with one name for pickup stations and 1 name for dropoff.
Well, this is not the road I wanted to go in this topic. Talking about the context. And I stop it here. But ... if you want we can discuss train tp challenges in another topic.
Re: Even split of remainder
Posted: Tue May 25, 2021 1:52 pm
by disentius
You are right. As I said, wandering mind....
We ll discuss NxN stations in another topic.