ca.nengo.model.neuron.impl
Class DynamicalSystemSpikeGenerator

java.lang.Object
  extended by ca.nengo.model.neuron.impl.DynamicalSystemSpikeGenerator
All Implemented Interfaces:
SpikeGenerator, Probeable, Resettable, SimulationMode.ModeConfigurable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
HodgkinHuxleySpikeGenerator

public class DynamicalSystemSpikeGenerator
extends java.lang.Object
implements SpikeGenerator, Probeable

A SpikeGenerator for which spiking dynamics are expressed in terms of a DynamicalSystem.

Author:
Bryan Tripp
See Also:
Serialized Form

Field Summary
static java.lang.String DYNAMICS
           
 
Constructor Summary
DynamicalSystemSpikeGenerator()
          Uses default parameters to allow later configuration.
DynamicalSystemSpikeGenerator(DynamicalSystem dynamics, Integrator integrator, int voltageDim, float spikeThreshold, float minIntraSpikeTime)
           
DynamicalSystemSpikeGenerator(DynamicalSystem dynamics, Integrator integrator, int voltageDim, float spikeThreshold, float minIntraSpikeTime, float[] currentRange, float transientTime)
          Creates a SpikeGenerator that supports CONSTANT_RATE mode.
 
Method Summary
 SpikeGenerator clone()
           
 boolean getConstantRateModeSupported()
           
 float[] getCurrentRange()
           
 DynamicalSystem getDynamics()
           
 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).
 Integrator getIntegrator()
           
 float getMinIntraSpikeTime()
           
 SimulationMode getMode()
           
 float getSpikeThreshold()
           
 float getTransientTime()
           
 int getVoltageDim()
           
 java.util.Properties listStates()
           
 void reset(boolean randomize)
           
 InstantaneousOutput run(float[] time, float[] current)
          Runs the spike generation dynamics and returns a spike if membrane potential rises above spike threshold.
 void setCurrentRange(float[] range)
           
 void setDynamics(DynamicalSystem dynamics)
           
 void setIntegrator(Integrator integrator)
           
 void setMinIntraSpikeTime(float min)
           
 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 setSpikeThreshold(float threshold)
           
 void setTransientTime(float transientTime)
           
 void setVoltageDim(int dim)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DYNAMICS

public static final java.lang.String DYNAMICS
See Also:
Constant Field Values
Constructor Detail

DynamicalSystemSpikeGenerator

public DynamicalSystemSpikeGenerator(DynamicalSystem dynamics,
                                     Integrator integrator,
                                     int voltageDim,
                                     float spikeThreshold,
                                     float minIntraSpikeTime)
Parameters:
dynamics - A DynamicalSystem that defines the dynamics of spike generation.
integrator - An integrator with which to simulate the DynamicalSystem
voltageDim - Dimension of output that corresponds to membrane potential
spikeThreshold - Threshold membrane potential at which a spike is considered to have occurred
minIntraSpikeTime - Minimum time between spike onsets. If there appears to be a spike onset at the beginning of a timestep, this value is used to determine whether this is just the continuation of a spike onset that was already registered in the last timestep

DynamicalSystemSpikeGenerator

public DynamicalSystemSpikeGenerator(DynamicalSystem dynamics,
                                     Integrator integrator,
                                     int voltageDim,
                                     float spikeThreshold,
                                     float minIntraSpikeTime,
                                     float[] currentRange,
                                     float transientTime)
Creates a SpikeGenerator that supports CONSTANT_RATE mode. The rate for a given driving current is estimated by interpolating steady-state spike counts for simulations with different driving currents (given in the currents arg).

Parameters:
dynamics - A DynamicalSystem that defines the dynamics of spike generation.
integrator - An integrator with which to simulate the DynamicalSystem
voltageDim - Dimension of output that corresponds to membrane potential
spikeThreshold - Threshold membrane potential at which a spike is considered to have occurred
minIntraSpikeTime - Minimum time between spike onsets. If there appears to be a spike onset at the beginning of a timestep, this value is used to determine whether this is just the continuation of a spike onset that was already registered in the last timestep
currentRange - Range of driving currents at which to simulate to find steady-state firing rates for CONSTANT_RATE mode
transientTime - Simulation time to ignore before counting spikes when finding steady-state rates

DynamicalSystemSpikeGenerator

