Public Types | Public Member Functions | Protected Member Functions | List of all members
spore::TracingNode Class Reference

Base class to all nodes that record traces. More...

#include <tracing_node.h>

Inheritance diagram for spore::TracingNode:
Inheritance graph
[legend]
Collaboration diagram for spore::TracingNode:
Collaboration graph
[legend]

Public Types

typedef CircularBuffer< double >::const_iterator const_iterator
 
typedef size_t trace_id
 

Public Member Functions

 TracingNode ()
 
virtual ~TracingNode ()
 
virtual void get_status (DictionaryDatum &d) const
 
virtual void set_status (const DictionaryDatum &d)
 
void get_trace_status (DictionaryDatum &d) const
 
const_iterator get_trace (nest::delay steps, trace_id id) const
 Access the trace of id at time step step. More...
 
const_iterator get_trace (nest::Time const &time, trace_id id) const
 
size_t get_num_traces () const
 

Protected Member Functions

void init_traces (size_t num_traces)
 
void set_trace (nest::delay steps, double v, trace_id id=0)
 

Detailed Description

Base class to all nodes that record traces.

Node that allows to record traces. A trace is a fixed-length buffer that stores the most recent values of a real-valued time-dependent variable, e.g., the neuron's membrane potential. Traces can be read by other nodes or connections. Traces can be accessed using the get_trace() method.

Constructor & Destructor Documentation

◆ TracingNode()

spore::TracingNode::TracingNode ( )

Constructor.

◆ ~TracingNode()

spore::TracingNode::~TracingNode ( )
virtual

Destructor.

Member Function Documentation

◆ get_num_traces()

size_t spore::TracingNode::get_num_traces ( ) const
inline
Returns
the number of traces that are recorded by this node.

◆ get_status()

void spore::TracingNode::get_status ( DictionaryDatum &  d) const
virtual

Get status of tracing node.

Reimplemented in spore::PoissonDblExpNeuron, spore::RewardInProxy, and spore::SporeTestNode.

◆ get_trace() [1/2]

const_iterator spore::TracingNode::get_trace ( nest::delay  steps,
trace_id  id 
) const
inline

Access the trace of id at time step step.

Get the trace at the given time step. Returns an iterator to a circular buffer that allows to read the trace. Note that neither this function nor the iterator checks for the limits of the trace. Instead values wrap around at the buffer limits. Reading at or beyond ConnectionUpdateManager::get_origin() (which is equal to the slice origin), or values older than ConnectionUpdateManager::get_horizon() will lead to undefined behavior.

Parameters
stepsthe time point to be read.
idthe index of the trace.
Returns
an iterator to the trace at the given time point.

◆ get_trace() [2/2]

const_iterator spore::TracingNode::get_trace ( nest::Time const &  time,
trace_id  id 
) const
inline

Convenience function. Time point of trace is passed here as a set::Time object.

Parameters
timethe time point to be read.
idthe index of the trace.
Returns
an iterator to the trace at the given time point.

◆ get_trace_status()

void spore::TracingNode::get_trace_status ( DictionaryDatum &  d) const

Read traces into dictionary.

◆ init_traces()

void spore::TracingNode::init_traces ( size_t  num_traces)
protected

Constructor.

◆ set_status()

void spore::TracingNode::set_status ( const DictionaryDatum &  d)
virtual

Set status of tracing node.

Reimplemented in spore::PoissonDblExpNeuron, spore::RewardInProxy, and spore::SporeTestNode.

◆ set_trace()

void spore::TracingNode::set_trace ( nest::delay  steps,
double  v,
trace_id  id = 0 
)
inlineprotected

Set value of a trace at the given time point. Values are supposed to be written only in the interval of the current slice.

Parameters
stepstime to write values to (in steps).
vvalue to be written.
idid of the trace (default is 0).

The documentation for this class was generated from the following files: