pub struct CognitiveCore { /* private fields */ }Expand description
Central cognitive controller implementing perceive-think-act-learn.
Implementations§
Source§impl CognitiveCore
impl CognitiveCore
Sourcepub fn new(config: CognitiveConfig) -> Self
pub fn new(config: CognitiveConfig) -> Self
Create a new cognitive core with the given configuration.
Sourcepub fn perceive(&mut self, percept: Percept) -> CognitiveState
pub fn perceive(&mut self, percept: Percept) -> CognitiveState
Ingest a percept and transition to the Perceiving state.
Percepts below the attention threshold are silently dropped.
When the buffer exceeds max_percepts, the oldest entry is removed.
Sourcepub fn think(&mut self) -> Option<Decision>
pub fn think(&mut self) -> Option<Decision>
Deliberate over buffered percepts and produce a decision.
Returns None when no percepts are available.
Sourcepub fn act(&mut self, decision: Decision) -> ActionCommand
pub fn act(&mut self, decision: Decision) -> ActionCommand
Convert a decision into an executable action command.
Sourcepub fn learn(&mut self, outcome: Outcome)
pub fn learn(&mut self, outcome: Outcome)
Incorporate feedback from the environment to improve future behaviour.
Sourcepub fn state(&self) -> CognitiveState
pub fn state(&self) -> CognitiveState
Current cognitive state.
Sourcepub fn mode(&self) -> CognitiveMode
pub fn mode(&self) -> CognitiveMode
Current operating mode.
Sourcepub fn percept_count(&self) -> usize
pub fn percept_count(&self) -> usize
Number of percepts currently buffered.
Sourcepub fn decision_count(&self) -> usize
pub fn decision_count(&self) -> usize
Number of decisions made so far.
Sourcepub fn cumulative_reward(&self) -> f64
pub fn cumulative_reward(&self) -> f64
Accumulated reward scaled by learning rate.
Trait Implementations§
Source§impl Clone for CognitiveCore
impl Clone for CognitiveCore
Source§fn clone(&self) -> CognitiveCore
fn clone(&self) -> CognitiveCore
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 moreAuto Trait Implementations§
impl Freeze for CognitiveCore
impl RefUnwindSafe for CognitiveCore
impl Send for CognitiveCore
impl Sync for CognitiveCore
impl Unpin for CognitiveCore
impl UnsafeUnpin for CognitiveCore
impl UnwindSafe for CognitiveCore
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