pub struct InstinctEngine { /* private fields */ }Implementations§
Source§impl InstinctEngine
impl InstinctEngine
pub fn new() -> Self
pub fn with_thresholds(thresholds: Thresholds) -> Self
Sourcepub fn tick(&mut self, state: &State) -> Vec<Reflex>
pub fn tick(&mut self, state: &State) -> Vec<Reflex>
Evaluate all instincts against current state. Returns active reflexes sorted by urgency (highest first).
Sourcepub fn peer_died(&mut self, peer_id: u32) -> Option<Reflex>
pub fn peer_died(&mut self, peer_id: u32) -> Option<Reflex>
Register a peer death. Returns a Mourn reflex if this peer hasn’t been mourned yet. CAN return at most one Mourn per peer_id (ONCE enforcement).
Sourcepub fn highest_priority(reflexes: &[Reflex]) -> Option<&Reflex>
pub fn highest_priority(reflexes: &[Reflex]) -> Option<&Reflex>
Get the highest-priority reflex from the last tick. Returns None if no reflexes are active.
Sourcepub fn all_assertions(&mut self) -> Vec<Assertion>
pub fn all_assertions(&mut self) -> Vec<Assertion>
Generate all 45 assertions for this engine (every instinct × every enforcement level). Useful for bulk-loading into plato-constraints.
Sourcepub fn instinct_count() -> usize
pub fn instinct_count() -> usize
Get instinct count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InstinctEngine
impl RefUnwindSafe for InstinctEngine
impl Send for InstinctEngine
impl Sync for InstinctEngine
impl Unpin for InstinctEngine
impl UnsafeUnpin for InstinctEngine
impl UnwindSafe for InstinctEngine
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