pub struct SpikeEvent {
pub neuron_id: usize,
pub timestamp: f64,
pub amplitude: f64,
pub spatial_coords: Vec<f64>,
}Expand description
Neuromorphic spike event
Represents a discrete spike occurring in a neuromorphic system. Each spike carries information about its source, timing, amplitude, and associated spatial coordinates.
§Fields
neuron_id: Unique identifier for the neuron that generated the spiketimestamp: Time of spike occurrence in simulation time unitsamplitude: Strength/amplitude of the spikespatial_coords: Spatial coordinates associated with the spike
§Example
use scirs2_spatial::neuromorphic::core::SpikeEvent;
let spike = SpikeEvent {
neuron_id: 42,
timestamp: 1000.5,
amplitude: 1.0,
spatial_coords: vec![0.5, 0.3, 0.8],
};
println!("Neuron {} spiked at time {}", spike.neuron_id, spike.timestamp);Fields§
§neuron_id: usizeSource neuron ID
timestamp: f64Spike timestamp (in simulation time units)
amplitude: f64Spike amplitude
spatial_coords: Vec<f64>Spatial coordinates associated with the spike
Implementations§
Source§impl SpikeEvent
impl SpikeEvent
Sourcepub fn new(
neuron_id: usize,
timestamp: f64,
amplitude: f64,
spatial_coords: Vec<f64>,
) -> Self
pub fn new( neuron_id: usize, timestamp: f64, amplitude: f64, spatial_coords: Vec<f64>, ) -> Self
Sourcepub fn spatial_coords(&self) -> &[f64]
pub fn spatial_coords(&self) -> &[f64]
Get the spatial coordinates associated with this spike
Sourcepub fn spatial_dims(&self) -> usize
pub fn spatial_dims(&self) -> usize
Get the number of spatial dimensions
Sourcepub fn temporal_distance(&self, other: &SpikeEvent) -> f64
pub fn temporal_distance(&self, other: &SpikeEvent) -> f64
Sourcepub fn spatial_distance(&self, other: &SpikeEvent) -> Option<f64>
pub fn spatial_distance(&self, other: &SpikeEvent) -> Option<f64>
Sourcepub fn is_before(&self, other: &SpikeEvent) -> bool
pub fn is_before(&self, other: &SpikeEvent) -> bool
Sourcepub fn is_after(&self, other: &SpikeEvent) -> bool
pub fn is_after(&self, other: &SpikeEvent) -> bool
Sourcepub fn same_neuron(&self, other: &SpikeEvent) -> bool
pub fn same_neuron(&self, other: &SpikeEvent) -> bool
Trait Implementations§
Source§impl Clone for SpikeEvent
impl Clone for SpikeEvent
Source§fn clone(&self) -> SpikeEvent
fn clone(&self) -> SpikeEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpikeEvent
impl Debug for SpikeEvent
Source§impl PartialEq for SpikeEvent
impl PartialEq for SpikeEvent
Auto Trait Implementations§
impl Freeze for SpikeEvent
impl RefUnwindSafe for SpikeEvent
impl Send for SpikeEvent
impl Sync for SpikeEvent
impl Unpin for SpikeEvent
impl UnwindSafe for SpikeEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.