Expand description
Wind-data types and sailing-search logic shared by bywind-viz (the
egui GUI), bywind-cli (the command-line frontend), and any other
headless consumer. No GUI dependencies.
Module layout:
wind_map—WindMap/TimedWindMap/BakedWindMap, the time-varying wind grid and its precomputed sampling structure.grib2— load aTimedWindMapfrom GRIB2 files.wind_av1— AV1 near-lossless wind-map codec for fast save/load.io— extension-dispatched loaders that pick between GRIB2 andwind_av1automatically. The single-stop entry point used by both the CLI and the GUI’s file dialogs.fetch— pull GFS UGRD/VGRD-at-10m messages from NOAA’s S3 bucket into a concatenated GRIB2 stream the rest of the pipeline can ingest.fmt— human-readable formatters for durations / fuel / distances / PSO-vs-benchmark deltas, shared by the GUI’s stats panel and the CLI’s summary output.bounds— derive search and bake bounds from a wind map.route—RouteEvolution(type-erases the const-generic waypoint count) plus thewaypoint_match!/route_evolution_match!dispatch macros.search— pure, blocking entry points for the PSO and time-reopt loops.solution— persistence schema for a single search result.metrics— per-segment fuel / time / speed breakdown.landmass— Natural Earth landmass grid and A* sea-path finder.
Most consumers can reach for the re-exports at this crate’s root; specialised
types (e.g. error enums, low-level landmass primitives) are accessible via
bywind::<module>::*.
Re-exports§
pub use wind_map::BakedWindMap;pub use wind_map::GridLayout;pub use wind_map::TimedWindMap;pub use wind_map::WindMap;pub use grib2::Grib2Bbox;pub use auto_bounds::derive_route_bbox;pub use auto_bounds::format_bbox_flag;pub use bounds::MapBounds;pub use config::BoatConfig;pub use config::GenerateConfig;pub use config::SearchConfig;pub use search::BAKE_STEP;pub use search::SearchError;pub use search::SearchResult;pub use search::SearchWeights;pub use search::run_search_blocking;pub use search::run_search_blocking_with_baked;pub use search::run_time_reopt_blocking;pub use metrics::SegmentMetrics;pub use metrics::compute_segment_metrics;pub use metrics::gbest_segment_metrics;pub use route::BenchmarkRoute;pub use route::RouteEvolution;pub use route::WaypointCount;pub use solution::SavedSolution;pub use landmass::SDF_RESOLUTION_DEG;pub use landmass::landmass_grid;pub use landmass::landmass_grid_at_resolution;
Modules§
- auto_
bounds - Auto-derive a sensible search bbox from just origin/destination.
- baked_
codec - Compact binary codec for
BakedWindMap. - bounds
- config
- Parameter-bag configs shared between consumers.
- fetch
- Pull GFS UGRD/VGRD-at-10m messages from NOAA’s AWS Open Data bucket into a concatenated GRIB2 stream.
- fmt
- Human-readable formatters shared by the GUI’s stats panel and the CLI’s summary output.
- grib2
- GRIB2 →
TimedWindMaploader. - io
- Wind-map loaders dispatched by file extension.
- landmass
- Static landmass / coastline data for the sailing search.
- metrics
- Per-segment metrics derived from a search-result
Path<N>against a baked wind field. These feed the GUI’s per-segment labels and the summary-panel totals; nothing here is rendering-specific. - route
- scenario
- TOML scenario files: a portable description of “what to search”.
- search
- Pure, blocking entry points for the sailing search and time-only PSO. Callers wrap them in their preferred concurrency model (GUI: worker thread + mpsc; CLI: main thread).
- solution
- Persistent representation of a single search solution.
- wind_
av1 - AV1 near-lossless codec for
crate::TimedWindMapdata on a regular lat/lon grid. - wind_
map
Macros§
- route_
evolution_ match - Dispatch on
RouteEvolution, binding the innerEvolution<Path<N>>per variant. Body monomorphises via type inference. - waypoint_
match - Dispatch on
WaypointCount, binding$nto the const N and$wrapto the matchingRouteEvolutionconstructor.
Structs§
- Boat
- Sailboat physics model: motor + wind-driven speed and fuel-burn cubic.
- LonLat
Bbox - Axis-aligned bounding box on the sphere in
(lon°, lat°)degrees. - Route
Bounds - Search domain and endpoint constraints.
- 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.
- Timed
Weather Row - A
WeatherRowtagged with a wall-clock time in seconds, used as the row-level representation when serialising / deserialising aTimedWindMapas a stream of samples. - Weather
Row - A single wind sample tagged with its
(lon, lat)position. - Wind
Sample - A single wind measurement: speed plus the direction it’s coming from.
Enums§
- 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.