Skip to main content

PerceptionManager

Struct PerceptionManager 

Source
pub struct PerceptionManager { /* private fields */ }
Expand description

Manager for perception states and interactions

Implementations§

Source§

impl PerceptionManager

Source

pub fn new() -> Self

Create a new perception manager

Source

pub fn register_perception(&mut self, perception: PerceptionView) -> Result<()>

Register a new perception

Source

pub fn get_perception( &self, perception_id: PerceptionId, ) -> Option<&PerceptionView>

Get a perception by ID

Source

pub fn update_confidence( &mut self, perception_id: PerceptionId, evidence: PerceptionEvidence, ) -> Result<()>

Update perception confidence based on new evidence

Source

pub fn acquire_lock( &mut self, perception_id: PerceptionId, session_id: Uuid, lock_type: PerceptionLockType, duration_seconds: u64, ) -> Result<bool>

Attempt to acquire a perception lock

Source

pub fn release_lock( &mut self, perception_id: PerceptionId, session_id: Uuid, ) -> Result<()>

Release a perception lock

Source

pub fn cleanup_expired_locks(&mut self) -> usize

Clean up expired locks

Source

pub fn add_relationship( &mut self, from_perception: PerceptionId, to_perception: PerceptionId, relationship_type: PerceptionRelationType, ) -> Result<()>

Add a relationship between two perceptions

Source

pub fn find_conflicts(&self, perception_id: PerceptionId) -> Vec<PerceptionId>

Find perceptions that conflict with a given perception

Source

pub fn find_supporters(&self, perception_id: PerceptionId) -> Vec<PerceptionId>

Find perceptions that support a given perception

Source

pub fn get_high_confidence_perceptions( &self, threshold: f64, ) -> Vec<PerceptionId>

Get all perceptions with confidence above a threshold

Source

pub fn get_statistics(&self) -> PerceptionManagerStats

Get statistics about perception states

Trait Implementations§

Source§

impl Default for PerceptionManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.