Skip to main content

SubmodalityPattern

Struct SubmodalityPattern 

Source
pub struct SubmodalityPattern {
    pub brightness: f32,
    pub color_temp: f32,
    pub focal_distance: f32,
    pub volume: f32,
    pub tempo: f32,
    pub pitch: f32,
    pub temperature: f32,
    pub movement: f32,
    pub arousal: f32,
}
Expand description

A submodality pattern as described in the paper.

This mirrors the SubmodalityPattern pseudo-code and keeps raw values in their natural units. Normalization to [0, 1] is handled separately.

Fields§

§brightness: f32

Brightness, normalized to [0.0, 1.0].

§color_temp: f32

Color temperature in Kelvin (2000–10000).

§focal_distance: f32

Focal distance, normalized to [0.0, 1.0].

§volume: f32

Volume, normalized to [0.0, 1.0].

§tempo: f32

Tempo in BPM (0–300).

§pitch: f32

Pitch in Hertz (20–20000).

§temperature: f32

Temperature in Celsius.

§movement: f32

Movement, normalized to [0.0, 1.0].

§arousal: f32

Arousal, normalized to [0.0, 1.0].

Implementations§

Source§

impl SubmodalityPattern

Source

pub fn zeros() -> Self

Create a neutral baseline pattern for initialization and testing.

“Neutral” means unit-range fields are centered or zeroed, and absolute scale fields are set to commonly used midpoints. This is a placeholder baseline and should be replaced with domain-specific defaults later.

Examples found in repository?
examples/demo_offline_matching.rs (line 13)
5fn main() {
6    let srt = SemanticRendezvousToken::from_hex(
7        "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
8    )
9    .expect("valid hex");
10    let target = pattern_from_srt(&srt, b"oracle-state");
11
12    let measured_stream = vec![
13        SubmodalityPattern::zeros(),
14        SubmodalityPattern {
15            brightness: 0.52,
16            volume: 0.47,
17            ..SubmodalityPattern::zeros()
18        },
19        SubmodalityPattern {
20            brightness: 0.51,
21            volume: 0.48,
22            ..SubmodalityPattern::zeros()
23        },
24        SubmodalityPattern {
25            brightness: 0.5,
26            volume: 0.49,
27            ..SubmodalityPattern::zeros()
28        },
29    ];
30
31    let mut matcher = Matcher::new(MatchingConfig::new(0.2, 2));
32
33    for (index, measured) in measured_stream.iter().enumerate() {
34        let matched = matcher.observe(measured, &target);
35        if matched {
36            println!("rendezvous triggered at index {index}");
37        } else {
38            println!("no match at index {index}");
39        }
40    }
41}
Source

pub fn normalize(&self) -> NormalizedPattern

Normalize this pattern into [0, 1] ranges for distance calculations.

The normalization uses fixed min/max ranges for each dimension. These ranges are reference defaults and may need tuning or calibration in real deployments based on sensors and user populations.

Temperature normalization assumes a 10..=40 Celsius operating window as a placeholder until domain-specific bounds are defined.

Trait Implementations§

Source§

impl Clone for SubmodalityPattern

Source§

fn clone(&self) -> SubmodalityPattern

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SubmodalityPattern

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SubmodalityPattern

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SubmodalityPattern

Source§

fn eq(&self, other: &SubmodalityPattern) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SubmodalityPattern

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SubmodalityPattern

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,