Public Member Functions | Protected Member Functions | List of all members
spore::DiligentConnectorModel< ConnectionT > Class Template Reference

Connector model for diligent connections. More...

#include <diligent_connector_model.h>

Inheritance diagram for spore::DiligentConnectorModel< ConnectionT >:
Inheritance graph
[legend]
Collaboration diagram for spore::DiligentConnectorModel< ConnectionT >:
Collaboration graph
[legend]

Public Member Functions

 DiligentConnectorModel (const std::string name, bool is_primary=true, bool has_delay=true, bool requires_symmetric=false)
 
 DiligentConnectorModel (const DiligentConnectorModel &other, const std::string name)
 
virtual nest::ConnectorBase * add_connection (nest::Node &src, nest::Node &tgt, nest::ConnectorBase *conn, nest::synindex syn_id, double weight, double delay)
 
virtual nest::ConnectorBase * add_connection (nest::Node &src, nest::Node &tgt, nest::ConnectorBase *conn, nest::synindex syn_id, DictionaryDatum &d, double weight, double delay)
 
virtual nest::ConnectorBase * delete_connection (nest::Node &tgt, size_t target_thread, nest::ConnectorBase *conn, nest::synindex syn_id)
 
virtual nest::ConnectorModel * clone (std::string name) const
 

Protected Member Functions

nest::ConnectorBase * cleanup_delete_connection (nest::Node &tgt, const size_t target_thread, nest::ConnectorBase *const conn, const nest::synindex syn_id)
 Cleanup and delete the given connection. More...
 
void register_connector (nest::ConnectorBase *new_conn, nest::ConnectorBase *old_conn, nest::index sender_gid, size_t target_thread, nest::synindex syn_id)
 
nest::ConnectorBase * get_hom_connector (nest::ConnectorBase *conn, nest::synindex syn_id)
 

Detailed Description

template<typename ConnectionT>
class spore::DiligentConnectorModel< ConnectionT >

Connector model for diligent connections.

Generic connector model for connections that require being updated on a regular time grid. Use the function spore::register_diligent_connection_model provided in diligent_connector_model.h, to register your synapse model at the network, to use the diligent synapse model instead of NEST's build-in synapse model.

