pub struct SynapseDescriptor {
pub source: NeuronId,
pub target: NeuronId,
pub weight: f32,
pub delay: DelayTicks,
pub polarity: Polarity,
}Expand description
A fully-described synaptic connection with weight, delay, and polarity.
Fields§
§source: NeuronIdSource neuron.
target: NeuronIdTarget neuron.
weight: f32Absolute synaptic weight (always ≥ 0; sign comes from polarity).
delay: DelayTicksAxonal propagation delay in ticks.
polarity: PolarityExcitatory or inhibitory.
Implementations§
Source§impl SynapseDescriptor
impl SynapseDescriptor
Sourcepub fn effective_weight(&self) -> f32
pub fn effective_weight(&self) -> f32
Effective signed weight: weight × polarity.sign().
weight is a non-negative magnitude. Invalid magnitudes are rejected
by crate::topology::SynapticGraph::from_descriptors and by
descriptor deserialization rather than being silently abs()-normalized
here.
§Panics
Panics if weight is negative, NaN, or infinite. Ordinary Rust struct
literals can still construct those values; this check runs in release
builds so a negative inhibitory magnitude cannot flip sign.
Trait Implementations§
Source§impl Clone for SynapseDescriptor
impl Clone for SynapseDescriptor
Source§fn clone(&self) -> SynapseDescriptor
fn clone(&self) -> SynapseDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SynapseDescriptor
Source§impl Debug for SynapseDescriptor
impl Debug for SynapseDescriptor
Source§impl<'de> Deserialize<'de> for SynapseDescriptor
impl<'de> Deserialize<'de> for SynapseDescriptor
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
Source§impl PartialEq for SynapseDescriptor
impl PartialEq for SynapseDescriptor
Source§impl Serialize for SynapseDescriptor
impl Serialize for SynapseDescriptor
impl StructuralPartialEq for SynapseDescriptor
Auto Trait Implementations§
impl Freeze for SynapseDescriptor
impl RefUnwindSafe for SynapseDescriptor
impl Send for SynapseDescriptor
impl Sync for SynapseDescriptor
impl Unpin for SynapseDescriptor
impl UnsafeUnpin for SynapseDescriptor
impl UnwindSafe for SynapseDescriptor
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