INNER CODE UNIT · Python
BillOfMaterials
ikatsov/tensor-house · supply-chain/world_of_supply/world_of_supply_environment.py:144
class BillOfMaterials:
# One manufacturing cycle consumes inputs
# and produces output_lot_size units of output_product_id
inputs: Counter # (product_id -> quantity per lot)
output_product_id: str
output_lot_size: int = 1
def input_units_per_lot(self):
return sum(self.inputs.values())
class StorageUnit(Agent):
@dataclass
class Economy:
unit_storage_cost: int # cost per unit per time step
def step_balance_sheet(self, storage):