superneuromat.SNN.add_spike#
- SNN.add_spike(time: int, neuron_id: int | Neuron, value: float = 1.0, exist: str = 'error') None [source]#
Adds an external spike in the SNN
- Parameters:
time (int) – The time step at which the external spike is added
neuron_id (Neuron | int) – The neuron for which the external spike is added
value (float) – The value of the external spike (default: 1.0)
exist (str) –
action for existing spikes on a neuron at a given time step. Should be one of [‘error’, ‘overwrite’, ‘add’, ‘dontadd’]. (default: ‘error’)
if exist=’add’, the existing spike value is added to the new value.
- Raises:
if:
time cannot be precisely cast to int
neuron_id is not a Neuron or neuron ID (int)
value is not an int or float
ValueError – if spike already exists at that neuron and timestep and exist=’error’, or if exist is an invalid setting.
See also