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: f32Brightness, normalized to [0.0, 1.0].
color_temp: f32Color temperature in Kelvin (2000–10000).
focal_distance: f32Focal distance, normalized to [0.0, 1.0].
volume: f32Volume, normalized to [0.0, 1.0].
tempo: f32Tempo in BPM (0–300).
pitch: f32Pitch in Hertz (20–20000).
temperature: f32Temperature in Celsius.
movement: f32Movement, normalized to [0.0, 1.0].
arousal: f32Arousal, normalized to [0.0, 1.0].
Implementations§
Source§impl SubmodalityPattern
impl SubmodalityPattern
Sourcepub fn zeros() -> Self
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?
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}Sourcepub fn normalize(&self) -> NormalizedPattern
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
impl Clone for SubmodalityPattern
Source§fn clone(&self) -> SubmodalityPattern
fn clone(&self) -> SubmodalityPattern
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more