Table of Contents

Interface ISpikingBackend

Namespace
DotFly.Core.Backends
Assembly
DotFly.Core.dll

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

Brain

Constants

Per-step constants in use.

LifStepConstants Constants { get; }

Property Value

LifStepConstants

ExternalInput

Global switch: when false, Poisson inputs and scheduled injections are ignored.

bool ExternalInput { get; set; }

Property Value

bool

NeuronCount

Number of neurons.

int NeuronCount { get; }

Property Value

int

RecurrentTransmission

Global switch: when false, no spike is delivered to any target (recurrent transmission off).

bool RecurrentTransmission { get; set; }

Property Value

bool

Seed

Random seed used for stochastic inputs.

ulong Seed { get; }

Property Value

ulong

Step

Number of steps completed since the last Reset().

long Step { get; }

Property Value

long

Methods

Advance(int, ISpikeSink?)

Advances the network by steps steps, reporting spikes to sink (may be null).

void Advance(int steps, ISpikeSink? sink)

Parameters

steps int
sink ISpikeSink

GetG(int)

Synaptic variable of a neuron in mV (diagnostic).

double GetG(int neuron)

Parameters

neuron int

Returns

double

GetV(int)

Membrane potential of a neuron in mV (diagnostic; not for hot paths).

double GetV(int neuron)

Parameters

neuron int

Returns

double

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

seed ulong

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

state ReadOnlySpan<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

step long
neuron int
mv double

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

neuron int
mvPerStep double

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

neuron int
probabilityPerStep double

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

neuron int
steps int

SetTransmits(int, bool)

Whether a neuron transmits to its targets (false = Shiu-style silencing: outgoing weights zeroed).

void SetTransmits(int neuron, bool transmits)

Parameters

neuron int
transmits bool