Nengo.ca

ca.nengo.model.neuron.impl
Class SpikingNeuron

java.lang.Object
  extended by ca.nengo.model.neuron.impl.SpikingNeuron
All Implemented Interfaces:
NEFNode, Neuron, Node, Probeable, Resettable, SimulationMode.ModeConfigurable, VisiblyMutable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ExpandableSpikingNeuron

public class SpikingNeuron
extends java.lang.Object
implements Neuron, Probeable, NEFNode

A neuron model composed of a SynapticIntegrator and a SpikeGenerator.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface ca.nengo.util.VisiblyMutable
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent, VisiblyMutable.NodeRemovedEvent
 
Nested classes/interfaces inherited from interface ca.nengo.util.VisiblyMutable
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent, VisiblyMutable.NodeRemovedEvent
 
Field Summary
static java.lang.String CURRENT
          Name of Origin representing unscaled and unbiased current entering the soma.
 
Fields inherited from interface ca.nengo.model.neuron.Neuron
AXON
 
Constructor Summary
SpikingNeuron(SynapticIntegrator integrator, SpikeGenerator generator, float scale, float bias, java.lang.String name)
          Note: current = scale * (weighted sum of inputs at each termination) * (radial input) + bias.
 
Method Summary
 void addChangeListener(VisiblyMutable.Listener listener)
           
 SpikingNeuron clone()
           
protected  void fireVisibleChangeEvent()
          Called by subclasses when properties have changed in such a way that the display of the ensemble may need updating.
 float getBias()
           
 Node[] getChildren()
           
 java.lang.String getDocumentation()
           
 SpikeGenerator getGenerator()
           
 TimeSeries getHistory(java.lang.String stateName)
          Available states include "I" (net current into SpikeGenerator) and the states of the SpikeGenerator.
 SynapticIntegrator getIntegrator()
           
 SimulationMode getMode()
           
 java.lang.String getName()
           
 Noise getNoise()
           
 Origin getOrigin(java.lang.String name)
           
 Origin[] getOrigins()
           
 float getScale()
           
 Termination getTermination(java.lang.String name)
           
 Termination[] getTerminations()
           
 java.util.Properties listStates()
           
 void removeChangeListener(VisiblyMutable.Listener listener)
           
 void reset(boolean randomize)
           
 void run(float startTime, float endTime)
          Runs the Node (including all its components), updating internal state and outputs as needed.
 void setBias(float bias)
           
 void setDocumentation(java.lang.String text)
           
 void setGenerator(SpikeGenerator generator)
           
 void setIntegrator(SynapticIntegrator integrator)
           
 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 setName(java.lang.String name)
           
 void setNoise(Noise noise)
           
 void setRadialInput(float value)
           
 void setScale(float scale)
           
 java.lang.String toScript(java.util.HashMap<java.lang.String,java.lang.Object> scriptData)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT

public static final java.lang.String CURRENT
Name of Origin representing unscaled and unbiased current entering the soma.

See Also:
Constant Field Values
Constructor Detail

SpikingNeuron

public SpikingNeuron(SynapticIntegrator integrator,
                     SpikeGenerator generator,
                     float scale,
                     float bias,
                     java.lang.String name)
Note: current = scale * (weighted sum of inputs at each termination) * (radial input) + bias.

Parameters:
integrator - SynapticIntegrator used to model dendritic/somatic integration of inputs to this Neuron
generator - SpikeGenerator used to model spike generation at the axon hillock of this Neuron
scale - A coefficient that scales summed input
bias - A bias current that models unaccounted-for inputs and/or intrinsic currents
name - A unique name for this neuron in the context of the Network or Ensemble to which it belongs
Method Detail

run

public void run(float startTime,
                float endTime)
         throws SimulationException
Description copied from interface: Node
Runs the Node (including all its components), updating internal state and outputs as needed. Runs should be short (eg 1ms), because inputs can not be changed during a run, and outputs will only be communicated to other Nodes after a run.

Specified by:
run in interface Node
Parameters:
startTime - simulation time at which running starts (s)
endTime - simulation time at which running ends (s)
Throws:
SimulationException - if a problem is encountered while trying to run
See Also:
Node.run(float, float)

getOrigins

public Origin[] getOrigins()
Specified by:
getOrigins in interface Node
Returns:
Sets of ouput channels (eg spiking outputs, gap junctional outputs, etc.)
See Also:
Node.getOrigins()

getOrigin

public Origin getOrigin(java.lang.String name)
                 throws StructuralException
