summaryrefslogtreecommitdiff
path: root/backend/src/manager.py
diff options
context:
space:
mode:
authorkboz <kutayboz@gmail.com>2026-04-19 01:50:32 +0200
committerkboz <kutayboz@gmail.com>2026-04-19 01:50:32 +0200
commitacbf6d6bd6d63ab0e9f7c4e119827f76e0382aac (patch)
tree9d2f74608ae4b910a480648c7bd95fdf6c403389 /backend/src/manager.py
parent8cc70dfee2049772a2da9cfdeb15f64452bc390b (diff)
downloadhaul-acbf6d6bd6d63ab0e9f7c4e119827f76e0382aac.tar.gz
feat(backend): unify boot process and refactor route properties
- Added scripts/haul.sh, setup_auth.py, and setup_eve_data.py for simplified SSO and CSV data bootstrapping. - Refactored `Ship` and `RouteStep` properties across route planning modules to utilize dictionaries instead of strict dataclass attributes. - Re-aligned route limits, reducing upfront capital risk values in `arbitrage.py` and updating ship metrics in `manager.py`. - Updated `.gitignore`, `.env.example`, and created AI-assistant prompt configuration. - Added comprehensive "Getting Started" guides to the README and initialized CHANGELOG.md.
Diffstat (limited to 'backend/src/manager.py')
-rw-r--r--backend/src/manager.py31
1 files changed, 18 insertions, 13 deletions
diff --git a/backend/src/manager.py b/backend/src/manager.py
index 03df5d8..09d920e 100644
--- a/backend/src/manager.py
+++ b/backend/src/manager.py
@@ -1,6 +1,6 @@
import threading
-from graph import Graph
+from graph import NavigationGraph
from esi.api import get_location, set_waypoints, open_market_window
from market import Market
from arbitrage import arbitrage, snipe
@@ -14,15 +14,15 @@ class Manager:
def __init__(self):
self.ship = {
"location": get_location(),
- "cargo": 600,
- "max_warp_speed": 8.22, # AU/s
- "max_subwarp_speed": 216.5, # m/s
+ "cargo": 4000,
+ "max_warp_speed": 4.55, # AU/s
+ "max_subwarp_speed": 166.9, # m/s
"gankers_areas": {"Ahbazon": 0.5}, #["Miroitem", "Rancer", "Huola", "Ahbazon", "Uedama", "Sivala", "Tama", "Onatoh"],
"player_cost": 15_000_000 / 3600, # isk/second
"risk_cost": 60_000_000, # isk
- "ship_cost": 50_000_000 # isk
+ "ship_cost": 5_500_000 # isk
}
- self.graph = Graph(self.ship)
+ self.graph = NavigationGraph(self.ship)
self.route = []
self.route_info = {}
self.market = Market()
@@ -51,12 +51,12 @@ class Manager:
potential_snipe = snipe(self.market.orders, self.ship["cargo"], current_region)
if potential_snipe:
self.log.append("----------------")
- self.log.append("Snipe: " + str(potential_snipe[1]) + " orders for " + str(potential_snipe[0]) + " ISK")
+ self.log.append(f"Snipe: {potential_snipe.item_name} orders for {potential_snipe.gross_profit} ISK")
self.log.append("----------------")
- print("snipe possible", potential_snipe[0], "ISK", potential_snipe[1])
+ print("snipe possible", potential_snipe.gross_profit, "ISK", potential_snipe.item_name)
- open_market_window(potential_snipe[1]["type_id"])
+ open_market_window(potential_snipe.type_id)
def update(self):
@@ -82,8 +82,9 @@ class Manager:
def target_function(log):
try:
- updated_regions = self.market.update_orders(log)
+ updated_regions = self.market.update_orders()
if updated_regions:
+ log.append(f"Updated {len(updated_regions)} market regions")
self.snipe_callback(updated_regions)
finally:
self.updating_orders = False
@@ -97,8 +98,12 @@ class Manager:
order_matches = pathfinder(order_matches, self.graph, self.ship)
self.route, self.route_info = route.route(order_matches, self.graph, self.ship)
- set_waypoints([r["location_id"] for r in self.route[1:]])
-
- print(self.route)
+ if self.route:
+ set_waypoints([r["location_id"] for r in self.route[1:]])
+ print(self.route)
+ else:
+ self.route = []
+ self.route_info = {}
+ print("No profitable route found yet.")
\ No newline at end of file