NEST main@f146f75
Loading...
Searching...
No Matches
nest::ConnectionCreator Class Reference

This class is a representation of the dictionary of connection properties given as an argument to the ConnectLayers function. More...

#include <connection_creator.h>

Classes

class  PoolWrapper_
 Wrapper for masked and unmasked pools. More...

Public Types

enum  ConnectionType {
  Pairwise_bernoulli_on_source , Pairwise_bernoulli_on_target , Pairwise_poisson , Fixed_indegree ,
  Fixed_outdegree
}

Public Member Functions

 ConnectionCreator (const Dictionary &dict)
 Construct a ConnectionCreator with the properties defined in the given dictionary.
template<int D>
void connect (Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
 Connect two layers.

Private Member Functions

void extract_params_ (const Dictionary &, std::vector< Dictionary > &)
template<typename Iterator, int D>
void connect_to_target_ (Iterator from, Iterator to, Node *tgt_ptr, const Position< D > &tgt_pos, size_t tgt_thread, const Layer< D > &source)
template<typename Iterator, int D>
void connect_to_target_poisson_ (Iterator from, Iterator to, Node *tgt_ptr, const Position< D > &tgt_pos, size_t tgt_thread, const Layer< D > &source)
template<int D>
void pairwise_bernoulli_on_source_ (Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
template<int D>
void pairwise_bernoulli_on_target_ (Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
template<int D>
void pairwise_poisson_ (Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
template<int D>
void fixed_indegree_ (Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
template<int D>
void fixed_outdegree_ (Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)

Static Private Member Functions

template<typename... Args>
static double evaluate_delay_ (const ParameterPTR &delay_parameter, Args &&... args)
 Evaluate a delay parameter.

Private Attributes

ConnectionType type_
bool allow_autapses_
bool allow_multapses_
bool allow_oversized_
ParameterPTR number_of_connections_
MaskPTR mask_
ParameterPTR kernel_
std::vector< size_t > synapse_model_
std::vector< std::vector< Dictionary > > param_dicts_
std::vector< ParameterPTR > weight_
std::vector< ParameterPTR > delay_
std::vector< ParameterPTR > dendritic_delay_
std::vector< ParameterPTR > axonal_delay_

Detailed Description

This class is a representation of the dictionary of connection properties given as an argument to the ConnectLayers function.

The connect method is responsible for generating the connection according to the given parameters. This method is templated with the dimension of the layers, and is called via the Layer connect call using a visitor pattern. The connect method relays to another method (e.g., fixed_indegree_) implementing the concrete connection algorithm. It would be more elegant if this was a base class for classes representing different connection algorithms with a virtual connect method, but it is not possible to have a virtual template method.

The difference between the Pairwise_bernoulli_on_source and Pairwise_bernoulli_on_target connection types is which layer coordinates the mask and parameters are defined in.

Member Enumeration Documentation

◆ ConnectionType

Enumerator
Pairwise_bernoulli_on_source 
Pairwise_bernoulli_on_target 
Pairwise_poisson 
Fixed_indegree 
Fixed_outdegree 

Constructor & Destructor Documentation

◆ ConnectionCreator()

nest::ConnectionCreator::ConnectionCreator ( const Dictionary & dict)

Construct a ConnectionCreator with the properties defined in the given dictionary.

Parameters for a ConnectionCreator are:

  • "connection_type": Either "convergent" or "divergent".
  • "allow_autapses": Boolean, true if autapses are allowed.
  • "allow_multapses": Boolean, true if multapses are allowed.
  • "allow_oversized": Boolean, true if oversized masks are allowed.
  • "number_of_connections": Integer, number of connections to make for each source or target.
  • "mask": Mask definition (dictionary or masktype).
  • "kernel": Kernel definition (dictionary, parametertype, or double).
  • "synapse_model": The synapse model to use.
  • "weight": Synaptic weight (dictionary, parametertype, or double).
  • "delay": Synaptic delays (dictionary, parametertype, or double).
  • other parameters are interpreted as synapse parameters, and may be defined by a dictionary, parametertype, or double.
    Parameters
    dictdictionary containing properties for the connections.

References nest::names::allow_autapses(), allow_autapses_, nest::names::allow_multapses(), allow_multapses_, allow_oversized_, nest::names::allow_oversized_mask(), axonal_delay_, nest::names::connection_type(), delay_, dendritic_delay_, kernel_, Dictionary::known(), mask_, nest::names::number_of_connections(), number_of_connections_, synapse_model_, Dictionary::update_value(), and weight_.

Here is the call graph for this function:

Member Function Documentation

◆ connect()

template<int D>
void nest::ConnectionCreator::connect ( Layer< D > & source,
NodeCollectionPTR source_nc,
Layer< D > & target,
NodeCollectionPTR target_nc )

Connect two layers.

Parameters
sourcesource layer.
sourceNodeCollection of the source.
targettarget layer.
targetNodeCollection of the target.

References Fixed_indegree, fixed_indegree_(), Fixed_outdegree, fixed_outdegree_(), Pairwise_bernoulli_on_source, pairwise_bernoulli_on_source_(), Pairwise_bernoulli_on_target, pairwise_bernoulli_on_target_(), Pairwise_poisson, pairwise_poisson_(), and type_.

Referenced by nest::Layer< D >::connect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connect_to_target_()

template<typename Iterator, int D>
void nest::ConnectionCreator::connect_to_target_ ( Iterator from,
Iterator to,
Node * tgt_ptr,
const Position< D > & tgt_pos,
size_t tgt_thread,
const Layer< D > & source )
private

References allow_autapses_, axonal_delay_, nest::ConnectionManager::connect(), nest::KernelManager::connection_manager, delay_, dendritic_delay_, nest::BaseRandomGenerator::drand(), evaluate_delay_(), nest::Node::get_node_id(), nest::Position< D, T >::get_vector(), nest::get_vp_specific_rng(), nest::kernel(), kernel_, param_dicts_, synapse_model_, and weight_.

Referenced by pairwise_bernoulli_on_source_(), and pairwise_bernoulli_on_target_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connect_to_target_poisson_()

template<typename Iterator, int D>
void nest::ConnectionCreator::connect_to_target_poisson_ ( Iterator from,
Iterator to,
Node * tgt_ptr,
const Position< D > & tgt_pos,
size_t tgt_thread,
const Layer< D > & source )
private

References allow_autapses_, axonal_delay_, nest::ConnectionManager::connect(), nest::KernelManager::connection_manager, delay_, dendritic_delay_, evaluate_delay_(), nest::Node::get_node_id(), nest::Position< D, T >::get_vector(), nest::get_vp_specific_rng(), nest::kernel(), kernel_, param_dicts_, synapse_model_, and weight_.

Referenced by pairwise_poisson_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ evaluate_delay_()

template<typename... Args>
double nest::ConnectionCreator::evaluate_delay_ ( const ParameterPTR & delay_parameter,
Args &&... args )
inlinestaticprivate

Evaluate a delay parameter.

Synapses use either a single delay or a dendritic and an axonal delay, so the delay parameters which are not used by a synapse are stored as null pointers. They are not evaluated, but yield NaN to signal that they are not set.

References numerics::nan.

Referenced by connect_to_target_(), connect_to_target_poisson_(), fixed_indegree_(), and fixed_outdegree_().

Here is the caller graph for this function:

◆ extract_params_()

void nest::ConnectionCreator::extract_params_ ( const Dictionary & dict,
std::vector< Dictionary > & params )
private

References Dictionary::at(), nest::names::axonal_delay(), axonal_delay_, nest::create_parameter(), nest::names::delay(), delay_, nest::names::dendritic_delay(), dendritic_delay_, extract_params_(), Dictionary::get(), nest::names::has_delay(), nest::kernel(), Dictionary::known(), nest::names::receptor_type(), nest::names::synapse_label(), nest::names::synapse_model(), synapse_model_, nest::names::weight(), and weight_.

Referenced by extract_params_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fixed_indegree_()

template<int D>
void nest::ConnectionCreator::fixed_indegree_ ( Layer< D > & source,
NodeCollectionPTR source_nc,
Layer< D > & target,
NodeCollectionPTR target_nc )
private

◆ fixed_outdegree_()

template<int D>
void nest::ConnectionCreator::fixed_outdegree_ ( Layer< D > & source,
NodeCollectionPTR source_nc,
Layer< D > & target,
NodeCollectionPTR target_nc )
private

◆ pairwise_bernoulli_on_source_()

template<int D>
void nest::ConnectionCreator::pairwise_bernoulli_on_source_ ( Layer< D > & source,
NodeCollectionPTR source_nc,
Layer< D > & target,
NodeCollectionPTR target_nc )
private

References allow_oversized_, nest::ConnectionCreator::PoolWrapper_< D >::begin(), connect_to_target_(), nest::ConnectionCreator::PoolWrapper_< D >::define(), nest::ConnectionCreator::PoolWrapper_< D >::end(), nest::NodeManager::get_node_or_proxy(), nest::VPManager::get_thread_id(), nest::Node::is_proxy(), nest::kernel(), mask_, nest::ConnectionCreator::PoolWrapper_< D >::masked_begin(), nest::ConnectionCreator::PoolWrapper_< D >::masked_end(), nest::KernelManager::node_manager, and nest::KernelManager::vp_manager.

Referenced by connect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pairwise_bernoulli_on_target_()

template<int D>
void nest::ConnectionCreator::pairwise_bernoulli_on_target_ ( Layer< D > & source,
NodeCollectionPTR source_nc,
Layer< D > & target,
NodeCollectionPTR target_nc )
private

References allow_oversized_, nest::ConnectionCreator::PoolWrapper_< D >::begin(), connect_to_target_(), nest::ConnectionCreator::PoolWrapper_< D >::define(), nest::ConnectionCreator::PoolWrapper_< D >::end(), nest::NodeManager::get_node_or_proxy(), nest::VPManager::get_thread_id(), nest::Node::has_proxies(), nest::Node::is_proxy(), nest::kernel(), mask_, nest::ConnectionCreator::PoolWrapper_< D >::masked_begin(), nest::ConnectionCreator::PoolWrapper_< D >::masked_end(), nest::KernelManager::node_manager, and nest::KernelManager::vp_manager.

Referenced by connect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pairwise_poisson_()

template<int D>
void nest::ConnectionCreator::pairwise_poisson_ ( Layer< D > & source,
NodeCollectionPTR source_nc,
Layer< D > & target,
NodeCollectionPTR target_nc )
private

References allow_oversized_, nest::ConnectionCreator::PoolWrapper_< D >::begin(), connect_to_target_poisson_(), nest::ConnectionCreator::PoolWrapper_< D >::define(), nest::ConnectionCreator::PoolWrapper_< D >::end(), nest::NodeManager::get_node_or_proxy(), nest::VPManager::get_thread_id(), nest::Node::is_proxy(), nest::kernel(), mask_, nest::ConnectionCreator::PoolWrapper_< D >::masked_begin(), nest::ConnectionCreator::PoolWrapper_< D >::masked_end(), nest::KernelManager::node_manager, and nest::KernelManager::vp_manager.

Referenced by connect().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ allow_autapses_

bool nest::ConnectionCreator::allow_autapses_
private

◆ allow_multapses_

bool nest::ConnectionCreator::allow_multapses_
private

◆ allow_oversized_

◆ axonal_delay_

std::vector< ParameterPTR > nest::ConnectionCreator::axonal_delay_
private

◆ delay_

◆ dendritic_delay_

std::vector< ParameterPTR > nest::ConnectionCreator::dendritic_delay_
private

◆ kernel_

◆ mask_

◆ number_of_connections_

ParameterPTR nest::ConnectionCreator::number_of_connections_
private

◆ param_dicts_

std::vector< std::vector< Dictionary > > nest::ConnectionCreator::param_dicts_
private

◆ synapse_model_

std::vector< size_t > nest::ConnectionCreator::synapse_model_
private

◆ type_

ConnectionType nest::ConnectionCreator::type_
private

Referenced by connect().

◆ weight_

std::vector< ParameterPTR > nest::ConnectionCreator::weight_
private

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