Skip to main content

Crate swarmkit_sailing

Crate swarmkit_sailing 

Source
Expand description

Sailing-route PSO physics on top of the generic swarmkit particle-swarm library.

Provides the spherical-Earth coordinate primitives, wind / boat / landmass traits, and PSO movers (init, mutation, time, range-cache) that the bywind sailing-route optimiser composes into a full search. Headless: no GUI, no GRIB2 I/O — those live in bywind.

  • spherical — coordinate / segment / wind types and great-circle primitives shared by every other module.
  • Boat / Sailboat — boat physics model and the trait the PSO evaluates fitness against.
  • SearchSettings — outer / inner PSO sizing and topology choice.
  • RouteBounds / LonLatBbox — search-domain types.
  • TopologyGBest, Ring, VonNeumann, Niched.

Re-exports§

pub use spherical::LatLon;
pub use spherical::LatLonDelta;
pub use spherical::LonLatBbox;
pub use spherical::Segment;
pub use spherical::TangentMetres;
pub use spherical::Wind;
pub use units::Path;
pub use units::PathXY;
pub use units::Time;

Modules§

profile_timers
Sub-stage Instant::now counters around the sailing-search hot paths.
spherical
Spherical-Earth math primitives used by the sailing search.
units

Structs§

BaselineShares
Allocation shares across baseline reference paths.
Boat
Sailboat physics model: motor + wind-driven speed and fuel-burn cubic.
Floats
Element-wise newtype over [f64; N].
InitShares
Allocation shares across init shape families. Weights are normalised at allocation; negative is clamped to 0; all-zero falls back to sin_k1-only. The largest-share family absorbs rounding drift.
LandmassSourceDummy
Land-free LandmassSource for tests/demos and for callers that don’t have landmass data.
ParseTopologyError
Unknown topology name from Topology’s FromStr. The message lists Topology::ALL for CLI / TOML diagnostics.
PathBaseline
Reference path that the init families perturb.
PathInit
ProbeCounters
locate-call counters plus out-of-range probe count (when the queried dep falls outside the tabulated range, locate clamps silently — see item D in the accuracy writeup). Feature-gated to avoid atomic traffic in normal builds; per-instance so concurrent searches don’t share counters.
ProbeStats
RouteBounds
Search domain and endpoint constraints.
SailboatFitCalc
SearchSettings
Outer (space) + inner (time) PSO sizing and coefficients. Both PSOs share the velocity-update coefficients; the inner PSO runs once per outer particle per iteration.
SegmentRangeTables
Per-segment travel_time(departure_time, mcr) lookup tables. Replaces full wind integrations with O(1) interpolated lookups in the inner time-PSO hot path. Rebuilt once per outer xy change. Segment i covers xy[i] -> xy[i+1] and arrives at t[i+1].
WindSourceDummy
Zero-wind WindSource for tests/demos where the wind field is irrelevant.

Enums§

SeaPathBias
Direction bias for LandmassSource::find_sea_path.
Topology
Outer-loop search topology. The match seam in search is the only topology-aware code; init, kicks, boundary, time PSO, and fitness are topology-agnostic.

Constants§

DEFAULT_STEP_DISTANCE_FRACTION
1% of the bbox diagonal — ~100 substeps along the longest path.

Traits§

LandmassSource
Static landmass / coastline data for the search to consult.
Sailboat
SailboatFitData
Lets downstream fit calcs (notably TimeFitCalc) reach SailboatFitCalc’s state without binding to the concrete type.
WindSource

Functions§

get_segment_fuel_and_time
Returns (mcr_01, fuel, time) for each segment of path, in order.
get_segment_land_metres
Total ground distance (m) over land along the great-circle from origin to destination.
reoptimize_times
Re-runs only the inner time PSO over fixed_path, holding fixed_path.xy constant and producing an optimized t.
search
weighted_fitness
Combine route totals into the scalar fitness score.