pub struct BudgetControllerConfig {
pub pid: PidGains,
pub eprocess: EProcessConfig,
pub target: Duration,
pub degrade_threshold: f64,
pub upgrade_threshold: f64,
pub cooldown_frames: u32,
pub degradation_floor: DegradationLevel,
}Expand description
Configuration for the adaptive budget controller.
Fields§
§pid: PidGainsPID controller gains.
eprocess: EProcessConfigE-process configuration.
target: DurationTarget frame time.
degrade_threshold: f64Hysteresis: PID output must exceed this to trigger degradation.
This prevents oscillation at the boundary. The value is in normalized units (error / target). Default: 0.3 (30% of target).
§Justification
A threshold of 0.3 means the controller needs ~5ms sustained error at 16ms target before degrading. This filters out single-frame jitter while remaining responsive to genuine overload (2-3 consecutive slow frames will cross the threshold via integral accumulation).
upgrade_threshold: f64Hysteresis: PID output must be below negative of this to trigger upgrade. Default: 0.2 (20% of target).
cooldown_frames: u32Cooldown frames between level changes.
degradation_floor: DegradationLevelMinimum quality floor: the controller will never degrade past this level.
Default: DegradationLevel::SimpleBorders — preserves readable text
content while still allowing border simplification.
Setting this to DegradationLevel::Full disables all degradation.
Setting this to DegradationLevel::SkipFrame effectively removes the floor.
Trait Implementations§
Source§impl Clone for BudgetControllerConfig
impl Clone for BudgetControllerConfig
Source§fn clone(&self) -> BudgetControllerConfig
fn clone(&self) -> BudgetControllerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more