NEST
2.6.0,not_revisioned_source_dir@0
|
Spike detector class. More...
#include <spike_detector.h>
Classes | |
struct | Buffers_ |
Buffer for incoming spikes. More... | |
Public Member Functions | |
spike_detector () | |
spike_detector (const spike_detector &) | |
void | set_has_proxies (const bool hp) |
Sets has_proxies_ member variable (to switch to global spike detection mode) More... | |
bool | has_proxies () const |
Returns true if the node has proxies on remote threads. More... | |
bool | potential_global_receiver () const |
Returns true for potential global receivers (e.g. More... | |
void | set_local_receiver (const bool lr) |
Sets local_receiver_ member variable (to switch to global spike detection mode) More... | |
bool | local_receiver () const |
Returns true if the node only receives events from nodes/devices on the same thread. More... | |
void | handle (SpikeEvent &) |
Handle incoming spike events. More... | |
port | handles_test_event (SpikeEvent &, rport) |
Check if the node can handle a particular event and receptor type. More... | |
void | get_status (DictionaryDatum &) const |
void | set_status (const DictionaryDatum &) |
Public Member Functions inherited from nest::Node | |
Node () | |
Node (Node const &) | |
virtual | ~Node () |
virtual Node * | clone () const |
Virtual copy constructor. More... | |
virtual bool | one_node_per_process () const |
Returns true if the node exists only once per process, but does not have proxies on remote threads. More... | |
virtual bool | is_off_grid () const |
Returns true if the node if it sends/receives -grid events This is used to discriminate between different types of nodes, when adding new nodes to the network. More... | |
virtual bool | is_proxy () const |
Returns true if the node is a proxy node. More... | |
std::string | get_name () const |
Return class name. More... | |
index | get_gid () const |
Return global Network ID. More... | |
index | get_lid () const |
Return local node ID. More... | |
index | get_subnet_index () const |
Return the index to the node in the node array of the parent subnet. More... | |
int | get_model_id () const |
Return model ID of the node. More... | |
Subnet * | get_parent () const |
Return pointer to parent subnet. More... | |
virtual std::string | print_network (int, int, std::string="") |
Prints out one line of the tree view of the network. More... | |
bool | is_frozen () const |
Returns true if node is frozen, i.e., shall not be updated. More... | |
bool | is_local () const |
Returns true if the node is allocated in the local process. More... | |
void | init_state () |
Set state variables to the default values for the model. More... | |
void | init_buffers () |
Initialize buffers of a node. More... | |
virtual void | set_status (const DictionaryDatum &)=0 |
Change properties of the node according to the entries in the dictionary. More... | |
virtual void | get_status (DictionaryDatum &) const =0 |
Export properties of the node by setting entries in the status dictionary. More... | |
virtual port | send_test_event (Node &receiving_node, rport receptor_type, synindex syn_id, bool dummy_target) |
Send an event to the receiving_node passed as an argument. More... | |
virtual port | handles_test_event (RateEvent &, rport receptor_type) |
virtual port | handles_test_event (DataLoggingRequest &, rport receptor_type) |
virtual port | handles_test_event (CurrentEvent &, rport receptor_type) |
virtual port | handles_test_event (ConductanceEvent &, rport receptor_type) |
virtual port | handles_test_event (DoubleDataEvent &, rport receptor_type) |
virtual port | handles_test_event (DSSpikeEvent &, rport receptor_type) |
virtual port | handles_test_event (DSCurrentEvent &, rport receptor_type) |
virtual void | register_stdp_connection (double_t) |
Register a STDP connection. More... | |
virtual void | unregister_stdp_connection (double_t) |
Unregister a STDP connection. More... | |
virtual void | handle (RateEvent &e) |
Handler for rate events. More... | |
virtual void | handle (DataLoggingRequest &e) |
Handler for universal data logging request. More... | |
virtual void | handle (DataLoggingReply &e) |
Handler for universal data logging request. More... | |
virtual void | handle (CurrentEvent &e) |
Handler for current events. More... | |
virtual void | handle (ConductanceEvent &e) |
Handler for conductance events. More... | |
virtual void | handle (DoubleDataEvent &e) |
Handler for DoubleData events. More... | |
virtual double_t | get_K_value (double_t t) |
return the Kminus value at t (in ms). More... | |
virtual void | get_K_values (double_t t, double_t &Kminus, double_t &triplet_Kminus) |
write the Kminus and triplet_Kminus values at t (in ms) to the provided locations. More... | |
virtual void | get_history (double_t t1, double_t t2, std::deque< histentry >::iterator *start, std::deque< histentry >::iterator *finish) |
return the spike history for (t1,t2]. More... | |
virtual void | event_hook (DSSpikeEvent &) |
Modify Event object parameters during event delivery. More... | |
virtual void | event_hook (DSCurrentEvent &) |
void | set_thread (thread) |
Store the number of the thread to which the node is assigned. More... | |
thread | get_thread () const |
Retrieve the number of the thread to which the node is assigned. More... | |
void | set_vp (thread) |
Store the number of the virtual process to which the node is assigned. More... | |
thread | get_vp () const |
Retrieve the number of the virtual process to which the node is assigned. More... | |
void | set_model_id (int) |
Set the model id. More... | |
virtual bool | is_subnet () const |
DictionaryDatum | get_status_base () |
Return a dictionary with the node's properties. More... | |
void | set_status_base (const DictionaryDatum &) |
Set status dictionary of a node. More... | |
bool | is_model_prototype () const |
Returns true if node is model prototype. More... | |
void | set_thread_lid (const index) |
set thread local index More... | |
index | get_thread_lid () const |
get thread local index More... | |
bool | buffers_initialized () const |
True if buffers have been initialized. More... | |
void | set_buffers_initialized (bool initialized) |
Private Member Functions | |
void | init_state_ (Node const &) |
Private function to initialize the state of a node to model defaults. More... | |
void | init_buffers_ () |
Private function to initialize the buffers of a node. More... | |
void | calibrate () |
Re-calculate dependent parameters of the node. More... | |
void | finalize () |
Finalize node. More... | |
void | update (Time const &, const long_t, const long_t) |
Update detector by recording spikes. More... | |
Private Attributes | |
RecordingDevice | device_ |
Buffers_ | B_ |
bool | user_set_precise_times_ |
bool | has_proxies_ |
bool | local_receiver_ |
Additional Inherited Members | |
Static Public Member Functions inherited from nest::Node | |
static Network * | network () |
Return pointer to network driver class. More... | |
Protected Member Functions inherited from nest::Node | |
virtual size_t | num_thread_siblings_ () const |
Return the number of thread siblings in SiblingContainer. More... | |
virtual Node * | get_thread_sibling_ (index) const |
Return the specified member of a SiblingContainer. More... | |
virtual Node * | get_thread_sibling_safe_ (index) const |
Return specified member of a SiblingContainer, with access control. More... | |
Model & | get_model_ () const |
void | set_frozen_ (bool frozen) |
Mark node as frozen. More... | |
template<typename ConcreteNode > | |
const ConcreteNode & | downcast (const Node &) |
Auxiliary function to downcast a Node to a concrete class derived from Node. More... | |
Static Protected Attributes inherited from nest::Node | |
static Network * | net_ =NULL |
Pointer to global network driver. More... | |
Spike detector class.
This class manages spike recording for normal and precise spikes. It receives spikes via its handle(SpikeEvent&) method, buffers them, and stores them via its RecordingDevice in the update() method.
Spikes are buffered in a two-segment buffer. We need to distinguish between two types of spikes: those delivered from the global event queue (almost all spikes) and spikes delivered locally from devices that are replicated on VPs (has_proxies() == false).
nest::spike_detector::spike_detector | ( | ) |
nest::spike_detector::spike_detector | ( | const spike_detector & | n | ) |
|
privatevirtual |
Re-calculate dependent parameters of the node.
This function is called each time a simulation is begun/resumed. It must re-calculate all internal Variables of the node required for spike handling or updating the node.
Implements nest::Node.
References SLIInterpreter::M_INFO.
|
inlineprivatevirtual |
Finalize node.
Override this function if a node needs to "wrap up" things after a simulation, i.e., before Scheduler::resume() returns. Typical use-cases are devices that need to flush buffers or disconnect from external files or pipes.
Reimplemented from nest::Node.
References device_, and nest::RecordingDevice::finalize().
void nest::spike_detector::get_status | ( | DictionaryDatum & | d | ) | const |
|
virtual |
Handle incoming spike events.
Default implementation of event handlers just throws an UnexpectedEvent exception.
thrd | Id of the calling thread. |
e | Event object. |
This handler has to be implemented if a Node should accept spike events.
UnexpectedEvent | This is the default event to throw. |
Reimplemented from nest::Node.
References assert(), nest::SpikeEvent::clone(), nest::SpikeEvent::get_multiplicity(), nest::Event::get_sender_gid(), and nest::Event::get_stamp().
|
inlinevirtual |
Check if the node can handle a particular event and receptor type.
This function is called upon connection setup by send_test_event().
handles_test_event() function is used to verify that the receiver can handle the event. It can also be used by the receiver to return information to the sender in form of the returned port. The default implementation throws an IllegalConnection exception. Any node class should define handles_test_event() functions for all those event types it can handle.
See Kunkel et al, Front Neuroinform 8:78 (2014), Sec 3.
IllegalConnection |
Reimplemented from nest::Node.
References nest::Node::get_name().
|
inlinevirtual |
Returns true if the node has proxies on remote threads.
This is used to discriminate between different types of nodes, when adding new nodes to the network.
Reimplemented from nest::Node.
References has_proxies_.
|
privatevirtual |
Private function to initialize the buffers of a node.
This function, which must be overloaded by all derived classes, provides the implementation for initializing the buffers of a node.
Implements nest::Node.
|
privatevirtual |
Private function to initialize the state of a node to model defaults.
This function, which must be overloaded by all derived classes, provides the implementation for initializing the state of a node to the model defaults; the state is the set of observable dynamic variables.
Reference | to model prototype object. |
Implements nest::Node.
References device_, and nest::Node::init_state().
|
inlinevirtual |
Returns true if the node only receives events from nodes/devices on the same thread.
Reimplemented from nest::Node.
References local_receiver_.
|
inlinevirtual |
Returns true for potential global receivers (e.g.
spike_detector) and false otherwise
Reimplemented from nest::Node.
|
inlinevirtual |
Sets has_proxies_ member variable (to switch to global spike detection mode)
Reimplemented from nest::Node.
References has_proxies_.
|
inlinevirtual |
Sets local_receiver_ member variable (to switch to global spike detection mode)
Reimplemented from nest::Node.
References local_receiver_.
void nest::spike_detector::set_status | ( | const DictionaryDatum & | d | ) |
References nest::names::precise_times.
Update detector by recording spikes.
All spikes in the read_toggle() half of the spike buffer are recorded by passing them to the RecordingDevice, which then stores them in memory or outputs them as desired.
Implements nest::Node.
References assert(), and numerics::e.
|
private |
|
private |
Referenced by finalize(), and init_state_().
|
private |
Referenced by has_proxies(), and set_has_proxies().
|
private |
Referenced by local_receiver(), and set_local_receiver().
|
private |