pub struct BudgetControllerConfig {
pub pid: PidGains,
pub eprocess: EProcessConfig,
pub target: Duration,
pub degrade_threshold: f64,
pub upgrade_threshold: f64,
pub cooldown_frames: u32,
}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.
Trait Implementations§
Source§impl Clone for BudgetControllerConfig
impl Clone for BudgetControllerConfig
Source§fn clone(&self) -> BudgetControllerConfig
fn clone(&self) -> BudgetControllerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BudgetControllerConfig
impl Debug for BudgetControllerConfig
Source§impl Default for BudgetControllerConfig
impl Default for BudgetControllerConfig
Source§impl PartialEq for BudgetControllerConfig
impl PartialEq for BudgetControllerConfig
impl StructuralPartialEq for BudgetControllerConfig
Auto Trait Implementations§
impl Freeze for BudgetControllerConfig
impl RefUnwindSafe for BudgetControllerConfig
impl Send for BudgetControllerConfig
impl Sync for BudgetControllerConfig
impl Unpin for BudgetControllerConfig
impl UnsafeUnpin for BudgetControllerConfig
impl UnwindSafe for BudgetControllerConfig
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
Mutably borrows from an owned value. Read more