game.core.planning.player_rule_route

Compute player flight routes based on distance and fuel rules.

This module provides a simple pathfinding algorithm used to estimate a player’s possible flight route between airports.

Includes:
  • RouteResult: dataclass describing route metrics.

  • _km: distance helper using geopy.

  • compute_player_rule_route: main function implementing the rule-based routing.

Functions

compute_player_rule_route(start_airport, ...)

Compute a simple greedy route between two airports.

Classes

RouteResult(path, hops, distance_km, ...[, ...])

Represents the result of a computed flight route.

class game.core.planning.player_rule_route.RouteResult(path: List[Airport], hops: int, distance_km: float, base_fuel: float, success: bool, message: str = '')

Bases: object

Represents the result of a computed flight route.

base_fuel: float
distance_km: float
hops: int
message: str = ''
path: List[Airport]
success: bool
game.core.planning.player_rule_route._km(a: Airport, b: Airport) float

Return the great-circle distance between two airports in kilometers.

game.core.planning.player_rule_route.compute_player_rule_route(start_airport: Airport, target_airport: Airport, all_airports: Iterable[Airport], fuel_per_km: float, fuel_fixed: float, k_neighbors: int = 5) RouteResult

Compute a simple greedy route between two airports.

Parameters:
  • start_airport – Starting airport.

  • target_airport – Destination airport.

  • all_airports – Iterable of available airports.

  • fuel_per_km – Fuel cost per kilometer.

  • fuel_fixed – Fixed cost per leg.

  • k_neighbors – Number of nearest candidates to consider.

Returns:

Result with path, distance, hops, fuel usage, and success flag.

Return type:

RouteResult