pub struct SensorGraph {
pub nodes: Vec<SensorNode>,
pub edges: Vec<SensorEdge>,
pub temporal_buffers: Vec<Vec<f32>>,
}Expand description
Graph-based sensor fusion substrate for distributed buoy arrays.
Fields§
§nodes: Vec<SensorNode>Buoy positions and node features.
edges: Vec<SensorEdge>Inter-buoy connections.
temporal_buffers: Vec<Vec<f32>>Temporal feature buffer per node (ring of scalar samples; typically short-time acoustic energy or a spectral band).
Implementations§
Source§impl SensorGraph
impl SensorGraph
Sourcepub fn add_buoy(&mut self, node: SensorNode) -> usize
pub fn add_buoy(&mut self, node: SensorNode) -> usize
Add a buoy node. Returns its index.
Sourcepub fn connect(&mut self, from: usize, to: usize)
pub fn connect(&mut self, from: usize, to: usize)
Connect two buoys; distance and delay derived from positions.
Uses Euclidean distance in (lat, lon, depth) space and a constant 1500 m/s sound speed. Production deployments should swap in geodesic
- SSP / BELLHOP-style propagation.
§Panics
Panics if from or to are out of bounds.
Sourcepub fn connect_with(
&mut self,
from: usize,
to: usize,
distance_m: f64,
propagation_delay_ms: f64,
)
pub fn connect_with( &mut self, from: usize, to: usize, distance_m: f64, propagation_delay_ms: f64, )
Connect with caller-supplied metrics (tests / offline graph builders).
Sourcepub fn connect_within_radius(&mut self, radius: f64)
pub fn connect_within_radius(&mut self, radius: f64)
Build a radius graph: undirected edges when distance ≤ radius.
Sourcepub fn connect_fully(&mut self)
pub fn connect_fully(&mut self)
Fully connected undirected graph (K-STEMIT-style small arrays).
Sourcepub fn push_temporal(&mut self, node_idx: usize, values: &[f32])
pub fn push_temporal(&mut self, node_idx: usize, values: &[f32])
Sourcepub fn trim_temporal(&mut self, max_len: usize)
pub fn trim_temporal(&mut self, max_len: usize)
Cap each temporal buffer to the last max_len samples.
Sourcepub fn neighbor_indices(&self, node_idx: usize) -> Vec<usize>
pub fn neighbor_indices(&self, node_idx: usize) -> Vec<usize>
Neighbor indices for a node (undirected).
Sourcepub fn neighbor_distances(&self, node_idx: usize) -> HashMap<usize, f64>
pub fn neighbor_distances(&self, node_idx: usize) -> HashMap<usize, f64>
Direct-edge distance map from node_idx to each neighbor.
Sourcepub fn aggregate_neighbors(&self, node_idx: usize, hop: usize) -> Vec<f32>
pub fn aggregate_neighbors(&self, node_idx: usize, hop: usize) -> Vec<f32>
GraphSAGE-style mean aggregation (unlearned baseline, hop-BFs).
Weighted by inverse distance on direct edges; multi-hop nodes without
a direct edge use weight 1.0. Prefer crate::sensor_graph::GraphSageLayer
for the learned path.
Sourcepub fn temporal_features(&self, node_idx: usize, window: usize) -> Vec<f32>
pub fn temporal_features(&self, node_idx: usize, window: usize) -> Vec<f32>
Last window temporal samples (left zero-padded).
Sourcepub fn fused_features(&self, node_idx: usize) -> Vec<f32>
pub fn fused_features(&self, node_idx: usize) -> Vec<f32>
Baseline fused feature: own + 1-hop mean-agg + last-16 temporal.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of nodes.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Number of edges.
Sourcepub fn feature_dim(&self) -> usize
pub fn feature_dim(&self) -> usize
Feature dimension of node 0 (0 if empty). Assumes homogeneous features.
Trait Implementations§
Source§impl Clone for SensorGraph
impl Clone for SensorGraph
Source§impl Debug for SensorGraph
impl Debug for SensorGraph
Auto Trait Implementations§
impl Freeze for SensorGraph
impl RefUnwindSafe for SensorGraph
impl Send for SensorGraph
impl Sync for SensorGraph
impl Unpin for SensorGraph
impl UnsafeUnpin for SensorGraph
impl UnwindSafe for SensorGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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> ⓘ
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> ⓘ
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