Add real ship flight fuel/cost model (puga/shipping.py)
Calibrated from a controlled slider sweep across 5 real destinations, read from the live APEX Ship Flight Control DOM. Covers STL cruise, FTL jumps/charges, gateway hops (measured LOCK fees for ANT<->HRT/BEN), and per-planet landing fuel. Scoped to this account's one hull/reactor; open gaps (gravity dependence, hull generalization, gateway one-way links, per-gateway volume caps) are documented in the module docstring. tools/shiptrip.py is the simple entry point (ship + from + to, works out jumps/charges/landing itself); tools/shipcost.py takes explicit physics params for when the breakdown is already known. puga/route.py now also resolves CX station codes (ANT, HRT, ...), not just planets/systems - this was needed for the gateway-aware lookups to work at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -28,15 +28,19 @@ def load_graph():
|
||||
|
||||
|
||||
def resolve_system(query: str) -> str:
|
||||
"""Planet natural id (e.g. ZV-759c), system natural id (ZV-759), or a name -> SystemId."""
|
||||
"""Planet natural id (e.g. ZV-759c), CX station code (ANT), system natural id (ZV-759), or
|
||||
a name -> SystemId."""
|
||||
q = query.strip().upper()
|
||||
for p in fio.planets_full():
|
||||
if p.get("PlanetNaturalId", "").upper() == q or (p.get("PlanetName") or "").upper() == q:
|
||||
return p["SystemId"]
|
||||
for st in fio.stations():
|
||||
if st["NaturalId"].upper() == q or st["Name"].upper() == q:
|
||||
return st["SystemId"]
|
||||
for s in fio.systems():
|
||||
if s["NaturalId"].upper() == q or s["Name"].upper() == q:
|
||||
return s["SystemId"]
|
||||
raise ValueError(f"no planet or system matches {query!r}")
|
||||
raise ValueError(f"no planet, station, or system matches {query!r}")
|
||||
|
||||
|
||||
def shortest_path(src_system_id: str, dst_system_id: str, graph=None):
|
||||
|
||||
Reference in New Issue
Block a user