ca.nengo.util.impl
Class ProbeImpl

java.lang.Object
  extended by ca.nengo.util.impl.ProbeImpl
All Implemented Interfaces:
Probe, java.io.Serializable

public class ProbeImpl
extends java.lang.Object
implements Probe, java.io.Serializable

Collects information from Probeable objects.

Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
ProbeImpl()
           
 
Method Summary
 void collect(float time)
          Processes new data.
 void connect(Probeable target, java.lang.String stateName, boolean record)
           
 void connect(java.lang.String ensembleName, Probeable target, java.lang.String stateName, boolean record)
           
 TimeSeries getData()
           
 java.lang.String getEnsembleName()
           
 java.lang.String getStateName()
           
 Probeable getTarget()
           
 boolean isInEnsemble()
           
 void reset()
          Clears collected data.
 void setSamplingRate(float rate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProbeImpl

public ProbeImpl()
Method Detail

connect

public void connect(java.lang.String ensembleName,
                    Probeable target,
                    java.lang.String stateName,
                    boolean record)
             throws SimulationException
Specified by:
connect in interface Probe
Parameters:
ensembleName - Name of the Ensemble the target object belongs to. Null, if the target is a top-level node.
target - The object about which state history is to be collected
stateName - The name of the state variable to collect
record - If true, getData() returns history since last connect() or reset(), otherwise getData() returns most recent sample
Throws:
SimulationException - if the given target does not have the given state
See Also:
Probe.connect(java.lang.String, ca.nengo.model.Probeable, java.lang.String, boolean)

connect

public void connect(Probeable target,
                    java.lang.String stateName,
                    boolean record)
             throws SimulationException
Specified by:
connect in interface Probe
Parameters:
target - The object about which state history is to be collected
stateName - The name of the state variable to collect
record - If true, getData() returns history since last connect() or reset(), otherwise getData() returns most recent sample
Throws:
SimulationException - if the given target does not have the given state
See Also:
Probe.connect(Probeable, String, boolean)

reset

public void reset()
Description copied from interface: Probe
Clears collected data.

Specified by:
reset in interface Probe
See Also:
Probe.reset()

collect

public void collect(float time)
Description copied from interface: Probe
Processes new data. To be called after every Network time step.

Specified by:
collect in interface Probe
See Also:
Probe.collect(float)

getData

public TimeSeries getData()
Specified by:
getData in interface Probe
Returns:
All collected data since last reset()
See Also:
Probe.getData()

setSamplingRate

public void setSamplingRate(float rate)
Specified by:
setSamplingRate in interface Probe
Parameters:
rate - Rate in samples per second. The default is one sample per network time step, and it is not possible to sample faster than this (specifying a higher sampling rate has no effect).
See Also:
Probe.setSamplingRate(float)

getTarget

public Probeable getTarget()
Specified by:
getTarget in interface Probe
Returns:
The object about which state history is to be collected
See Also:
Probe.getTarget()

getStateName

public java.lang.String getStateName()
Specified by:
getStateName in interface Probe
Returns:
The name of the state variable to collect
See Also:
Probe.getStateName()

isInEnsemble

public boolean isInEnsemble()
Specified by:
isInEnsemble in interface Probe
Returns:
Whether the target the node is attached to is inside an Ensemble
See Also:
Probe.isInEnsemble()

getEnsembleName

public java.lang.String getEnsembleName()
Specified by:
getEnsembleName in interface Probe
Returns:
The name of the Ensemble the target the Probe is attached to is in. Null if it's not in one
See Also:
Probe.getEnsembleName()