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.Topology—GBest,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::nowcounters around the sailing-search hot paths. - spherical
- Spherical-Earth math primitives used by the sailing search.
- units
Structs§
- Baseline
Shares - 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]. - Init
Shares - 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. - Landmass
Source Dummy - Land-free
LandmassSourcefor tests/demos and for callers that don’t have landmass data. - Parse
Topology Error - Unknown topology name from
Topology’sFromStr. The message listsTopology::ALLfor CLI / TOML diagnostics. - Path
Baseline - Reference path that the init families perturb.
- Path
Init - Probe
Counters locate-call counters plus out-of-range probe count (when the querieddepfalls outside the tabulated range,locateclamps 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.- Probe
Stats - Route
Bounds - Search domain and endpoint constraints.
- Sailboat
FitCalc - Search
Settings - 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.
- Segment
Range Tables - 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 outerxychange. Segmenticoversxy[i] -> xy[i+1]and arrives att[i+1]. - Wind
Source Dummy - Zero-wind
WindSourcefor tests/demos where the wind field is irrelevant.
Enums§
- SeaPath
Bias - Direction bias for
LandmassSource::find_sea_path. - Topology
- Outer-loop search topology. The match seam in
searchis 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§
- Landmass
Source - Static landmass / coastline data for the search to consult.
- Sailboat
- Sailboat
FitData - Lets downstream fit calcs (notably
TimeFitCalc) reachSailboatFitCalc’s state without binding to the concrete type. - Wind
Source
Functions§
- get_
segment_ fuel_ and_ time - Returns
(mcr_01, fuel, time)for each segment ofpath, in order. - get_
segment_ land_ metres - Total ground distance (m) over land along the great-circle from
origintodestination. - reoptimize_
times - Re-runs only the inner time PSO over
fixed_path, holdingfixed_path.xyconstant and producing an optimizedt. - search
- weighted_
fitness - Combine route totals into the scalar fitness score.