Quality Dispatcher

This tool generates a circuit design that sets the recipe and logistics requests for a set of assemblers (or other crafters), so they can automatically switch between crafting different recipes and qualities. It also provides a signal for requesting lower quality items to recyclers for upcycling. The generated design prioritizes keeping the current recipe over switching to new recipes, to reduce bot traffic and productivity bonus loss.

The design roughly works like this: every tick, the next combination of (row × quality) is issued to a pipelined (1-tick IPC) selection/comparison circuit to test against the various thresholds. The results are then accumulated on a single wire and then fed into a hysteresis circuit to produce the final recipe selection.