|
|
@@ -36,13 +36,9 @@ def main() -> None:
|
|
|
|
|
|
print(f'consuming {vol_per_day:.1f}㎥/d')
|
|
|
print(f'consuming {weight_per_day:.1f}t/d')
|
|
|
- limiting = 'Volume'
|
|
|
- if weight_per_day > vol_per_day:
|
|
|
- limiting = 'Weight'
|
|
|
-
|
|
|
target_days = round(target_days + 0.05, 1)
|
|
|
while True:
|
|
|
- space_used = 0
|
|
|
+ weight_used = volume_used = 0
|
|
|
buy: dict[str, float] = {}
|
|
|
for consumption in net_consumption:
|
|
|
ticker = consumption['MaterialTicker']
|
|
|
@@ -51,9 +47,10 @@ def main() -> None:
|
|
|
days = avail / daily_consumption
|
|
|
if days < target_days:
|
|
|
buy[ticker] = (target_days - days) * daily_consumption
|
|
|
- space_used += buy[ticker] * materials[ticker][limiting]
|
|
|
+ weight_used += buy[ticker] * materials[ticker]['Weight']
|
|
|
+ volume_used += buy[ticker] * materials[ticker]['Volume']
|
|
|
|
|
|
- if space_used > 500:
|
|
|
+ if weight_used > 500 or volume_used > 500:
|
|
|
break
|
|
|
optimal = buy
|
|
|
target_days += 0.1
|