pub struct SearchConfig {Show 21 fields
pub waypoint_count: WaypointCount,
pub time_weight: f64,
pub fuel_weight: f64,
pub land_weight: f64,
pub particles_space: usize,
pub particles_time: usize,
pub iter_space: usize,
pub iter_time: usize,
pub inertia: f64,
pub cognitive_coeff: f64,
pub social_coeff: f64,
pub path_kick_probability: f64,
pub path_kick_gamma_0_fraction: f64,
pub path_kick_gamma_min_fraction: f64,
pub seed: Option<u64>,
pub step_distance_fraction: f64,
pub bake_step_deg: f64,
pub sdf_resolution_deg: f64,
pub range_k: usize,
pub k_mcr: usize,
pub topology: Topology,
}Expand description
Inputs to the sailing-search PSO.
Fields§
§waypoint_count: WaypointCountHow many waypoints the path has (endpoints included).
time_weight: f64fitness = -(time*time_weight + fuel*fuel_weight + land_metres*land_weight).
land_weight = 0 disables the soft landmass-avoidance penalty.
fuel_weight: f64See Self::time_weight.
land_weight: f64See Self::time_weight.
particles_space: usizeOuter-PSO particle count (route shape).
particles_time: usizeInner time-PSO particle count (per-waypoint timing).
iter_space: usizeOuter-PSO iteration count.
iter_time: usizeInner time-PSO iteration count.
inertia: f64inertia weights prior velocity; cognitive_coeff pulls toward
pbest; social_coeff toward gbest. Shared by outer (space) and
inner (time) PSOs.
cognitive_coeff: f64See Self::inertia.
See Self::inertia.
path_kick_probability: f64Path-shape kick lets the search jump into tacking topologies
that gradient-style PSO can’t reach. path_kick_probability is
per-particle, per-iteration; the two gammas are initial and
floor magnitudes as fractions of the route’s straight-line
length, cosine-decayed across iterations.
path_kick_gamma_0_fraction: f64§path_kick_gamma_min_fraction: f64§seed: Option<u64>None (default) draws fresh OS entropy; Some(s) makes the run
reproducible.
step_distance_fraction: f64Wind / landmass integration substep, as a fraction of the route bbox diagonal. Default 0.01.
bake_step_deg: f64Wind-grid cell size (degrees) when baking the search grid. Default 0.25°. Grown automatically if the map would overflow the per-axis cell cap.
sdf_resolution_deg: f64Landmass SDF cell size (degrees). Default 0.5°. Each distinct value pays a one-shot ~sub-second build.
range_k: usizeInner time-PSO lookup-table samples along the departure-time axis. Default 8. Must be ≥ 2.
k_mcr: usizeInner time-PSO lookup-table samples along the mcr_01 throttle
axis. Default 8. Must be ≥ 2.
topology: TopologyRound-trips through TOML / JSON as the lowercase variant name.
Implementations§
Source§impl SearchConfig
impl SearchConfig
pub fn to_search_settings(&self) -> SearchSettings
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Reject configs that would crash the PSO or produce nonsense
output. Cheap; a 30-second search that crashes on iter 0
because particles_space = 0 is strictly worse than a 1 ms
reject at submit time.
§Errors
Returns the first field that violates a rule.
Trait Implementations§
Source§impl Clone for SearchConfig
impl Clone for SearchConfig
Source§fn clone(&self) -> SearchConfig
fn clone(&self) -> SearchConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchConfig
impl Debug for SearchConfig
Source§impl Default for SearchConfig
impl Default for SearchConfig
Source§impl<'de> Deserialize<'de> for SearchConfigwhere
SearchConfig: Default,
impl<'de> Deserialize<'de> for SearchConfigwhere
SearchConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for SearchConfig
impl Serialize for SearchConfig
impl Copy for SearchConfig
Auto Trait Implementations§
impl Freeze for SearchConfig
impl RefUnwindSafe for SearchConfig
impl Send for SearchConfig
impl Sync for SearchConfig
impl Unpin for SearchConfig
impl UnsafeUnpin for SearchConfig
impl UnwindSafe for SearchConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more