pub struct CoherenceAccumulator {
pub value: f32,
pub interaction_count: u32,
pub last_interaction_tick: u64,
}Expand description
Per-context coherence accumulator. Grows through repeated positive interaction, decays with disuse, drops on negative events.
Interaction history builds a protected floor so that earned trust cannot be erased by transient negative events.
Patent Claims 2–5.
Fields§
§value: f32Accumulated coherence for this context [0.0, 1.0].
interaction_count: u32Total positive interactions recorded in this context.
last_interaction_tick: u64Tick of the most recent interaction (positive or negative).
Implementations§
Source§impl CoherenceAccumulator
impl CoherenceAccumulator
Sourcepub fn new_with_baseline(curiosity: f32) -> Self
pub fn new_with_baseline(curiosity: f32) -> Self
Cold-start constructor: initialise value from personality curiosity_drive.
curiosity: personality curiosity_drive in [0.0, 1.0].
Baseline = 0.15 × curiosity (max 0.15 for curiosity = 1.0).
Sourcepub fn earned_floor(&self) -> f32
pub fn earned_floor(&self) -> f32
The minimum coherence that interaction history protects against decay or negative events.
Asymptotically approaches 0.5 with repeated interactions — never fully immune, but increasingly resilient.
floor = 0.5 × (1 − 1 / (1 + count / 20))
count = 0 → floor ≈ 0.00
count = 20 → floor ≈ 0.25
count = 100 → floor ≈ 0.42
limit → 0.50Sourcepub fn positive_interaction(
&mut self,
recovery_speed: f32,
tick: u64,
alone: bool,
)
pub fn positive_interaction( &mut self, recovery_speed: f32, tick: u64, alone: bool, )
Record a positive interaction. Coherence grows asymptotically toward 1.0.
recovery_speed: personality parameter [0.0, 1.0] — higher = faster growth.tick: current tick for freshness tracking.alone:trueif presence is Absent — doubles delta for faster bootstrap.
Sourcepub fn negative_interaction(&mut self, startle_sensitivity: f32, tick: u64)
pub fn negative_interaction(&mut self, startle_sensitivity: f32, tick: u64)
Record a negative interaction (startle, collision, high tension).
The drop is floored at earned_floor() so that accumulated trust
cannot be fully erased by a single negative event.
startle_sensitivity: personality parameter [0.0, 1.0] — higher = bigger drop.tick: current tick.
Trait Implementations§
Source§impl Clone for CoherenceAccumulator
impl Clone for CoherenceAccumulator
Source§fn clone(&self) -> CoherenceAccumulator
fn clone(&self) -> CoherenceAccumulator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more