nemo::Simulation Class Reference

Simulation of a single network. More...

Inherits nemo::ReadableNetwork.

Public Member Functions

virtual const firing_output & step ()=0
virtual const firing_output & step (const firing_stimulus &fstim)=0
virtual const firing_output & step (const current_stimulus &istim)=0
virtual const firing_output & step (const firing_stimulus &fstim, const current_stimulus &istim)=0
Modifying the network

Neuron parameters and state variables can be modified during simulation. However, synapses can not be modified during simulation in the current version of NeMo

virtual void setNeuron (unsigned idx, unsigned nargs, const float args[])=0
void setNeuron (unsigned idx, float a, float b, float c, float d, float u, float v, float sigma)
virtual void setNeuronState (unsigned neuron, unsigned var, float value)=0
virtual void setNeuronParameter (unsigned neuron, unsigned parameter, float value)=0
virtual void applyStdp (float reward)=0
Queries

Neuron and synapse state is availble at run-time.

The synapse state can be read back at run-time by specifiying a list of synpase ids (see addSynapse). The weights may change at run-time, while the other synapse data is static.

virtual float getNeuronState (unsigned neuron, unsigned var) const =0
virtual float getNeuronParameter (unsigned neuron, unsigned parameter) const =0
virtual float getMembranePotential (unsigned neuron) const =0
virtual const std::vector
< synapse_id > & 
getSynapsesFrom (unsigned neuron)=0
Simulation (timing)

The simulation has two internal timers which keep track of the elapsed simulated time and wallclock time. Both timers measure from the first simulation step, or from the last timer reset, whichever comes last.

virtual unsigned long elapsedWallclock () const =0
virtual unsigned long elapsedSimulation () const =0
virtual void resetTimer ()=0

Detailed Description

Simulation of a single network.

Concrete instances are created using the nemo::simulation factory function.

Internal errors are signaled by exceptions. Thrown exceptions are all of the type nemo::exception which in turn subclass std::exception.


Member Function Documentation

virtual const firing_output& nemo::Simulation::step (  )  [pure virtual]

Run simulation for a single cycle (1ms) without external stimulus

virtual const firing_output& nemo::Simulation::step ( const firing_stimulus &  fstim  )  [pure virtual]

Run simulation for a single cycle (1ms) with firing stimulus

Parameters:
fstim An list of neurons, which will be forced to fire this cycle.
Returns:
List of neurons which fired this cycle. The referenced data is valid until the next call to step.
virtual const firing_output& nemo::Simulation::step ( const current_stimulus &  istim  )  [pure virtual]

Run simulation for a single cycle (1ms) with current stimulus

Parameters:
istim Optional per-neuron vector specifying externally provided input current for this cycle.
Returns:
List of neurons which fired this cycle. The referenced data is valid until the next call to step.
virtual const firing_output& nemo::Simulation::step ( const firing_stimulus &  fstim,
const current_stimulus &  istim 
) [pure virtual]

Run simulation for a single cycle (1ms) with both firing stimulus and current stimulus

Parameters:
fstim An list of neurons, which will be forced to fire this cycle.
istim Optional per-neuron vector specifying externally provided input current for this cycle.
Returns:
List of neurons which fired this cycle. The referenced data is valid until the next call to step.
virtual void nemo::Simulation::setNeuron ( unsigned  idx,
unsigned  nargs,
const float  args[] 
) [pure virtual]

Set an existing neuron

Parameters:
idx neuron index
nargs number of parameters and state variables
args parameters and state variables (in that order) of the neuron
Precondition:
The parameter and state array must have the dimensions matching the neuron type specified when the neuron was first added.
void nemo::Simulation::setNeuron ( unsigned  idx,
float  a,
float  b,
float  c,
float  d,
float  u,
float  v,
float  sigma 
)

Change an existing Izhikevich neuron.

See also:
nemo::Network::addNeuron for parameters
virtual void nemo::Simulation::setNeuronState ( unsigned  neuron,
unsigned  var,
float  value 
) [pure virtual]

Change a single state variable for an existing neuron

Parameters:
neuron neuron index
var state variable index
value new value of the state variable

For the Izhikevich model variable indices 0=u, 1=v.

virtual void nemo::Simulation::setNeuronParameter ( unsigned  neuron,
unsigned  parameter,
float  value 
) [pure virtual]

Change a single parameter for an existing neuron

Parameters:
neuron neuron index
parameter parameter index
value new value of the state variable

For the Izhikevich model the parameter indices are 0=a, 1=b, 2=c, 3=d, 4=sigma.

virtual void nemo::Simulation::applyStdp ( float  reward  )  [pure virtual]

Update synapse weights using the accumulated STDP statistics

Parameters:
reward Multiplier for the accumulated weight change
virtual float nemo::Simulation::getNeuronState ( unsigned  neuron,
unsigned  var 
) const [pure virtual]

Get a single state variable for a single neuron

Parameters:
neuron neuron index
var variable index
Returns:
state variable with index var.

For the Izhikevich model the variable indices are 0=u, 1=v.

virtual float nemo::Simulation::getNeuronParameter ( unsigned  neuron,
unsigned  parameter 
) const [pure virtual]

Get a single parameter for a single neuron

Parameters:
neuron neuron index
parameter parameter index
Returns:
parameter with index parameter.

For the Izhikevich model the parameter indices are 0=a, 1=b, 2=c, 3=d, 4=sigma.

virtual float nemo::Simulation::getMembranePotential ( unsigned  neuron  )  const [pure virtual]
Returns:
membrane potential of the specified neuron
virtual const std::vector<synapse_id>& nemo::Simulation::getSynapsesFrom ( unsigned  neuron  )  [pure virtual]

Returns:
vector of synapse ids for all synapses with the given source neuron

The vector reference is valid until the next call to this function.

Implements nemo::ReadableNetwork.

virtual unsigned long nemo::Simulation::elapsedWallclock (  )  const [pure virtual]
Returns:
number of milliseconds of wall-clock time elapsed since first simulation step (or last timer reset).
virtual unsigned long nemo::Simulation::elapsedSimulation (  )  const [pure virtual]
Returns:
number of milliseconds of simulated time elapsed since first simulation step (or last timer reset)
virtual void nemo::Simulation::resetTimer (  )  [pure virtual]

Reset both wall-clock and simulation timer

Generated on Mon Aug 15 11:38:40 2011 for NeMo by  doxygen 1.6.3