Interface ISpikingBackend
The kernel-level contract of a simulation backend: owns the state of one network instance, advances it in fixed steps, and exposes the per-neuron controls the engine layer builds on. Everything here is index-based and allocation-free on the step path.
public interface ISpikingBackend : IDisposable
- Inherited Members
Properties
Brain
The graph being simulated.
Brain Brain { get; }
Property Value
Constants
Per-step constants in use.
LifStepConstants Constants { get; }
Property Value
ExternalInput
Global switch: when false, Poisson inputs and scheduled injections are ignored.
bool ExternalInput { get; set; }
Property Value
NeuronCount
Number of neurons.
int NeuronCount { get; }
Property Value
RecurrentTransmission
Global switch: when false, no spike is delivered to any target (recurrent transmission off).
bool RecurrentTransmission { get; set; }
Property Value
Seed
Random seed used for stochastic inputs.
ulong Seed { get; }
Property Value
Step
Number of steps completed since the last Reset().
long Step { get; }
Property Value
Methods
Advance(int, ISpikeSink?)
Advances the network by steps steps, reporting spikes to sink (may be null).
void Advance(int steps, ISpikeSink? sink)
Parameters
stepsintsinkISpikeSink
GetG(int)
Synaptic variable of a neuron in mV (diagnostic).
double GetG(int neuron)
Parameters
neuronint
Returns
GetV(int)
Membrane potential of a neuron in mV (diagnostic; not for hot paths).
double GetV(int neuron)
Parameters
neuronint
Returns
Reset()
Resets all state (v, g, refractory counters, pending spikes and injections) and the step counter; controls (rates, masks) are kept.
void Reset()
Reset(ulong)
Resets all state like Reset() and changes the seed, so the next run draws a different Poisson stream.
void Reset(ulong seed)
Parameters
seedulong
RestoreState(ReadOnlySpan<byte>)
Restores a state produced by SaveState() on a backend of the same checkpoint and constants. Pending scheduled injections are cleared.
void RestoreState(ReadOnlySpan<byte> state)
Parameters
stateReadOnlySpan<byte>
SaveState()
Serialises the complete dynamic state (v, g, refractory, pending spikes, RNG counters, step) so that RestoreState(ReadOnlySpan<byte>) continues bit-identically. Controls are not included.
byte[] SaveState()
Returns
- byte[]
ScheduleInjection(long, int, double)
Schedules an external voltage injection mv on neuron
at absolute step (≥ current step); applied in the delivery phase of that step.
void ScheduleInjection(long step, int neuron, double mv)
Parameters
SetCurrent(int, double)
Sets a constant depolarising current for a neuron: mvPerStep is added to
v every step (0 disables), in the delivery phase, discarded while refractory like any input.
void SetCurrent(int neuron, double mvPerStep)
Parameters
SetPoissonProbability(int, double)
Sets the per-step probability of a Poisson event on a neuron (0 disables). Each event
adds PoissonWeightMv to v after delivery and
before reset, matching Brian2's PoissonInput(target_var='v').
void SetPoissonProbability(int neuron, double probabilityPerStep)
Parameters
SetRefractorySteps(int, int)
Sets the refractory duration of one neuron in steps. Shiu et al. set it to 0 for Poisson-stimulated neurons.
void SetRefractorySteps(int neuron, int steps)
Parameters
SetTransmits(int, bool)
Whether a neuron transmits to its targets (false = Shiu-style silencing: outgoing weights zeroed).
void SetTransmits(int neuron, bool transmits)