Specified by:
getOrigin in interface Node
Parameters:
name - Name of an Origin on this Node
Returns:
The named Origin if it exists
Throws:
StructuralException - if the named Origin does not exist
See Also:
Node.getOrigin(java.lang.String)

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)

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()

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)

getHistory

public TimeSeries getHistory(java.lang.String stateName)
                      throws SimulationException
Available states include "I" (net current into SpikeGenerator) and the states of the SpikeGenerator.

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()

getName

public java.lang.String getName()
Specified by:
getName in interface Node
Returns:
Name of Node (must be unique in a Network)
See Also:
Node.getName()

setName

public void setName(java.lang.String name)
             throws StructuralException
Specified by:
setName in interface Node
Parameters:
name - The new name
Throws:
StructuralException - if name already exists?

getScale

public float getScale()
Returns:
The coefficient that scales summed input

setScale

public void setScale(float scale)
Parameters:
scale - New scaling coefficient

getBias

public float getBias()
Returns:
The bias current that models unaccounted-for inputs and/or intrinsic currents

setBias

public void setBias(float bias)
Parameters:
bias - New bias current

getIntegrator

public SynapticIntegrator getIntegrator()
Returns:
The SynapticIntegrator used to model dendritic/somatic integration of inputs to this Neuron

setIntegrator

public void setIntegrator(SynapticIntegrator integrator)
Parameters:
integrator - New synaptic integrator

getGenerator

public SpikeGenerator getGenerator()
Returns:
The SpikeGenerator used to model spike generation at the axon hillock of this Neuron

setGenerator

public void setGenerator(SpikeGenerator generator)
Parameters:
generator - New SpikeGenerator

getTerminations

public Termination[] getTerminations()
Specified by:
getTerminations in interface Node
Returns:
Sets of input channels (these have the same dimension as corresponding Origins to which they are connected).
See Also:
Node.getTerminations()

getTermination

public Termination getTermination(java.lang.String name)
                           throws StructuralException
Specified by:
getTermination in interface Node
Parameters:
name - Name of a Termination onto this Node
Returns:
The named Termination if it exists
Throws:
StructuralException - if the named Termination does not exist
See Also:
Node.getTermination(java.lang.String)

setRadialInput

public void setRadialInput(float value)
Specified by:
setRadialInput in interface NEFNode
Parameters:
value - Value of filtered summary input. This value is typically in the range [-1 1], and correponds to an inner product of vectors in the space represented by the NEFEnsemble to which this Node belongs.
See Also:
NEFNode.setRadialInput(float)

getDocumentation

public java.lang.String getDocumentation()
Specified by:
getDocumentation in interface Node
Returns:
User-specified documentation for the Node, if any
See Also:
Node.getDocumentation()

setDocumentation

public void setDocumentation(java.lang.String text)
Specified by:
setDocumentation in interface Node
Parameters:
text - New user-specified documentation for the Node
See Also:
Node.setDocumentation(java.lang.String)

addChangeListener

public void addChangeListener(VisiblyMutable.Listener listener)
Specified by:
addChangeListener in interface VisiblyMutable
Parameters:
listener - Listener to add
See Also:
VisiblyMutable.addChangeListener(ca.nengo.util.VisiblyMutable.Listener)

removeChangeListener

public void removeChangeListener(VisiblyMutable.Listener listener)
Specified by:
removeChangeListener in interface VisiblyMutable
Parameters:
listener - Listener to remove
See Also:
VisiblyMutable.removeChangeListener(ca.nengo.util.VisiblyMutable.Listener)

fireVisibleChangeEvent

protected void fireVisibleChangeEvent()
Called by subclasses when properties have changed in such a way that the display of the ensemble may need updating.


clone

public SpikingNeuron clone()
                    throws java.lang.CloneNotSupportedException
Specified by:
clone in interface Node
Overrides:
clone in class java.lang.Object
Returns:
An independent copy of the Node
Throws:
java.lang.CloneNotSupportedException - if clone can't be made

setNoise

public void setNoise(Noise noise)
Parameters:
noise - Noise object to apply to this neuron

getNoise

public Noise getNoise()
Returns:
Noise object applied to this neuron

getChildren

public Node[] getChildren()
Specified by:
getChildren in interface Node

toScript

public java.lang.String toScript(java.util.HashMap<java.lang.String,java.lang.Object> scriptData)
                          throws ScriptGenException
Specified by:
toScript in interface Node
Parameters:
scriptData - Map of class parent and prefix data for generating python script
Returns:
Python script for generating the node
Throws:
ScriptGenException - if the node cannot be generated in script

Nengo.ca