ca.nengo.model
Enum SimulationMode

java.lang.Object
  extended by java.lang.Enum<SimulationMode>
      extended by ca.nengo.model.SimulationMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SimulationMode>

public enum SimulationMode
extends java.lang.Enum<SimulationMode>

A SimulationMode is a way in which a Neuron or Ensemble can be simulated. Different modes trade off between performance and realism. All Neurons and Ensembles must be able to run in DEFAULT mode. For other modes, there is a chain of fallback choices so that if the requested mode is not supported, the Neuron/Ensemble must run in the closest mode that it does support (which may be the DEFAULT mode).

Author:
Bryan Tripp

Nested Class Summary
static interface SimulationMode.ModeConfigurable
          Something that has runs in different SimulationModes.
 
Enum Constant Summary
APPROXIMATE
          A spiking mode in which some precision is sacrificed for improved performance.
CONSTANT_RATE
          Outputs that spike by default are expressed as rates that are constant for a given constant input.
DEFAULT
          The normal level of detail at which a Neuron/Ensemble runs (all Neuron/Ensembles must support this mode).
DIRECT
          Neurons are not used.
PRECISE
          A higher level of precision than DEFAULT.
RATE
          Outputs that spike by default are instead expressed in terms of firing rates.
 
Method Summary
static SimulationMode getClosestMode(SimulationMode requested, SimulationMode[] supported)
          A convenience method for finding the closest supported mode to a requested mode.
 SimulationMode getFallbackMode()
           
static SimulationMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SimulationMode[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DEFAULT

public static final SimulationMode DEFAULT
The normal level of detail at which a Neuron/Ensemble runs (all Neuron/Ensembles must support this mode).


APPROXIMATE

public static final SimulationMode APPROXIMATE
A spiking mode in which some precision is sacrificed for improved performance. For example, a conductance model in APPROXIMATE mode might continue to use the full model for subthreshold operation, but switch to a stereotyped template for spike generation, to avoid the shorter time steps that are typically needed to model spiking.


RATE

public static final SimulationMode RATE
Outputs that spike by default are instead expressed in terms of firing rates.


CONSTANT_RATE

public static final SimulationMode CONSTANT_RATE
Outputs that spike by default are expressed as rates that are constant for a given constant input. This mode is useful for fast approximate simulations and also for calculating decoders (see NEFEnsemble). If a Neuron can not run in this mode, then in order to find decoders, simulations must be performed to see how the Neuron responds to various inputs.


DIRECT

public static final SimulationMode DIRECT
Neurons are not used. Ensembles process represented variables directly rather than approximations based on neural activity.


PRECISE

public static final SimulationMode PRECISE
A higher level of precision than DEFAULT. The default level should be accurate for most purposes, but this higher level of accuracy can serve as a way to verify that numerical issues are not impacting results (eg error tolerance in a Runge-Kutta integration may be tightened beyond what is deemed necessary). Another way to increase precision, independently of using PRECISE mode, is to simulate with a shorter network time step.

Method Detail

values

public static final SimulationMode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SimulationMode c : SimulationMode.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static SimulationMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getFallbackMode

public SimulationMode getFallbackMode()
Returns:
The fallback mode to use if this mode can not be supported.

getClosestMode

public static SimulationMode getClosestMode(SimulationMode requested,
                                            SimulationMode[] supported)
A convenience method for finding the closest supported mode to a requested mode.

Parameters:
requested - The requested mode
supported - A list of supported modes
Returns:
The supported mode that is closest to the requested mode in the fallback chain