pub struct PowPolicyThresholds {
pub strong_floor: f64,
pub degraded_floor: f64,
pub max_risk_delta: f64,
pub strong_rate_floor_rps: f64,
pub weak_rate_ceiling_rps: f64,
pub weak_backoff_floor_ms: u64,
}Expand description
Configurable thresholds for the PoW policy mapper.
The defaults match the band boundaries the
PowCapabilityScorer
uses (strong ≥ 0.75, degraded ≥ 0.40). The struct
is Copy so it can live in a static configuration
struct.
Fields§
§strong_floor: f64Lower edge of the Strong band (inclusive).
degraded_floor: f64Lower edge of the Degraded band (inclusive).
max_risk_delta: f64Maximum risk-score lift the mapper may apply
(clamped to [0.0, MAX_POW_RISK_DELTA]).
strong_rate_floor_rps: f64Pacing floor (rps) for the Strong band — the
adjusted policy never drops below
strong_rate_floor_rps even if the input policy had
a higher rate. Defaults to 1.0 so a previously
high-rate policy does not get silently slowed to
nothing by the mapper.
weak_rate_ceiling_rps: f64Pacing ceiling (rps) for the Weak band — the
adjusted policy never exceeds
weak_rate_ceiling_rps even if the input policy had
a higher rate.
weak_backoff_floor_ms: u64Backoff floor (ms) for the Weak band.
Implementations§
Source§impl PowPolicyThresholds
impl PowPolicyThresholds
Sourcepub const fn with_max_risk_delta(self, max_risk_delta: f64) -> Self
pub const fn with_max_risk_delta(self, max_risk_delta: f64) -> Self
Replace the max_risk_delta clamp. Clamped to
[0.0, MAX_POW_RISK_DELTA] so callers cannot
widen the documented safety bound.
Sourcepub fn with_strong_rate_floor_rps(self, floor: f64) -> Self
pub fn with_strong_rate_floor_rps(self, floor: f64) -> Self
Replace the strong_rate_floor_rps floor. Non-finite
or non-positive values fall back to the documented
default so the mapper cannot silently disable
pacing.
Sourcepub fn with_weak_rate_ceiling_rps(self, ceiling: f64) -> Self
pub fn with_weak_rate_ceiling_rps(self, ceiling: f64) -> Self
Replace the weak_rate_ceiling_rps ceiling.
Non-finite or non-positive values fall back to the
documented default.
Sourcepub const fn with_weak_backoff_floor_ms(self, floor: u64) -> Self
pub const fn with_weak_backoff_floor_ms(self, floor: u64) -> Self
Replace the weak_backoff_floor_ms floor. Zero
values fall back to the documented default.
Trait Implementations§
Source§impl Clone for PowPolicyThresholds
impl Clone for PowPolicyThresholds
Source§fn clone(&self) -> PowPolicyThresholds
fn clone(&self) -> PowPolicyThresholds
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more