pub struct AttentionBudget {
pub total_capacity: u64,
pub allocated: HashMap<CouplingId, u64>,
pub safety_reserve: u64,
pub exhaustion_threshold: f64,
}Expand description
Attention budget for a Resonator
Attention is the finite capacity of a Resonator to process resonance.
Fields§
§total_capacity: u64Total attention capacity
allocated: HashMap<CouplingId, u64>Currently allocated attention (by coupling)
safety_reserve: u64Reserved for safety (never fully deplete)
exhaustion_threshold: f64Threshold that triggers degradation (0.0 to 1.0)
Implementations§
Source§impl AttentionBudget
impl AttentionBudget
pub fn new(total_capacity: u64) -> Self
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Calculate utilization (0.0 to 1.0)
Sourcepub fn is_exhaustion_imminent(&self) -> bool
pub fn is_exhaustion_imminent(&self) -> bool
Is exhaustion imminent?
Sourcepub fn can_allocate(&self, amount: u64) -> bool
pub fn can_allocate(&self, amount: u64) -> bool
Can allocate this amount?
Trait Implementations§
Source§impl Clone for AttentionBudget
impl Clone for AttentionBudget
Source§fn clone(&self) -> AttentionBudget
fn clone(&self) -> AttentionBudget
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 AttentionBudget
impl Debug for AttentionBudget
Source§impl<'de> Deserialize<'de> for AttentionBudget
impl<'de> Deserialize<'de> for AttentionBudget
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AttentionBudget
impl RefUnwindSafe for AttentionBudget
impl Send for AttentionBudget
impl Sync for AttentionBudget
impl Unpin for AttentionBudget
impl UnwindSafe for AttentionBudget
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