Nengo.ca

ca.nengo.model.neuron.impl
Class RateFunctionSpikeGenerator

java.lang.Object
  extended by ca.nengo.model.neuron.impl.RateFunctionSpikeGenerator
All Implemented Interfaces:
SpikeGenerator, Resettable, SimulationMode.ModeConfigurable, java.io.Serializable, java.lang.Cloneable

public class RateFunctionSpikeGenerator
extends java.lang.Object
implements SpikeGenerator

Rate Function Spike Generator This class generates spikes based on a user defined function. Initially, spikes should be generated without any sort of random distribution (eventually this may change) Modified version of LIFSpikeGenerator, original code taken from other SpikeGenerator classes.

See Also:
Serialized Form

Nested Class Summary
static class RateFunctionSpikeGenerator.PoiraziDendriteSigmoid
          Function from Poirazi et al.,2003
static class RateFunctionSpikeGenerator.PoiraziDendriteSigmoidFactory
          Spike generator using the rate function PoiraziDendriteSigmoid documented in Poirazi et al.,2003
 class RateFunctionSpikeGenerator.PoiraziSomaSigmoid
          Currently unused, but could act as a model of the soma
 
Constructor Summary
RateFunctionSpikeGenerator(Function rateFunction)
           
RateFunctionSpikeGenerator(Function rateFunction, boolean smooth)
           
 
Method Summary
 SpikeGenerator clone()
           
 SimulationMode getMode()
           
 Function getRateFunction()
           
 void reset(boolean randomize)
          useless method for current implementations
 InstantaneousOutput run(float[] time, float[] current)
          Runs the model for a given time segment.
 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 setRateFunction(Function function)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RateFunctionSpikeGenerator

public RateFunctionSpikeGenerator(Function rateFunction)
Parameters:
rateFunction - Maps input current to spiking rate

RateFunctionSpikeGenerator

public RateFunctionSpikeGenerator(Function rateFunction,
                                  boolean smooth)
Parameters:
rateFunction - Maps input current to spiking rate
smooth - Apply smoothing?
Method Detail

getRateFunction

public Function getRateFunction()
Returns:
Function that maps input current to spiking rate

setRateFunction

public void setRateFunction(Function function)
Parameters:
function - Function that maps input current to spiking rate

run

public InstantaneousOutput run(float[] time,
                               float[] current)
Description copied from interface: SpikeGenerator
Runs the model for a given time segment. The total time is meant to be short (eg 1/2ms), in that the output of the model is either a spike or no spike during this period of simulation time.

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.

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[])

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)

reset

public void reset(boolean randomize)
useless method for current implementations

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)

clone

public SpikeGenerator clone()
                     throws java.lang.CloneNotSupportedException
Specified by:
clone in interface SpikeGenerator
Overrides:
clone in class java.lang.Object
Returns:
Valid clone
Throws:
java.lang.CloneNotSupportedException - if clone can't be made

Nengo.ca