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:
2026-10-09 13:32:58 +02:00
co-authored by Claude Sonnet 5
parent 88dae754ca
commit 9a4c7cc57c
5 changed files with 406 additions and 2 deletions
+6 -2
View File
@@ -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):