Description
Having to refuel your trains at loadingstations always bothered me and I completly switched to using LTN in all of my playthroughs because of that. I decided to find a solution to my age old problem today and expected this to be quite complicated but I was proven wrong. All it takes are 3 combinators per provider station, 4 per requester station and another 4 for all the depos combined. (Probably less if you know your combinators)
The main problem to solve here was only allowing a train of an item x to only leave the depot if both a provider and a requester station of that item x are available. Only disabling full/empty provide/requester stations respectively leads to the trains leaving the depot even if only the providers or only the requesters are available. This leads to congestion is inefficient and all in all a worse solution than having no depos at all.
The System works like this: Provider: The total itemcount in the chests is fed into an arithmetic combinator dividing all it´s inputs by a set divider value coming from the constant combinator giving us the amount of stacks present. For every station the devider value has to be set to the stack size of the item handled at that station. A decider combinator checks if the number of available stacks is enough to fill a train (I chose 50 stacks to be sure and the station is also set to activate at 50 stacks available). The decider combinators output (set to 1) has to be manually set as the item handled at the station. This signal gets transmitted by wire all the way to the depos.
Requester: First step is identical to the provider. The decider combinator and the station are set to only activate if there are less than 530 stacks present. This insures not partially emptied trains. The output of the decider combinator gets multiplied by 10000 is then outputed on the same wire. This means that the number of availabe requester/provider stations of the same item is represented as one signal between 0 and 99999999 of that item. The first 4 numbers represent the requesters and the last 4 the providers. So for example: "240035" would mean 24 available requesters and 35 providers.
At the depot: All the combined signals have to be spilt into their parts again. I do this by dividing each/10000 giving me one part. And taking the modulus of 1000 of each giving me the other part. The now split signals get inputed in the last decider combinator checking if they are >1 if true outputting the input values as set 1 and sending the to the trains parked at the depos. The trains only leave the depot if their item (I used iron plates here as an example) has the value 2. The value 2 represents that at least one provider and requester are available.
(Also the train signaling is trash here don´t do it like this.)