Diligent connections are connection models that are updated on a regular time grid (as opposed to NEST's standard lazy update). More precisely, the API guarantees that the send function of the synapse is called at least once in a certain time window. If no presynaptic spike is send via the synapse during that time, a "dummy" spike is inserted to trigger a synapse update. The synapse can distinguish between "dummy" spikes and "real" spikes through the receptor port, which is set to the invalid value of -1 for dummy spikes (see SynapseUpdateEvent). The update interval can be controlled using the InitSynapseUpdater SLI function (see ConnectionUpdateManager)

The DiligentConnectorModel provides the interface to this mechanism. New synapse models that use the diligent connection framework should be registered using the register_diligent_connection_model template function. Connections instantiated from this model will be automatically registered at the global ConnectionUpdateManager object that takes care of triggering the synapse updates.

Synapses registered with the DiligentConnectorModel must implement a method called is_degenerated that takes no arguments and returns a bool. This is used by the garbage collector of the ConnectionUpdateManager to identify synapses that need to be deleted. The mechanism is described in detail in the documentation of ConnectionUpdateManager.

Another difference diligent connectors and standard NEST connections is that the calibrate function of their CommonSynapseProperties object is called additionally on simulation startup (such as nest::Node objects).

See also
ConnectionUpdateManager, SynapseUpdateEvent, SynapticSamplingRewardGradientConnection

Constructor & Destructor Documentation

◆ DiligentConnectorModel() [1/2]

template<typename ConnectionT >
spore::DiligentConnectorModel< ConnectionT >::DiligentConnectorModel ( const std::string  name,
bool  is_primary = true,
bool  has_delay = true,
bool  requires_symmetric = false 
)
inline

Constructor.

◆ DiligentConnectorModel() [2/2]

template<typename ConnectionT >
spore::DiligentConnectorModel< ConnectionT >::DiligentConnectorModel ( const DiligentConnectorModel< ConnectionT > &  other,
const std::string  name 
)
inline

Constructor.

Member Function Documentation

◆ add_connection() [1/2]

template<typename ConnectionT >
nest::ConnectorBase * spore::DiligentConnectorModel< ConnectionT >::add_connection ( nest::Node &  src,
nest::Node &  tgt,
nest::ConnectorBase *  conn,
nest::synindex  syn_id,
double  delay,
double  weight 
)
virtual

Adds a new connection between two nodes.

Delay and weight have the default value NAN. NAN is a special value in cmath, which describes double values that are not a number. If delay or weight is omitted in an add_connection call, NAN indicates this and weight/delay are set only, if they are valid.

Parameters
tgtsource node.
tgttarget node.
target_threadthread of the target.
connConnector Base from where the connection will be deleted.
syn_idSynapse type.
delaysynaptic delay.
weightsynaptic weight.
Returns
A new Connector, with the inserted new connection.

◆ add_connection() [2/2]

template<typename ConnectionT >
nest::ConnectorBase * spore::DiligentConnectorModel< ConnectionT >::add_connection ( nest::Node &  src,
nest::Node &  tgt,
nest::ConnectorBase *  conn,
nest::synindex  syn_id,
DictionaryDatum &  p,
double  delay,
double  weight 
)
virtual

Adds a new connection between two nodes.

Delay and weight have the default value NAN. NAN is a special value in cmath, which describes double values that are not a number. If delay or weight is omitted in an add_connection call, NAN indicates this and weight/delay are set only, if they are valid.

Parameters
tgtsource node.
tgttarget node.
target_threadthread of the target.
connConnector Base from where the connection will be deleted.
syn_idSynapse type.
pdictionary with synapse paramters.
delaysynaptic delay.
weightsynaptic weight.
Returns
A new Connector, with the inserted new connection.

◆ cleanup_delete_connection()

template<typename ConnectionT >
nest::ConnectorBase * spore::DiligentConnectorModel< ConnectionT >::cleanup_delete_connection ( nest::Node &  tgt,
const size_t  target_thread,
nest::ConnectorBase *const  conn,
const nest::synindex  syn_id 
)
protected

Cleanup and delete the given connection.

This deviates from the standard NEST implementation in that it preferably deletes synapses that are marked for deletion instead of taking the first synapse that matches the specifications. Synapses indicate that they are marked for deletion by returning true from their is_degenerated method. If no connection is found that is marked for deletion this function behaves the same way as delete_connection of NEST's generic connector model.

Parameters
tgtTarget node
target_threadThread of the target
connConnector Base from where the connection will be deleted
syn_idSynapse type
Returns
A new Connector, equal to the original but with an erased connection to the defined target.

◆ clone()

template<typename ConnectionT >
nest::ConnectorModel * spore::DiligentConnectorModel< ConnectionT >::clone ( std::string  name) const
virtual

Creates a clone of the connector model.

◆ delete_connection()

template<typename ConnectionT >
nest::ConnectorBase * spore::DiligentConnectorModel< ConnectionT >::delete_connection ( nest::Node &  tgt,
size_t  target_thread,
nest::ConnectorBase *  conn,
nest::synindex  syn_id 
)
virtual

Delete a connection of a given type directed to a defined target Node

Parameters
tgtTarget node
target_threadThread of the target
connConnector Base from where the connection will be deleted
syn_idSynapse type
Returns
A new Connector, equal to the original but with an erased connection to the defined target.

◆ get_hom_connector()

template<typename ConnectionT >
nest::ConnectorBase * spore::DiligentConnectorModel< ConnectionT >::get_hom_connector ( nest::ConnectorBase *  conn,
nest::synindex  syn_id 
)
protected

Helper function to extract the homogeneous connector with given type from a given connector. If the given connector is homogeneous the type is checked and it is returned. If the type does not match the function fails. If the connector is heterogeneous a connector of given is searched within it and returned if found. Returns 0 if a 0-pointer is passed.

Parameters
connthe connector to be checked, can be 0.
syn_idthe type id of the connector to be found.
Returns
the homogeneous connector, 0 if none found.

◆ register_connector()

template<typename ConnectionT >
void spore::DiligentConnectorModel< ConnectionT >::register_connector ( nest::ConnectorBase *  new_conn,
nest::ConnectorBase *  old_conn,
nest::index  sender_gid,
size_t  target_thread,
nest::synindex  syn_id 
)
protected

Registers the connector at the ConnectionUpdateManager.


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