pub struct RouterConfig {
pub channel_count: usize,
pub self_weight: f32,
pub cross_weight: f32,
pub threshold: f32,
pub leak: f32,
pub routing_timesteps: usize,
pub min_fire_rate: f32,
pub plasticity_decay: f32,
pub plasticity_potentiate: f32,
pub plasticity_speed: f32,
pub fatigue_accumulation: f32,
pub fatigue_recovery: f32,
}Expand description
Configuration for a generic channel router.
Direct struct literals can hold out-of-range values; they are rejected by
RouterConfig::validate, ChannelRouter::try_with_config, and by
deserialization of both this type and ChannelRouter.
§Valid ranges
| Field | Constraint |
|---|---|
channel_count | 1..=MAX_ROUTER_CHANNELS |
routing_timesteps | 1..=MAX_ROUTING_TIMESTEPS |
self_weight, cross_weight, threshold | finite; signed weights are allowed |
leak, min_fire_rate, plasticity_decay, plasticity_speed, fatigue_accumulation, fatigue_recovery | finite, in 0.0..=1.0 |
plasticity_potentiate | finite, >= 0 (scale factor, not a probability) |
cross_weight is typically negative (lateral inhibition). That sign is
allowed and intended; it is not required. Positive self-weights are the
usual self-affinity pattern, but a signed self-weight is also accepted.
Fields§
§channel_count: usizeNumber of input/output channels (1..=MAX_ROUTER_CHANNELS).
self_weight: f32Self-affinity weight (diagonal of the dense channel matrix).
Must be finite. Signed values are allowed.
cross_weight: f32Cross-channel weight (off-diagonal).
Must be finite. Signed values are allowed; negative values are the intended lateral-inhibition pattern and are not rejected.
threshold: f32Firing threshold for neuromodulatory neurons.
Must be finite. Typically positive; zero and negative values are accepted here (modulated routing later clamps the effective threshold).
leak: f32Passive leak rate per timestep.
Fraction of (V − V_rest) removed each tick. Valid range: 0.0..=1.0.
0.0 = no leak; 1.0 = membrane snaps to rest in one tick.
routing_timesteps: usizeIntegration timesteps per routing decision.
Must be in 1..=MAX_ROUTING_TIMESTEPS. More timesteps → more
stable firing-rate estimates.
min_fire_rate: f32Minimum firing rate to activate a channel.
Fraction of routing_timesteps that must spike. Valid range: 0.0..=1.0.
plasticity_decay: f32Weight decay rate for inactive channels (use-it-or-lose-it).
Mix toward baseline: current + (baseline − current) * decay.
Valid range: 0.0..=1.0.
plasticity_potentiate: f32Weight potentiation rate for active channels (dopamine-gated).
Non-negative finite scale factor, not a probability. The amplified
target is baseline * (1 + potentiate * (1 + dopamine)).
plasticity_speed: f32Smoothing factor for active-channel weight potentiation
(0.0 = no change, 1.0 = snap to amplified target). Tunable so
callers can trade off adaptation speed vs. numerical stability.
Valid range: 0.0..=1.0.
fatigue_accumulation: f32Fatigue accumulation per activation.
Added to per-channel fatigue (itself in 0.0..=1.0). Valid range:
0.0..=1.0.
fatigue_recovery: f32Fatigue recovery per idle routing decision.
Subtracted from per-channel fatigue. Valid range: 0.0..=1.0.
Implementations§
Source§impl RouterConfig
impl RouterConfig
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Check that every field is in its documented range.
This is the single validation path used by
ChannelRouter::try_with_config, ChannelRouter::with_config,
and by Deserialize for both RouterConfig and ChannelRouter.
It does not allocate.
Trait Implementations§
Source§impl Clone for RouterConfig
impl Clone for RouterConfig
Source§fn clone(&self) -> RouterConfig
fn clone(&self) -> RouterConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more