public DynamicalSystemSpikeGenerator()
Uses default parameters to allow later configuration.

Method Detail

getDynamics

public DynamicalSystem getDynamics()
Returns:
A DynamicalSystem that defines the dynamics of spike generation.

setDynamics

public void setDynamics(DynamicalSystem dynamics)
Parameters:
dynamics - A DynamicalSystem that defines the dynamics of spike generation.

getIntegrator

public Integrator getIntegrator()
Returns:
An integrator with which to simulate the DynamicalSystem

setIntegrator

public void setIntegrator(Integrator integrator)
Parameters:
integrator - An integrator with which to simulate the DynamicalSystem

getVoltageDim

public int getVoltageDim()
Returns:
Dimension of output that corresponds to membrane potential

setVoltageDim

public void setVoltageDim(int dim)
Parameters:
dim - Dimension of output that corresponds to membrane potential

getSpikeThreshold

public float getSpikeThreshold()
Returns:
Threshold membrane potential at which a spike is considered to have occurred

setSpikeThreshold

public void setSpikeThreshold(float threshold)
Parameters:
threshold - Threshold membrane potential at which a spike is considered to have occurred

getMinIntraSpikeTime

public float getMinIntraSpikeTime()
Returns:
Minimum time between spike onsets. If there appears to be a spike onset at the beginning of a timestep, this value is used to determine whether this is just the continuation of a spike onset that was already registered in the last timestep

setMinIntraSpikeTime

public void setMinIntraSpikeTime(float min)
Parameters:
min - Minimum time between spike onsets.

getCurrentRange

public float[] getCurrentRange()
Returns:
Range of driving currents at which to simulate to find steady-state firing rates for CONSTANT_RATE mode

setCurrentRange

public void setCurrentRange(float[] range)
Parameters:
range - Range of driving currents at which to simulate to find steady-state firing rates for CONSTANT_RATE mode

getTransientTime

public float getTransientTime()
Returns:
Simulation time to ignore before counting spikes when finding steady-state rates

setTransientTime

public void setTransientTime(float transientTime)
Parameters:
transientTime -

getConstantRateModeSupported

public boolean getConstantRateModeSupported()
Returns:
True if this SpikeGenerator supports CONSTANT_RATE simulation mode

run

public InstantaneousOutput run(float[] time,
                               float[] current)
Runs the spike generation dynamics and returns a spike if membrane potential rises above spike threshold.

Specified by:
run in interface SpikeGenerator
Parameters:
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)
Returns:
true If there is a spike between the first and last times, false otherwise
See Also:
SpikeGenerator.run(float[], float[])

reset

public void reset(boolean randomize)
Specified by:
reset in interface Resettable
Parameters:
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.
See Also:
Resettable.reset(boolean)

getMode

public SimulationMode getMode()
Specified by:
getMode in interface SimulationMode.ModeConfigurable
Returns:
The SimulationMode in which the object is running
See Also:
SimulationMode.ModeConfigurable.getMode()

setMode

public void setMode(SimulationMode mode)
Description copied from interface: SimulationMode.ModeConfigurable
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).

Specified by:
setMode in interface SimulationMode.ModeConfigurable
Parameters:
mode - SimulationMode in which it is desired that the object runs.
See Also:
SimulationMode.ModeConfigurable.setMode(ca.nengo.model.SimulationMode)

getHistory

public TimeSeries getHistory(java.lang.String stateName)
                      throws SimulationException
Description copied from interface: Probeable
Note that the units of TimeSeries' for a given state do not change over time (ie at different time steps). CAUTION: The TimeSeries should not contain a reference to any arrays that you are going to change later. The caller owns what you return.

Specified by:
getHistory in interface Probeable
Parameters:
stateName - A state variable name
Returns:
History of values for the named state variable. The history must cover the most recent network time step, and no more. There should be no overlap in the time points returned for different steps.
Throws:
SimulationException - if the Probeable does not have the requested state
See Also:
Probeable.getHistory(java.lang.String)

listStates

public java.util.Properties listStates()
Specified by:
listStates in interface Probeable
Returns:
List of state variable names, eg "V", and associated descriptions eg "membrane potential (mV)"
See Also:
Probeable.listStates()

clone

public SpikeGenerator clone()
                     throws java.lang.CloneNotSupportedException
Specified by:
clone in interface SpikeGenerator
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException