Heavily based on Tertius's implementation.
- I uase a constant combinator to set the required amount of each good with a negative value
- I combine these negative values with the value in storage to calculate the deficit
- I use this deficit to control the inserters (not got to using 1 inserter and changing the filtered item yet)
- I use a decider combinator with ANYTHING < 0 to set the train limit for the station (calls a train when we are low on any item)
- I use a constant combinator with each good set to -1 and a decider combinator to get a list of goods that are not on the train (train has run out)
- I use a decider combinator with EACH < 0 to get a list of items that still need offloading. I then make this -1 by multiplying by -1
- I use a Decider Combinator with EVERYTHING > 0 to make sure each good is either satisfied or is not on the train
I like this solution. I am specifying the number of goods that I want in one place (rather than in inserters and in combinators). I am not relying on the result adding up to a magic number so it's easy to add more goods. The same combinators are being used to evaluate the train limit and the wait condition.
It does look messy though... I could probably tidy it up a bit but it's hard moving things around as all the wires are removed when you move something!
Thanks again for all the help.