#[repr(C, align(32))]pub struct Lineage {
pub energy: f32,
pub threshold: f32,
pub decay_rate: f32,
pub rigidity: f32,
pub last_access: u64,
pub flags: LineageFlags,
pub head_index: u32,
}Expand description
A single lineage in the cognitive memory
Memory layout: 32 bytes (cache-line aligned) This struct represents a “neuron” in the cognitive database.
Fields§
§energy: f32Current energy level (0.0 - 1.0) Decays over time when not accessed
threshold: f32Consciousness threshold (0.0 - 1.0) When energy >= threshold, lineage is “conscious”
decay_rate: f32Decay rate (per second) Energy decays as: E(t) = E0 * exp(-decay_rate * Δt)
rigidity: f32Rigidity - resistance to change (0.0 - 1.0) Higher rigidity = slower learning but more stable
last_access: u64Last access timestamp (nanoseconds since epoch)
flags: LineageFlagsState flags
head_index: u32Index of the head engram in strata arena
Implementations§
Source§impl Lineage
impl Lineage
Sourcepub fn with_config(energy: f32, threshold: f32, decay_rate: f32) -> Self
pub fn with_config(energy: f32, threshold: f32, decay_rate: f32) -> Self
Create a new lineage with full configuration
Sourcepub fn is_conscious(&self) -> bool
pub fn is_conscious(&self) -> bool
Check if lineage is conscious (energy >= threshold)
Sourcepub fn is_protected(&self) -> bool
pub fn is_protected(&self) -> bool
Check if lineage is protected from decay
Sourcepub fn current_energy(&self) -> f32
pub fn current_energy(&self) -> f32
Compute current energy with decay applied
Trait Implementations§
impl Copy for Lineage
Source§impl<'de> Deserialize<'de> for Lineage
impl<'de> Deserialize<'de> for Lineage
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 Lineage
impl RefUnwindSafe for Lineage
impl Send for Lineage
impl Sync for Lineage
impl Unpin for Lineage
impl UnsafeUnpin for Lineage
impl UnwindSafe for Lineage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more