Nengo.ca

ca.nengo.sim
Interface Simulator

All Superinterfaces:
java.lang.Cloneable, VisiblyMutable
All Known Implementing Classes:
LocalSimulator

public interface Simulator
extends VisiblyMutable, java.lang.Cloneable

Runs simulations of a Network.


Nested Class Summary
 
Nested classes/interfaces inherited from interface ca.nengo.util.VisiblyMutable
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent, VisiblyMutable.NodeRemovedEvent
 
Method Summary
 Probe addProbe(java.lang.String ensembleName, int neuronIndex, java.lang.String state, boolean record)
           
 Probe addProbe(java.lang.String ensembleName, Probeable target, java.lang.String state, boolean record)
           
 Probe addProbe(java.lang.String nodeName, java.lang.String state, boolean record)
           
 void addSimulatorListener(SimulatorListener listener)
           
 Simulator clone()
           
 Probe[] getProbes()
           
 void initialize(Network network)
          Initializes the Simulator with a given Network, after which changes to the Network MAY OR MAY NOT BE IGNORED.
 void removeProbe(Probe probe)
           
 void removeSimulatorListener(SimulatorListener listener)
           
 void resetNetwork(boolean randomize, boolean saveWeights)
          Resets all Nodes in the simulated Network.
 void resetProbes()
          Resets all probes in the network, recursively including subnetworks.
 void run(float startTime, float endTime, float stepSize)
          Runs the Network for the given time range.
 void run(float startTime, float endTime, float stepSize, boolean topLevel)
          Runs the Network for the given time range.
 
Methods inherited from interface ca.nengo.util.VisiblyMutable
addChangeListener, removeChangeListener
 

Method Detail

initialize

void initialize(Network network)
Initializes the Simulator with a given Network, after which changes to the Network MAY OR MAY NOT BE IGNORED. This is because the Simulator is free to either run the given Neurons/Ensembles, or to make copies of them and run the copies. (The latter is likely in a clustered implementation.) If you make changes to the Network after initializing a Simulator with it, initialize again. If you want the Network to change somehow mid-simulation (e.g. you want to remove some neurons from an Ensemble to test robustness), these changes should be performed by the Ensembles or Neurons themselves, i.e. they should be an explicit part of the model.

Parameters:
network - Network to set up for simulation

resetNetwork

void resetNetwork(boolean randomize,
                  boolean saveWeights)
Resets all Nodes in the simulated Network.

Parameters:
randomize - True indicates reset to random initial condition (see Resettable.reset(boolean)).
saveWeights - True indicates that the weights on LinearExponentialTerminations should be saved rather than reset

addProbe

Probe addProbe(java.lang.String nodeName,
               java.lang.String state,
               boolean record)
               throws SimulationException
Parameters:
nodeName - Name of a Probeable Node from which state is to be probed
state - The name of the state variable to probe
record - Probe retains history if true
Returns:
A Probe connected to the specified Node
Throws:
SimulationException - if the referenced Node can not be found, or is not Probeable, or does not have the specified state variable

addProbe

Probe addProbe(java.lang.String ensembleName,
               int neuronIndex,
               java.lang.String state,
               boolean record)
               throws SimulationException
Parameters:
ensembleName - Name of Ensemble containing a Probeable Neuron from which state is to be probed
neuronIndex - Index of the Neuron (from 0) within the specified Ensemble
state - The name of the state variable to probe
record - Probe retains history if true
Returns:
A Probe connected to the specified Neuron
Throws:
SimulationException - if the referenced Neuron can not be found, or is not Probeable, or does not have the specified state variable

addProbe

Probe addProbe(java.lang.String ensembleName,
               Probeable target,
               java.lang.String state,
               boolean record)
               throws SimulationException
Parameters:
ensembleName - Name of Ensemble the target belongs to. Null, if the target is a top-level node
target - Probeable target
state - The name of the state variable to probe
record - Probe retains history if true
Returns:
A Probe connected to the specified Neuron
Throws:
SimulationException - if the referenced Neuron can not be found, or is not Probeable, or does not have the specified state variable

removeProbe

void removeProbe(Probe probe)
                 throws SimulationException
Parameters:
probe - Probe to be removed
Throws:
SimulationException - if the referenced probe cannot be removed

resetProbes

void resetProbes()
Resets all probes in the network, recursively including subnetworks.


run

void run(float startTime,
         float endTime,
         float stepSize)
         throws SimulationException
Runs the Network for the given time range. The states of all components of the Network are assumed to be consistent with the given start time. So, you could reset to the t=0 state, and then immediately start running from t=100, but the results may not make sense.

Parameters:
startTime - Simulation time at which running starts
endTime - Simulation time at which running stops
stepSize - Length of time step at which the Network is run. This determines the frequency with which outputs are passed between Ensembles, but individual Neurons may run with different and/or variable time steps.
Throws:
SimulationException - if a problem is encountered while trying to run

run

void run(float startTime,
         float endTime,
         float stepSize,
         boolean topLevel)
         throws SimulationException
Runs the Network for the given time range. The states of all components of the Network are assumed to be consistent with the given start time. So, you could reset to the t=0 state, and then immediately start running from t=100, but the results may not make sense.

Parameters:
startTime - Simulation time at which running starts
endTime - Simulation time at which running stops
stepSize - Length of time step at which the Network is run. This determines the frequency with which outputs are passed between Ensembles, but individual Neurons may run with different and/or variable time steps.
topLevel - true if the network being run is the top level network, false if it is a subnetwork
Throws:
SimulationException - if a problem is encountered while trying to run

getProbes

Probe[] getProbes()
Returns:
List of Probes that have been added to this Simulator.

addSimulatorListener

void addSimulatorListener(SimulatorListener listener)
Parameters:
listener - A Simulator listener to be added

removeSimulatorListener

void removeSimulatorListener(SimulatorListener listener)
Parameters:
listener - A Simulator listener to be removed

clone

Simulator clone()
                throws java.lang.CloneNotSupportedException
Returns:
An independent copy of the Simulator. The copy has the same type and parameters, but doesn't reference any Network, contain any Probes, or have any SimulatorListeners
Throws:
java.lang.CloneNotSupportedException

Nengo.ca