pub struct EthogramRegistry {
pub taxon_iri_hash: u64,
pub behavior_count: usize,
pub behaviors: [EthogramBehaviorEntry; 32],
}Expand description
A fixed-capacity, zero-heap Ethogram Registry for an entity or taxon family.
Fields§
§taxon_iri_hash: u64q_hash of the taxon/entity-family IRI this registry describes.
behavior_count: usizeNumber of live entries in behaviors (≤ MAX_ETHOGRAM_BEHAVIORS).
behaviors: [EthogramBehaviorEntry; 32]Fixed-capacity entry table; only the first behavior_count are live.
Implementations§
Source§impl EthogramRegistry
impl EthogramRegistry
Sourcepub const fn new(taxon_iri_hash: u64) -> Self
pub const fn new(taxon_iri_hash: u64) -> Self
Create an empty registry for a taxon (all MAX_ETHOGRAM_BEHAVIORS
slots zeroed); const so it can live in statics.
Sourcepub fn add_behavior(&mut self, entry: EthogramBehaviorEntry) -> bool
pub fn add_behavior(&mut self, entry: EthogramBehaviorEntry) -> bool
Add a behavior entry to the registry. Returns false if registry is full.
Sourcepub fn evaluate_stimulus(
&self,
stimulus: &StimulusEvent,
current_state: &mut EntityPhysiologicalState,
) -> TransitionVerdict
pub fn evaluate_stimulus( &self, stimulus: &StimulusEvent, current_state: &mut EntityPhysiologicalState, ) -> TransitionVerdict
Evaluate an incoming stimulus against current state in $O(1)$ zero-heap time.
Updates current_state in-place and returns the transition verdict.
Trait Implementations§
Source§impl Clone for EthogramRegistry
impl Clone for EthogramRegistry
Source§impl Debug for EthogramRegistry
impl Debug for EthogramRegistry
Source§impl Default for EthogramRegistry
impl Default for EthogramRegistry
Source§impl<'de> Deserialize<'de> for EthogramRegistry
impl<'de> Deserialize<'de> for EthogramRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EthogramRegistry
Source§impl PartialEq for EthogramRegistry
impl PartialEq for EthogramRegistry
Source§impl Serialize for EthogramRegistry
impl Serialize for EthogramRegistry
impl StructuralPartialEq for EthogramRegistry
Auto Trait Implementations§
impl Freeze for EthogramRegistry
impl RefUnwindSafe for EthogramRegistry
impl Send for EthogramRegistry
impl Sync for EthogramRegistry
impl Unpin for EthogramRegistry
impl UnsafeUnpin for EthogramRegistry
impl UnwindSafe for EthogramRegistry
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.