pub struct SearchCfg {
pub w_g: i64,
pub w_h: i64,
pub max_eval: usize,
pub w_c: f64,
}Expand description
Tunable weighted-best-first parameters (exposed via the library Options).
w_g/w_h are pre-scaled integers (weight * WEIGHT_SCALE), so the default
1·g + 5·h ordering is preserved exactly while fractional weights still work.
Key units, for calibrating new terms: one h-unit = 1280 (5·256), one g-step
= 256, one unsatisfied preference = weight·100 (SatGuidance::penalty),
one metric-cost unit = w_c·256. w_c (default 0.0 = term absent, key
bit-identical to the historical one) adds the successor’s accumulated
metric cost fv[cost_fluent] to the ordering — used by the preference-
metric B&B loops so a folded numeric metric (rovers’ traverse costs) and
forgo-vs-satisfy trade-offs order the open list instead of only pruning at
the bound.
Fields§
§w_g: i64§w_h: i64§max_eval: usize§w_c: f64Implementations§
Source§impl SearchCfg
impl SearchCfg
Sourcepub fn from_weights(
weight_g: f64,
weight_h: f64,
max_eval: Option<usize>,
) -> Self
pub fn from_weights( weight_g: f64, weight_h: f64, max_eval: Option<usize>, ) -> Self
Build from human-facing f64 weights. weight_g = 1.0, weight_h = 5.0
reproduces the historical 1·g + 5·h ordering bit-for-bit.
Inputs are sanitized so a malformed weight can never collapse or overflow the integer heap key: a non-finite or negative weight falls back to that term’s default, weights are clamped to a sane maximum, and if both round to zero the defaults are restored (an all-zero key would degrade to insertion order).
Sourcepub fn with_cost_weight(self, w_c: f64) -> Self
pub fn with_cost_weight(self, w_c: f64) -> Self
Add a metric-cost ordering weight (see the struct docs). Non-finite or
negative weights sanitize to 0.0 (term absent), like from_weights.