NEST main@caf0ae8
 
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)
 

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_
 

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 Dictionary::all_entries_accessed(), nest::names::allow_autapses(), allow_autapses_, nest::names::allow_multapses(), allow_multapses_, allow_oversized_, nest::names::allow_oversized_mask(), Dictionary::at(), nest::names::connection_type(), nest::create_mask(), nest::create_parameter(), nest::names::delay(), delay_, extract_params_(), Fixed_indegree, Fixed_outdegree, Dictionary::get(), nest::ModelManager::get_connector_defaults(), nest::ModelManager::get_synapse_model_id(), nest::names::has_delay(), nest::names::kernel(), nest::kernel(), kernel_, Dictionary::known(), nest::names::mask(), mask_, nest::KernelManager::model_manager, numerics::nan, nest::names::number_of_connections(), number_of_connections_, Pairwise_bernoulli_on_source, nest::names::pairwise_bernoulli_on_source(), Pairwise_bernoulli_on_target, nest::names::pairwise_bernoulli_on_target(), Pairwise_poisson, nest::names::pairwise_poisson(), param_dicts_, synapse_model_, nest::names::synapse_parameters(), type_, Dictionary::update_value(), nest::names::weight(), 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_, nest::ConnectionManager::connect(), nest::KernelManager::connection_manager, delay_, nest::BaseRandomGenerator::drand(), 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_, nest::ConnectionManager::connect(), nest::KernelManager::connection_manager, 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:

◆ extract_params_()

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

References Dictionary::at(), nest::create_parameter(), nest::names::delay(), delay_, Dictionary::get(), nest::ModelManager::get_connector_defaults(), nest::ModelManager::get_synapse_model_id(), nest::names::has_delay(), nest::kernel(), Dictionary::known(), nest::KernelManager::model_manager, numerics::nan, nest::names::receptor_type(), nest::names::synapse_label(), nest::names::synapse_model(), synapse_model_, nest::names::weight(), and weight_.

Referenced by ConnectionCreator().

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

References allow_autapses_, allow_multapses_, allow_oversized_, nest::MaskedLayer< D >::begin(), nest::ConnectionManager::connect(), nest::KernelManager::connection_manager, delay_, nest::MaskedLayer< D >::end(), nest::NodeManager::get_node_or_proxy(), nest::get_rank_synced_rng(), nest::Node::get_thread(), nest::Position< D, T >::get_vector(), nest::Node::has_proxies(), nest::Node::is_proxy(), nest::kernel(), kernel_, mask_, nest::KernelManager::node_manager, number_of_connections_, nest::RandomDistribution< DistributionT >::param(), param_dicts_, synapse_model_, and weight_.

Referenced by connect().

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

◆ 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_

◆ delay_

◆ 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(), and ConnectionCreator().

◆ weight_

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

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