NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
nest::SiblingContainer Class Reference

SiblingContainer class. More...

#include <sibling_container.h>

Inheritance diagram for nest::SiblingContainer:
nest::Node

Public Member Functions

 SiblingContainer ()
 
 SiblingContainer (const SiblingContainer &)
 
virtual ~SiblingContainer ()
 
void set_status (const DictionaryDatum &)
 
void get_status (DictionaryDatum &) const
 
bool is_subnet () const
 
bool has_proxies () const
 Returns true if the node has proxies on remote threads. More...
 
bool empty () const
 
void reserve (size_t)
 
void push_back (Node *)
 
vector< Node * >::iterator begin ()
 Return iterator to the first child node. More...
 
vector< Node * >::iterator end ()
 Return iterator to the end of the child-list. More...
 
vector< Node * >::const_iterator begin () const
 Return const iterator to the first child node. More...
 
vector< Node * >::const_iterator end () const
 Return const iterator to the end of the child-list. More...
 
- Public Member Functions inherited from nest::Node
 Node ()
 
 Node (Node const &)
 
virtual ~Node ()
 
virtual Nodeclone () const
 Virtual copy constructor. More...
 
virtual bool potential_global_receiver () const
 Returns true for potential global receivers (e.g. More...
 
virtual void set_has_proxies (const bool)
 Sets has_proxies_ member variable (to switch to global spike detection mode) More...
 
virtual void set_local_receiver (const bool)
 Sets local_receiver_ member variable (to switch to global spike detection mode) More...
 
virtual bool local_receiver () const
 Returns true if the node only receives events from nodes/devices on the same thread. 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...
 
Subnetget_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 finalize ()
 Finalize 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 (SpikeEvent &, rport receptor_type)
 Check if the node can handle a particular event and receptor type. 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 (SpikeEvent &e)
 Handle incoming spike events. 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...
 
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)
 

Protected Member Functions

size_t num_thread_siblings_ () const
 Return the number of thread siblings in SiblingContainer. More...
 
Nodeget_thread_sibling_ (index) const
 Return the specified member of a SiblingContainer. More...
 
Nodeget_thread_sibling_safe_ (index) const
 Return specified member of a SiblingContainer, with access control. More...
 
void init_node_ (const Node &)
 
void init_state_ (const Node &)
 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 update (Time const &, const long_t, const long_t)
 Bring the node from state $t$ to $t+n*dt$. More...
 
- Protected Member Functions inherited from nest::Node
Modelget_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...
 

Protected Attributes

vector< Node * > nodes_
 Pointer to child nodes. More...
 

Friends

class Network
 
class Scheduler
 
class Subnet
 

Additional Inherited Members

- Static Public Member Functions inherited from nest::Node
static Networknetwork ()
 Return pointer to network driver class. More...
 
- Static Protected Attributes inherited from nest::Node
static Networknet_ =NULL
 Pointer to global network driver. More...
 

Detailed Description

SiblingContainer class.

This class is used to group the replicas of nodes on different threads into one entity. It is derived from node in order to take advantage of the pool allocator, which has only very little overhead compared to a normal std::vector.

Constructor & Destructor Documentation

nest::SiblingContainer::SiblingContainer ( )
nest::SiblingContainer::SiblingContainer ( const SiblingContainer c)
virtual nest::SiblingContainer::~SiblingContainer ( )
inlinevirtual

Member Function Documentation

vector< Node * >::iterator nest::SiblingContainer::begin ( )
inline
vector< Node * >::const_iterator nest::SiblingContainer::begin ( ) const
inline

Return const iterator to the first child node.

References nodes_.

void nest::SiblingContainer::calibrate ( )
inlineprotectedvirtual

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.

bool nest::SiblingContainer::empty ( ) const
inline

References nodes_.

Referenced by is_subnet().

vector< Node * >::iterator nest::SiblingContainer::end ( )
inline
vector< Node * >::const_iterator nest::SiblingContainer::end ( ) const
inline

Return const iterator to the end of the child-list.

References nodes_.

void nest::SiblingContainer::get_status ( DictionaryDatum ) const
inline
Node * nest::SiblingContainer::get_thread_sibling_ ( index  ) const
inlineprotectedvirtual

Return the specified member of a SiblingContainer.

This method is meaningful only for SiblingContainer, for which it returns the pointer to the indexed node in the container. For all other models (including Subnet), it returns a null pointer and throws and assertion.By defining the method in this way, we avoid many dynamic casts.

Reimplemented from nest::Node.

References nodes_.

Referenced by nest::Network::add_node().

Node * nest::SiblingContainer::get_thread_sibling_safe_ ( index  ) const
inlineprotectedvirtual

Return specified member of a SiblingContainer, with access control.

Reimplemented from nest::Node.

References nodes_.

bool nest::SiblingContainer::has_proxies ( ) const
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.

void nest::SiblingContainer::init_buffers_ ( )
inlineprotectedvirtual

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.

See also
Node::init_buffers()

Implements nest::Node.

void nest::SiblingContainer::init_node_ ( const Node )
inlineprotected
void nest::SiblingContainer::init_state_ ( const Node )
inlineprotectedvirtual

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.

Parameters
Referenceto model prototype object.
See also
Node::init_state()
Note
To provide a reasonable behavior during the transition to the new scheme, init_state_() has a default implementation calling init_dynamic_state_().

Implements nest::Node.

bool nest::SiblingContainer::is_subnet ( ) const
inlinevirtual
Returns
true if node is a subnet.

Reimplemented from nest::Node.

References empty(), and nodes_.

size_t nest::SiblingContainer::num_thread_siblings_ ( ) const
inlineprotectedvirtual

Return the number of thread siblings in SiblingContainer.

This method is meaningful only for SiblingContainer, for which it returns the number of siblings in the container. For all other models (including Subnet), it returns 0, which is not wrong. By defining the method in this way, we avoid many dynamic casts.

Reimplemented from nest::Node.

References nodes_.

Referenced by nest::Network::add_node().

void nest::SiblingContainer::push_back ( Node n)
inline

References nodes_.

Referenced by nest::Network::add_node(), and nest::Network::init_().

void nest::SiblingContainer::reserve ( size_t  n)
inline

References nodes_.

Referenced by nest::Network::add_node(), and nest::Network::init_().

void nest::SiblingContainer::set_status ( const DictionaryDatum )
inline

References assert().

void nest::SiblingContainer::update ( Time const &  ,
const long_t  ,
const long_t   
)
inlineprotectedvirtual

Bring the node from state $t$ to $t+n*dt$.

n->update(T, from, to) performs the update steps beginning at T+from .. T+to-1, ie, emitting events with time stamps T+from+1 .. T+to.

Parameters
Timenetwork time at beginning of time slice.
long_tinitial step inside time slice
long_tpost-final step inside time slice

Implements nest::Node.

Friends And Related Function Documentation

friend class Network
friend
friend class Scheduler
friend
friend class Subnet
friend

Member Data Documentation

vector<Node *> nest::SiblingContainer::nodes_
protected

Pointer to child nodes.

This vector contains the pointers to the child nodes. Since deletion of Nodes is possible, entries in this vector may be NULL. Note that all code must handle this case gracefully.Pointer to child nodes.

Referenced by begin(), empty(), end(), get_thread_sibling_(), get_thread_sibling_safe_(), is_subnet(), num_thread_siblings_(), push_back(), and reserve().


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