How to use it:
- "C" is the cycle time in ticks. Turn this constant combinator on to start the factory.
- "I" is the number of items the bus can move in a cycle. The higher this is, the more precise the ratios are.
- "S" is the smoothing factor for the rolling average circuit. Must be negative. Bigger number = slower reaction time. A simple rule of thumb is to think that it multiplies cycle time.
- If you have ambitions for a 200 blue belt sushi bus, this is how high the settings can go before you'll run into integer overflow problems:
Code: Select all
|S * I * 128| < 2,147,483,648
- Everything that takes from the bus is set to pulse read and connected with red wire.
- Everything that puts items on the bus is connected with green wire, set to pulse read and enable when ITEM <= 0.
- Cycle time doesn't need to have any relation to the length of the bus if factory outputs have buffer chests, but if the bus is very long, then it can get backed up if the ratio of consumed items changes too quickly. This can be remedied by using a larger value for "S".
- Items that reach the end of the production line get stored in a warehouse.
- The warehouse blueprint is tile-able, for easy expansion.
- The warehouse has throughput issues until you get the first non-stack inserter capacity bonus. Changing some of the fast inserters to regular inserters may help until then.
- The production line output, warehouse output, and item injections should be lane balanced and merged before connecting to the start of the production line.
- Production is split up into Cycles.
- At least one of every item is placed on the belt every cycle. These act as probes to kick-start production when the factory stops being idle.
- It counts how many of each item gets consumed every cycle, and the result is saved to vanatteveldt's rolling average calculator. It's modified to be tied to the cycle clock, so it progresses once per cycle instead of every tick.
- The rolling average is then used to calculate how much of the set items-per-cycle is used for each item.
- Cycles are further split into 128 steps. This is to ensure an even distribution of items across the bus.
- Excess production is accounted for, and subtracted from the items-per-cycle in the next next cycle (timing restrictions mean it can't take effect immediately). This also serves to reserve item slots for probes.
- It prioritizes using items stored in the warehouse.