Balacing items between multiple warehouses.
Posted: Sat Apr 22, 2023 6:47 pm
I want to create a train station with, in my example, with 2 stops. Each train stop will unload mixed items to their respective warehouse. The warehouses must then evenly distribute the items between them.
This is what I came up with: https://factoriobin.com/post/HlKhMJiB (note: this uses AAI warehouses and miniloaders mod)
It does work how I intended it to work, but the design never stays idle. Instead a few items are being shuffle around (I did manage to get it once to stay idle though).
Is there a way to make the design better?
The concept I adopted, is to great a circuit segment between 2 warehouses, that balances items between those two. Therefor:
- the contents of a warehouse is the sum of the items in the warehouse and on the belt that outputs items from that warehouse
- the contents of two warehouses are fed to an arithmetic combinator that does /-2 and outputs the signal to a decider combinator
- the decider combinator outputs 1 "each" if "each" > 6 (i don't know what a good number would be here); the output of the decider combinator is sent to the filter miniloader, which are configured to "set filter" and "read content: pulse"
- the inputs for the decider combinator is the output of the /-2 divider (negative value) and the contents of the associated warehouse (positive value)
- when the inputs to the decider combinator add up to >6, this sets the filter for the filter miniloaders and they dump those items on the belt; a signal is also sent to a memory cell, associated to that warehouse
- when the items arrive to the destination warehouse, they are loaded with miniloaders, configured to only "read content: pulse", and a signal is sent to an arithmetic combinator configured to "each"/-1 output "each"; this signal is then sent to the input of the memory cell of the other warehouse.
This is what I came up with: https://factoriobin.com/post/HlKhMJiB (note: this uses AAI warehouses and miniloaders mod)
It does work how I intended it to work, but the design never stays idle. Instead a few items are being shuffle around (I did manage to get it once to stay idle though).
Is there a way to make the design better?
The concept I adopted, is to great a circuit segment between 2 warehouses, that balances items between those two. Therefor:
- the contents of a warehouse is the sum of the items in the warehouse and on the belt that outputs items from that warehouse
- the contents of two warehouses are fed to an arithmetic combinator that does /-2 and outputs the signal to a decider combinator
- the decider combinator outputs 1 "each" if "each" > 6 (i don't know what a good number would be here); the output of the decider combinator is sent to the filter miniloader, which are configured to "set filter" and "read content: pulse"
- the inputs for the decider combinator is the output of the /-2 divider (negative value) and the contents of the associated warehouse (positive value)
- when the inputs to the decider combinator add up to >6, this sets the filter for the filter miniloaders and they dump those items on the belt; a signal is also sent to a memory cell, associated to that warehouse
- when the items arrive to the destination warehouse, they are loaded with miniloaders, configured to only "read content: pulse", and a signal is sent to an arithmetic combinator configured to "each"/-1 output "each"; this signal is then sent to the input of the memory cell of the other warehouse.