pub struct ImplicitMemory {
pub patterns: HashMap<u64, ImplicitPattern>,
pub skills: HashMap<String, SkillNode>,
pub habits: Vec<(String, f32)>,
pub conditioning: HashMap<String, f32>,
}Fields§
§patterns: HashMap<u64, ImplicitPattern>§skills: HashMap<String, SkillNode>§habits: Vec<(String, f32)>§conditioning: HashMap<String, f32>Implementations§
Source§impl ImplicitMemory
impl ImplicitMemory
pub fn new() -> Self
Sourcepub fn learn_pattern(&mut self, pattern: Vec<u32>, success: bool)
pub fn learn_pattern(&mut self, pattern: Vec<u32>, success: bool)
Learn a procedural pattern from repeated activation
Sourcepub fn practice_skill(&mut self, skill: &str, error_occurred: bool)
pub fn practice_skill(&mut self, skill: &str, error_occurred: bool)
Develop or improve a skill
Sourcepub fn form_habit(&mut self, trigger: &str, strength_delta: f32)
pub fn form_habit(&mut self, trigger: &str, strength_delta: f32)
Form or reinforce a habit
Sourcepub fn condition_response(&mut self, stimulus: &str, response_strength: f32)
pub fn condition_response(&mut self, stimulus: &str, response_strength: f32)
Classical conditioning: stimulus -> response
Sourcepub fn strongest_patterns(&self, k: usize) -> Vec<(u64, ImplicitPattern)>
pub fn strongest_patterns(&self, k: usize) -> Vec<(u64, ImplicitPattern)>
Get strongest patterns
Sourcepub fn skill_ranking(&self) -> Vec<(String, SkillNode)>
pub fn skill_ranking(&self) -> Vec<(String, SkillNode)>
Get most practiced skills
pub fn save(&self, dir: &Path) -> Result<(), String>
pub fn load(dir: &Path) -> Result<Self, String>
pub fn load_or_init(dir: &Path) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImplicitMemory
impl RefUnwindSafe for ImplicitMemory
impl Send for ImplicitMemory
impl Sync for ImplicitMemory
impl Unpin for ImplicitMemory
impl UnsafeUnpin for ImplicitMemory
impl UnwindSafe for ImplicitMemory
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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