plan: document 'basic_rate'
This commit is contained in:
parent
5c4393b999
commit
0f0e281db8
10
plan.py
10
plan.py
@ -4,8 +4,11 @@ import math
|
|||||||
import fractions
|
import fractions
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
import satisfactory
|
import satisfactory
|
||||||
|
|
||||||
|
|
||||||
def calculate_rates(recipes, remain):
|
def calculate_rates(recipes, remain):
|
||||||
required_items = collections.defaultdict(fractions.Fraction)
|
required_items = collections.defaultdict(fractions.Fraction)
|
||||||
|
|
||||||
@ -37,7 +40,12 @@ def calculate_rates(recipes, remain):
|
|||||||
return required_items
|
return required_items
|
||||||
|
|
||||||
|
|
||||||
def basic_rate(recipe):
|
def basic_rate(recipe: Dict) -> fractions.Fraction:
|
||||||
|
"""
|
||||||
|
Calculate the rate at which the item is crafted with the default recipe.
|
||||||
|
:param recipe:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
for output, count in recipe['output'].items():
|
for output, count in recipe['output'].items():
|
||||||
return fractions.Fraction(
|
return fractions.Fraction(
|
||||||
count, recipe['crafting_time']
|
count, recipe['crafting_time']
|
||||||
|
Loading…
Reference in New Issue
Block a user