|
|
@@ -27,12 +27,11 @@ def main() -> None:
|
|
|
output_mats[output['material_ticker']] = ratio
|
|
|
print(f'\t{output["material_ticker"]:3}:', ratio)
|
|
|
|
|
|
- companies_produced = companies_consumed = companies_consumed_80 = 0
|
|
|
+ companies_produced = companies_consumed = companies_consumed_only = companies_consumed_own = companies_consumed_80_own = 0
|
|
|
into = dict.fromkeys(output_mats.keys(), 0)
|
|
|
for company in companies.values():
|
|
|
- if (co_production := company.get(mat)) is None:
|
|
|
- continue
|
|
|
- companies_produced += 1
|
|
|
+ if (co_production := company.get(mat)) is not None:
|
|
|
+ companies_produced += 1
|
|
|
consumed = 0
|
|
|
for output_mat, per_run_consumption in output_mats.items():
|
|
|
if co_consumption := company.get(output_mat):
|
|
|
@@ -41,11 +40,17 @@ def main() -> None:
|
|
|
into[output_mat] += total_consumption
|
|
|
if consumed > 0:
|
|
|
companies_consumed += 1
|
|
|
- if consumed > 0.8 * co_production['amount']:
|
|
|
- companies_consumed_80 += 1
|
|
|
+ if co_production is None:
|
|
|
+ companies_consumed_only += 1
|
|
|
+ else:
|
|
|
+ companies_consumed_own += 1
|
|
|
+ if consumed > 0.8 * co_production['amount']:
|
|
|
+ companies_consumed_80_own += 1
|
|
|
print(f'{companies_produced} companies producing')
|
|
|
- print(f'{companies_consumed} companies consuming their own production')
|
|
|
- print(f'{companies_consumed_80} companies consuming 80%+ of their own production')
|
|
|
+ print(f'{companies_consumed} companies consuming')
|
|
|
+ print(f'{companies_consumed_only} companies consuming without producing any')
|
|
|
+ print(f'{companies_consumed_own} companies consuming their own production')
|
|
|
+ print(f'{companies_consumed_80_own} companies consuming 80%+ of their own production')
|
|
|
|
|
|
recipes_per_output = collections.defaultdict(int)
|
|
|
for recipe in recipes:
|