This commit is contained in:
Michael Peters 2024-03-17 14:10:46 -07:00
parent d4266f2326
commit 384de7ff7d

View File

@ -54,7 +54,7 @@ recipies: dict[str, ResourceGroup] = {
# smelting # smelting
'iron-plate': {'furnace': -3.2, 'iron-ore': -1, 'iron-plate': 1}, 'iron-plate': {'furnace': -3.2, 'iron-ore': -1, 'iron-plate': 1},
'copper-plate': {'furnace': -3.2, 'copper-ore': -1, 'copper-plate': 1}, 'copper-plate': {'furnace': -3.2, 'copper-ore': -1, 'copper-plate': 1},
'stone-brick': {'furnace': -3.2, 'stone': -1, 'stone-brick': 1}, 'stone-brick': {'furnace': -3.2, 'stone': -2, 'stone-brick': 1},
'steel': {'furnace': -16, 'iron-plate': -5, 'steel': 1}, 'steel': {'furnace': -16, 'iron-plate': -5, 'steel': 1},
# crafting basics # crafting basics
'iron-gear': {'assembler': -0.5, 'iron-plate': -2, 'iron-gear': 1}, 'iron-gear': {'assembler': -0.5, 'iron-plate': -2, 'iron-gear': 1},
@ -70,18 +70,18 @@ recipies: dict[str, ResourceGroup] = {
'inserter-y': {'assembler': -0.5, 'circuit-a': -1, 'iron-gear': -1, 'iron-plate': -1, 'inserter-y': 1}, 'inserter-y': {'assembler': -0.5, 'circuit-a': -1, 'iron-gear': -1, 'iron-plate': -1, 'inserter-y': 1},
# transport # transport
'concrete': {'assembler': -10, 'iron-ore': -1, 'stone-brick': -5, 'water': -100, 'concrete': 10}, 'concrete': {'assembler': -10, 'iron-ore': -1, 'stone-brick': -5, 'water': -100, 'concrete': 10},
'rail': {'assembler': -0.5, 'iron-stick': -1, 'steel': -1, 'stone': -1, 'rail': 1}, 'rail': {'assembler': -0.5, 'iron-stick': -1, 'steel': -1, 'stone': -1, 'rail': 2},
# chemicals # chemicals
'sulfur': {'chemical-plant': -1, 'petroleum-gas': -30, 'water': -30, 'sulfur': 2}, 'sulfur': {'chemical-plant': -1, 'petroleum-gas': -30, 'water': -30, 'sulfur': 2},
'sulfuric-acid': {'chemical-plant': -1, 'iron-plate': -1, 'sulfur': -5, 'water': -100, 'sulfuric-acid': 50}, 'sulfuric-acid': {'chemical-plant': -1, 'iron-plate': -1, 'sulfur': -5, 'water': -100, 'sulfuric-acid': 50},
'plastic': {'chemical-plant': -1, 'coal': -1, 'petroleum-gas': -20, 'plastic': 2}, 'plastic': {'chemical-plant': -1, 'coal': -1, 'petroleum-gas': -20, 'plastic': 2},
'explosives': {'chemical-plant': -4, 'coal': -1, 'sulfur': -1, 'water': -10, 'explosives': 2}, 'explosives': {'chemical-plant': -4, 'coal': -1, 'sulfur': -1, 'water': -10, 'explosives': 2},
'battery': {'chemical-plant': -4, 'copper-plate': -1, 'iron-plate': -20, 'sulfuric-acid': -20, 'battery': 1}, 'battery': {'chemical-plant': -4, 'copper-plate': -1, 'iron-plate': -1, 'sulfuric-acid': -20, 'battery': 1},
'lubricant': {'chemical-plant': -1, 'heavy-oil': -10, 'lubricant': 10}, 'lubricant': {'chemical-plant': -1, 'heavy-oil': -10, 'lubricant': 10},
# military # military
'radar': {'assembler': -0.5, 'circuit-a': -5, 'iron-gear': -5, 'iron-plate': -10, 'radar': 1}, 'radar': {'assembler': -0.5, 'circuit-a': -5, 'iron-gear': -5, 'iron-plate': -10, 'radar': 1},
'magazine-y': {'assembler': -1, 'iron-plate': -4, 'magazine-y': 1}, 'magazine-y': {'assembler': -1, 'iron-plate': -4, 'magazine-y': 1},
'magazine-r': {'assembler': -1, 'copper-plate': -5, 'magazine-y': -1, 'steel': -1, 'magazine-r': 1}, 'magazine-r': {'assembler': -3, 'copper-plate': -5, 'magazine-y': -1, 'steel': -1, 'magazine-r': 1},
'grenade': {'assembler': -8, 'coal': -10, 'iron-plate': -5, 'grenade': 1}, 'grenade': {'assembler': -8, 'coal': -10, 'iron-plate': -5, 'grenade': 1},
'wall': {'assembler': -0.5, 'stone-brick': -5, 'wall': 1}, 'wall': {'assembler': -0.5, 'stone-brick': -5, 'wall': 1},
'rocket-y': {'assembler': -8, 'circuit-a': -1, 'explosives': -1, 'iron-plate': -2, 'rocket-y': 1}, 'rocket-y': {'assembler': -8, 'circuit-a': -1, 'explosives': -1, 'iron-plate': -2, 'rocket-y': 1},
@ -157,7 +157,7 @@ recipies: dict[str, ResourceGroup] = {
'science-white': {'rocket-part': -100, 'sattelite': -1, 'science-white': 1000}, 'science-white': {'rocket-part': -100, 'sattelite': -1, 'science-white': 1000},
} }
MACHINES = {'assembler', 'chemical-plant', 'oil-refinery', 'rocket-silo'} MACHINES = {'assembler', 'chemical-plant', 'oil-refinery', 'rocket-silo', 'furnace'}
def get_resource_name(orig_name: str, recipe_name: str) -> str: def get_resource_name(orig_name: str, recipe_name: str) -> str:
@ -241,8 +241,6 @@ bus_base = {
'rocket-fuel', 'rocket-fuel',
} }
# TODO: science-blue is wrong
print(f'{SPM=}') print(f'{SPM=}')
print(f'{bus_base=}') print(f'{bus_base=}')
bus_inputs = {} bus_inputs = {}
@ -321,6 +319,7 @@ if pg := oil_inputs.pop('petroleum-gas', 0) > 0:
raise RuntimeError(f'petrolium-gas > 0: {pg=}') raise RuntimeError(f'petrolium-gas > 0: {pg=}')
smelting_outputs = add_recipe(bus_inputs, oil_inputs, -1) smelting_outputs = add_recipe(bus_inputs, oil_inputs, -1)
smelting_outputs = add_recipe(smelting_outputs, chemical_inputs, -1)
print() print()
print('smelting outputs') print('smelting outputs')
print_resource_group(smelting_outputs) print_resource_group(smelting_outputs)
@ -331,8 +330,6 @@ smelting_base = {'furnace', 'iron-ore', 'copper-ore', 'coal', 'stone', 'steam',
# combine to compute mining requirements # combine to compute mining requirements
smelting_inputs, intermediates = reduce_to_base_resources(smelting_outputs, smelting_base) smelting_inputs, intermediates = reduce_to_base_resources(smelting_outputs, smelting_base)
# TODO: figure out furnace numbers...
print() print()
print('intermediates') print('intermediates')
print_resource_group(intermediates) print_resource_group(intermediates)