pub struct ArchetypeState {
pub archetypes: Vec<Archetype>,
/* private fields */
}Expand description
Archetype system state.
Fields§
§archetypes: Vec<Archetype>Implementations§
Source§impl ArchetypeState
impl ArchetypeState
Sourcepub fn load_or_init(output_dir: &Path) -> Self
pub fn load_or_init(output_dir: &Path) -> Self
Load or initialize archetype state.
Sourcepub fn detect(
&mut self,
resonance: &ResonanceState,
hebb: &HebbianState,
headers: &[(f32, f32, f32)],
block_texts: &[&str],
) -> usize
pub fn detect( &mut self, resonance: &ResonanceState, hebb: &HebbianState, headers: &[(f32, f32, f32)], block_texts: &[&str], ) -> usize
Detect new archetypes from the resonance field and Hebbian state. Returns the number of new archetypes emerged.
Sourcepub fn reinforce(&mut self, activated_blocks: &[(u32, f32)])
pub fn reinforce(&mut self, activated_blocks: &[(u32, f32)])
Reinforce archetypes based on a new activation pattern. If activated blocks overlap with an archetype’s members, strengthen it.
Sourcepub fn match_archetype(
&self,
activated_blocks: &[(u32, f32)],
) -> Option<(usize, f32)>
pub fn match_archetype( &self, activated_blocks: &[(u32, f32)], ) -> Option<(usize, f32)>
Find which archetype (if any) a query activation best matches.
Sourcepub fn stats(&self) -> ArchetypeStats
pub fn stats(&self) -> ArchetypeStats
Get statistics.
Auto Trait Implementations§
impl Freeze for ArchetypeState
impl RefUnwindSafe for ArchetypeState
impl Send for ArchetypeState
impl Sync for ArchetypeState
impl Unpin for ArchetypeState
impl UnsafeUnpin for ArchetypeState
impl UnwindSafe for ArchetypeState
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> 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