This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |