|
|
@@ -15,27 +15,27 @@ def main() -> None:
|
|
|
if p['ExchangeCode'] == 'IC1' and p['VWAP7D'] is not None
|
|
|
}
|
|
|
|
|
|
- profits = []
|
|
|
+ profits: list[Profit] = []
|
|
|
for recipe in recipes:
|
|
|
if profit := calc_profit(recipe, buildings, materials, prices):
|
|
|
profits.append(profit)
|
|
|
profits.sort(reverse=True)
|
|
|
print('\033[1mwrought \033[0;32mdaily profit/area\033[31m')
|
|
|
- print('\033[30mrecipe \033[0mexpertise \033[33mcapex \033[35mdaily opex\033[0m')
|
|
|
+ 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='')
|
|
|
warnings = []
|
|
|
if p.low_volume:
|
|
|
warnings.append('low volume')
|
|
|
- if p.heavy_logistics:
|
|
|
+ if p.logistics_per_area > 1.5:
|
|
|
warnings.append('heavy logistics')
|
|
|
if p.high_opex:
|
|
|
warnings.append('high opex')
|
|
|
if len(warnings) > 0:
|
|
|
- print(' \033[31m' + ' '.join(warnings).rjust(36), end='')
|
|
|
+ print(' \033[31m' + ' '.join(warnings).ljust(43), end='')
|
|
|
else:
|
|
|
- print(' ' * 14 + '\033[0;53m' + ' ' * 37, end='')
|
|
|
- print(f'\n\033[0;30m{p.recipe:30} \033[0m{p.expertise:19} \033[33m{p.capex:7,.0f} \033[35m{p.cost_per_day:9,.0f}\033[0m')
|
|
|
+ print(' ' * 14 + '\033[0;53m' + ' ' * 43, end='')
|
|
|
+ print(f'\n\033[0;30m{p.recipe:30} \033[0m{p.expertise:19} \033[33m{p.capex:7,.0f} \033[35m{p.cost_per_day:9,.0f} \033[34m{p.logistics_per_area:5.2f}\033[0m')
|
|
|
|
|
|
def calc_profit(recipe: Recipe, buildings: typing.Mapping[str, Building], materials: typing.Mapping[str, Material],
|
|
|
prices: typing.Mapping[str, Price]) -> Profit | None:
|
|
|
@@ -57,19 +57,19 @@ def calc_profit(recipe: Recipe, buildings: typing.Mapping[str, Building], materi
|
|
|
worker_consumable_daily_cost = building_daily_cost(building, prices)
|
|
|
cost_per_day = cost * runs_per_day + worker_consumable_daily_cost
|
|
|
output_per_day = output['Amount'] * runs_per_day
|
|
|
- logistics_per_day = max(
|
|
|
+ logistics_per_area = max(
|
|
|
sum(materials[input['Ticker']]['Weight'] * input['Amount'] for input in recipe['Inputs']),
|
|
|
sum(materials[input['Ticker']]['Volume'] * input['Amount'] for input in recipe['Inputs']),
|
|
|
materials[output['Ticker']]['Weight'] * output['Amount'],
|
|
|
materials[output['Ticker']]['Volume'] * output['Amount'],
|
|
|
- ) * runs_per_day
|
|
|
+ ) * 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'],
|
|
|
capex=capex,
|
|
|
cost_per_day=cost_per_day,
|
|
|
- low_volume=output_price.average_traded < output_per_day * 20,
|
|
|
- heavy_logistics=logistics_per_day > 100)
|
|
|
+ logistics_per_area=logistics_per_area,
|
|
|
+ low_volume=output_price.average_traded < output_per_day * 20)
|
|
|
|
|
|
def building_daily_cost(building: Building, prices: typing.Mapping[str, Price]) -> float:
|
|
|
consumption = {
|
|
|
@@ -137,8 +137,8 @@ class Profit:
|
|
|
profit_per_area: float
|
|
|
capex: float
|
|
|
cost_per_day: float
|
|
|
+ logistics_per_area: float
|
|
|
low_volume: bool
|
|
|
- heavy_logistics: bool
|
|
|
high_opex: bool = dataclasses.field(init=False)
|
|
|
score: float = dataclasses.field(init=False)
|
|
|
|