|
|
@@ -86,6 +86,7 @@ def main() -> None:
|
|
|
total_cost = 0
|
|
|
for planet in planets:
|
|
|
print('\n' + cyan(planet.name))
|
|
|
+ supply_config = config.supply_config(planet.name)
|
|
|
for consumption in planet.net_consumption:
|
|
|
ticker = consumption['MaterialTicker']
|
|
|
avail = planet.inventory.get(ticker, 0)
|
|
|
@@ -93,17 +94,22 @@ def main() -> None:
|
|
|
days = avail / daily_consumption
|
|
|
print(f'{ticker:>3}: {avail:5d} ({daily_consumption:8.2f}/d) {days:4.1f} d', end='')
|
|
|
if need := optimal[planet.name].get(ticker): # pyright: ignore[reportOptionalMemberAccess]
|
|
|
- cost = raw_prices[ticker]['Ask'] * need
|
|
|
- total_cost += cost
|
|
|
- print(f' | {need:6.1f} (${cost:6.0f})')
|
|
|
+ if ticker in supply_config.ignore_materials:
|
|
|
+ print(f' | {need:5.0f} (ignored)')
|
|
|
+ else:
|
|
|
+ cost = raw_prices[ticker]['Ask'] * need
|
|
|
+ total_cost += cost
|
|
|
+ print(f' | {need:5.0f} (${cost:6.0f})')
|
|
|
else:
|
|
|
print()
|
|
|
print(f'\ntotal cost: {total_cost:,}')
|
|
|
|
|
|
combined_buy: dict[str, int] = collections.defaultdict(int)
|
|
|
- for buy in optimal.values():
|
|
|
+ for planet_name, buy in optimal.items():
|
|
|
+ supply_config = config.supply_config(planet_name)
|
|
|
for ticker, amount in buy.items():
|
|
|
- combined_buy[ticker] += amount
|
|
|
+ if ticker not in supply_config.ignore_materials:
|
|
|
+ combined_buy[ticker] += amount
|
|
|
print(cyan('\nbuy:\n') + json.dumps({
|
|
|
'actions': [
|
|
|
{'name': 'BuyItems', 'type': 'CX Buy', 'group': 'A1', 'exchange': 'IC1',
|
|
|
@@ -179,8 +185,6 @@ class Planet:
|
|
|
if net < 0:
|
|
|
continue
|
|
|
c['net_consumption'] = net
|
|
|
- if c['MaterialTicker'] in config.supply.ignore_materials:
|
|
|
- continue
|
|
|
self.net_consumption.append(c)
|
|
|
|
|
|
def buy_for_target(self, target_days: float) -> dict[str, int]:
|