NEST  2.6.0,not_revisioned_source_dir@0
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 { Target_driven, Source_driven, Convergent, Divergent }
 

Public Member Functions

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

Private Member Functions

template<typename Iterator , int D>
void connect_to_target_ (Iterator from, Iterator to, Node *tgt_ptr, const Position< D > &tgt_pos, thread tgt_thread, const Layer< D > &source)
 
template<int D>
void target_driven_connect_ (Layer< D > &source, Layer< D > &target)
 
template<int D>
void source_driven_connect_ (Layer< D > &source, Layer< D > &target)
 
template<int D>
void convergent_connect_ (Layer< D > &source, Layer< D > &target)
 
template<int D>
void divergent_connect_ (Layer< D > &source, Layer< D > &target)
 
void connect_ (index s, Node *target, thread target_thread, double_t w, double_t d, index syn)
 
template<int D>
void get_parameters_ (const Position< D > &pos, librandom::RngPtr rng, double &weight, double &delay)
 Calculate parameter values for this position. More...
 

Private Attributes

ConnectionType type_
 
bool allow_autapses_
 
bool allow_multapses_
 
bool allow_oversized_
 
Selector source_filter_
 
Selector target_filter_
 
index number_of_connections_
 
lockPTR< AbstractMaskmask_
 
lockPTR< Parameterkernel_
 
index synapse_model_
 
lockPTR< Parameterweight_
 
lockPTR< Parameterdelay_
 
Networknet_
 

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., convergent_connect_) 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.

This class distinguishes between target driven and convergent connections, which are both called "convergent" in the Topology module documentation, and between source driven and divergent connections. The true convergent/divergent connections are those with a fixed number of connections (fan in/out). The only difference between source driven and target driven connections is which layer coordinates the mask and parameters are defined in.

Member Enumeration Documentation

Enumerator
Target_driven 
Source_driven 
Convergent 
Divergent 

Constructor & Destructor Documentation

nest::ConnectionCreator::ConnectionCreator ( DictionaryDatum  dict)

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

Parameters for a ConnectionCreator are:

  • "connection_type": Either "convergent" or "convergent".
  • "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.
  • "targets": Which targets (model or lid) to select (dictionary).
  • "sources": Which targets (model or lid) to select (dictionary).
  • "weights": Synaptic weight (dictionary, parametertype, or double).
  • "delays": 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, nest::names::connection_type, nest::names::convergent, Convergent, nest::TopologyModule::create_mask(), nest::TopologyModule::create_parameter(), nest::names::delay, delay_, nest::names::delays, nest::names::divergent, Divergent, nest::Network::get_connector_defaults(), nest::Network::get_synapsedict(), getValue< bool >(), nest::names::kernel, kernel_, Dictionary::lookup(), nest::names::mask, mask_, net_, nest::names::number_of_connections, number_of_connections_, Source_driven, source_filter_, nest::names::sources, nest::names::synapse_model, synapse_model_, Target_driven, target_filter_, nest::names::targets, type_, nest::names::weight, weight_, and nest::names::weights.

Member Function Documentation

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

Connect two layers.

Parameters
sourcesource layer.
targettarget layer.

References Convergent, convergent_connect_(), Divergent, divergent_connect_(), Source_driven, source_driven_connect_(), Target_driven, target_driven_connect_(), and type_.

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

void nest::ConnectionCreator::connect_ ( index  s,
Node target,
thread  target_thread,
double_t  w,
double_t  d,
index  syn 
)
inlineprivate
template<typename Iterator , int D>
void nest::ConnectionCreator::connect_to_target_ ( Iterator  from,
Iterator  to,
Node tgt_ptr,
const Position< D > &  tgt_pos,
thread  tgt_thread,
const Layer< D > &  source 
)
private
template<int D>
void nest::ConnectionCreator::convergent_connect_ ( Layer< D > &  source,
Layer< D > &  target 
)
private
template<int D>
void nest::ConnectionCreator::divergent_connect_ ( Layer< D > &  source,
Layer< D > &  target 
)
private
template<int D>
void nest::ConnectionCreator::get_parameters_ ( const Position< D > &  pos,
librandom::RngPtr  rng,
double &  weight,
double &  delay 
)
private

Calculate parameter values for this position.

TODO: remove when all four connection variants are refactored

References delay_, and weight_.

Referenced by convergent_connect_(), divergent_connect_(), and source_driven_connect_().

template<int D>
void nest::ConnectionCreator::source_driven_connect_ ( Layer< D > &  source,
Layer< D > &  target 
)
private
template<int D>
void nest::ConnectionCreator::target_driven_connect_ ( Layer< D > &  source,
Layer< D > &  target 
)
private

Member Data Documentation

bool nest::ConnectionCreator::allow_autapses_
private
bool nest::ConnectionCreator::allow_multapses_
private
bool nest::ConnectionCreator::allow_oversized_
private
lockPTR<Parameter> nest::ConnectionCreator::delay_
private
lockPTR<Parameter> nest::ConnectionCreator::kernel_
private
lockPTR<AbstractMask> nest::ConnectionCreator::mask_
private
Network& nest::ConnectionCreator::net_
private
index nest::ConnectionCreator::number_of_connections_
private
Selector nest::ConnectionCreator::source_filter_
private
index nest::ConnectionCreator::synapse_model_
private
Selector nest::ConnectionCreator::target_filter_
private
ConnectionType nest::ConnectionCreator::type_
private

Referenced by connect(), and ConnectionCreator().

lockPTR<Parameter> nest::ConnectionCreator::weight_
private

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