Skip to content

Instantly share code, notes, and snippets.

View alercah's full-sized avatar

Alexis Hunt alercah

View GitHub Profile
@alercah
alercah / ratiointerface.txt
Last active June 4, 2019 20:32
Ratio calculation interface
function calculate(recipes, constraints):
Calculates the optimal ratios for the specified recipes.
Params:
recipes: Table of string -> recipe. Recipe data and parameters. Note that you may have to use keys encoding additional parameters where multiple of the same recipe are used, say with different machines.
constraints:
Returns: Table with keys:
item, fluid: Table of string -> double. Amount of item/fluid produced (negative is consumption) per unit time.
recipe: Table of string -> double. Number of each recipe required.
power: double. The total power produced (negative is consumed) by this recipe (in W).