|
|
@@ -20,11 +20,11 @@ def main() -> None:
|
|
|
for recipe in recipes:
|
|
|
if profit := calc_profit(recipe, buildings, materials, prices):
|
|
|
profits.append(profit)
|
|
|
- profits.sort(reverse=True)
|
|
|
+ profits.sort()
|
|
|
print('\033[1mwrought \033[0;32mdaily profit/area\033[31m')
|
|
|
print('\033[30mrecipe \033[0mexpertise \033[33mcapex \033[35mdaily opex \033[34mlogistics\033[0m')
|
|
|
for p in profits:
|
|
|
- print(f'\033[53;1m{p.output:5} \033[53;32m{p.profit_per_area: 10,.0f} ', end='')
|
|
|
+ print(f'\033[53;1m{p.output:5} \033[53;32m{p.profit_per_day/p.area: 10,.0f} ', end='')
|
|
|
warnings = []
|
|
|
if p.average_traded_7d < p.output_per_day * 20:
|
|
|
warnings.append('low volume')
|
|
|
@@ -69,7 +69,8 @@ def calc_profit(recipe: Recipe, buildings: typing.Mapping[str, Building], materi
|
|
|
) * runs_per_day / building['AreaCost']
|
|
|
return Profit(output['Ticker'], recipe['RecipeName'],
|
|
|
expertise=building['Expertise'].replace('_', ' ').lower(),
|
|
|
- profit_per_area=(profit_per_run * runs_per_day - worker_consumable_daily_cost) / building['AreaCost'],
|
|
|
+ profit_per_day=(profit_per_run * runs_per_day - worker_consumable_daily_cost),
|
|
|
+ area=building['AreaCost'],
|
|
|
capex=capex,
|
|
|
cost_per_day=cost_per_day,
|
|
|
logistics_per_area=logistics_per_area,
|
|
|
@@ -139,7 +140,8 @@ class Profit:
|
|
|
output: str
|
|
|
recipe: str
|
|
|
expertise: str
|
|
|
- profit_per_area: float
|
|
|
+ profit_per_day: float
|
|
|
+ area: float
|
|
|
capex: float
|
|
|
cost_per_day: float
|
|
|
logistics_per_area: float
|
|
|
@@ -147,7 +149,9 @@ class Profit:
|
|
|
average_traded_7d: float
|
|
|
|
|
|
def __lt__(self, other: Profit) -> bool:
|
|
|
- return self.profit_per_area < other.profit_per_area
|
|
|
+ break_even = self.capex / self.profit_per_day
|
|
|
+ other_break_even = other.capex / other.profit_per_day
|
|
|
+ return break_even < other_break_even
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
main()
|