public class LIFSpikeGenerator extends java.lang.Object implements SpikeGenerator, Probeable
A leaky-integrate-and-fire model of spike generation. From Koch, 1999, the subthreshold model is: C dV(t)/dt + V(t)/R = I(t). When V reaches a threshold, a spike occurs (spike-related currents are not modelled).
For simplicity we take Vth = R = 1, which does not limit the behaviour of the model, although transformations may be needed if it is desired to convert to more realistic parameter ranges.
Modifier and Type | Class and Description |
---|---|
static class |
LIFSpikeGenerator.Factory
Creates LIFSpikeGenerators.
|
Constructor and Description |
---|
LIFSpikeGenerator()
Uses default values.
|
LIFSpikeGenerator(float maxTimeStep,
float tauRC,
float tauRef) |
LIFSpikeGenerator(float maxTimeStep,
float tauRC,
float tauRef,
float initialVoltage) |
Modifier and Type | Method and Description |
---|---|
SpikeGenerator |
clone() |
float |
constantRateRun(float current) |
TimeSeries |
getHistory(java.lang.String stateName)
Note that the units of TimeSeries' for a given state do not change over time (ie at different
time steps).
|
float |
getMaxTimeStep() |
SimulationMode |
getMode() |
float |
getTauRC() |
float |
getTauRef() |
float |
getVoltage() |
java.util.Properties |
listStates() |
void |
reset(boolean randomize) |
InstantaneousOutput |
run(float[] time,
float[] current)
Runs the model for a given time segment.
|
void |
setMaxTimeStep(float max) |
void |
setMode(SimulationMode mode)
Sets the object to run in either the given mode or the closest mode that it supports
(all ModeConfigurables must support SimulationMode.DEFAULT, and must default to this mode).
|
void |
setTauRC(float tauRC) |
void |
setTauRef(float tauRef) |
public LIFSpikeGenerator()
public LIFSpikeGenerator(float maxTimeStep, float tauRC, float tauRef)
maxTimeStep
- maximum integration time step (s). Shorter time steps may be used if a
run(...) is requested with a length that is not an integer multiple of this value.tauRC
- resistive-capacitive time constant (s)tauRef
- refracory period (s)public LIFSpikeGenerator(float maxTimeStep, float tauRC, float tauRef, float initialVoltage)
maxTimeStep
- Maximum integration time step (s). Shorter time steps may be used if a
run(...) is requested with a length that is not an integer multiple of this value.tauRC
- Resistive-capacitive time constant (s)tauRef
- Refracory period (s)initialVoltage
- Initial condition on Vpublic float getMaxTimeStep()
public void setMaxTimeStep(float max)
max
- Maximum integration time step (s).public float getTauRC()
public void setTauRC(float tauRC)
tauRC
- Resistive-capacitive time constant (s)public float getTauRef()
public void setTauRef(float tauRef)
tauRef
- Refracory period (s)public void reset(boolean randomize)
reset
in interface Resettable
randomize
- True indicates that the object should be reset to a
randomly selected initial state (the object must be aware of the
distribution from which to draw from). False indicates that the
object should be reset to a fixed initial state (which it must
also know). Some objects may not support randomization of the initial
state, in which case a fixed state will be used in either case.public InstantaneousOutput run(float[] time, float[] current)
SpikeGenerator
The model is responsible for maintaining its internal state, and the state is assumed to be consistent with the start time. That is, if a caller calls run({.001 .002}, ...) and then run({.501 .502}, ...), the results may not make any sense, but this is not the model's responsibility. Absolute times are provided to support explicitly time-varying models, and for the convenience of Probeable models.
run
in interface SpikeGenerator
time
- Array of points in time at which input current is defined. This includes
at least the start and end times, and possibly intermediate times. (The SpikeGenerator
model can use its own time step -- these times are only used to define the input.)current
- Driving current at each given point in time (assumed to be constant
until next time point)SpikeGenerator.run(float[], float[])
public float getVoltage()
public float constantRateRun(float current)
current
- Given currentpublic TimeSeries getHistory(java.lang.String stateName) throws SimulationException
Probeable
getHistory
in interface Probeable
stateName
- A state variable nameSimulationException
- if the Probeable does not have the requested stateProbeable.getHistory(String)
public java.util.Properties listStates()
listStates
in interface Probeable
Probeable.listStates()
public SimulationMode getMode()
getMode
in interface SimulationMode.ModeConfigurable
SimulationMode.ModeConfigurable.getMode()
public void setMode(SimulationMode mode)
SimulationMode.ModeConfigurable
setMode
in interface SimulationMode.ModeConfigurable
mode
- SimulationMode in which it is desired that the object runs.SimulationMode.ModeConfigurable.setMode(ca.nengo.model.SimulationMode)
public SpikeGenerator clone() throws java.lang.CloneNotSupportedException
clone
in interface SpikeGenerator
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if clone can't be made