Abstract base class for Bipartite ConnBuilders which form the components of ConnBuilder. More...
#include <conn_builder.h>
Public Member Functions | |
| virtual void | connect () |
| Connect with or without structural plasticity. | |
| virtual void | disconnect () |
| Delete synapses with or without structural plasticity. | |
| BipartiteConnBuilder (NodeCollectionPTR sources, NodeCollectionPTR targets, ThirdOutBuilder *third_out, const Dictionary &conn_spec, const std::vector< Dictionary > &syn_specs) | |
| virtual | ~BipartiteConnBuilder () |
| size_t | get_synapse_model () const |
| bool | get_default_delay () const |
| void | set_synaptic_element_names (const std::string &pre_name, const std::string &post_name) |
| bool | change_connected_synaptic_elements (size_t snode_id, size_t tnode_id, const size_t tid, int update) |
| Updates the number of connected synaptic elements in the target and the source. | |
| virtual bool | supports_symmetric () const |
| Return true if rule allows creation of symmetric connectivity. | |
| virtual bool | is_symmetric () const |
| Return true if rule automatically creates symmetric connectivity. | |
| bool | allows_autapses () const |
| bool | allows_multapses () const |
| virtual bool | requires_proxies () const |
| Return true if rule is applicable only to nodes with proxies. | |
Protected Member Functions | |
| virtual void | connect_ ()=0 |
| Implements the actual connection algorithm. | |
| bool | all_parameters_scalar_ () const |
| virtual void | sp_connect_ () |
| virtual void | disconnect_ () |
| virtual void | sp_disconnect_ () |
| void | update_param_dict_ (size_t snode_id, Node &target, size_t target_thread, RngPtr rng, size_t indx) |
| void | single_connect_ (size_t, Node &, size_t, RngPtr) |
| Create connection between given nodes, fill parameter values. | |
| void | single_disconnect_ (size_t, Node &, size_t) |
| void | skip_conn_parameter_ (size_t, size_t n_skip=1) |
| Moves pointer in parameter array. | |
| bool | loop_over_targets_ () const |
| Returns true if conventional looping over targets is indicated. | |
Protected Attributes | |
| NodeCollectionPTR | sources_ |
| Population to connect from. | |
| NodeCollectionPTR | targets_ |
| Population to connect to. | |
| ThirdOutBuilder * | third_out_ |
| To be triggered when primary connection is created. | |
| bool | allow_autapses_ |
| bool | allow_multapses_ |
| bool | make_symmetric_ |
| bool | creates_symmetric_connections_ |
| std::vector< std::exception_ptr > | exceptions_raised_ |
| buffer for exceptions raised in threads | |
| std::string | pre_synaptic_element_name_ |
| std::string | post_synaptic_element_name_ |
| bool | use_structural_plasticity_ |
| std::vector< ConnParameter * > | parameters_requiring_skipping_ |
| Pointers to connection parameters specified as arrays. | |
| std::vector< size_t > | synapse_model_id_ |
| std::vector< std::vector< Dictionary > > | param_dicts_ |
| Dictionaries to pass to connect function, one per thread for every syn_spec. | |
Private Types | |
| typedef std::map< std::string, ConnParameter * > | ConnParameterMap |
Private Member Functions | |
| void | register_parameters_requiring_skipping_ (ConnParameter ¶m) |
| Collects all array parameters in a vector. | |
| void | set_synapse_model_ (const Dictionary &syn_params, const size_t indx) |
| Set synapse specific parameters. | |
| void | set_default_weight_or_delay_ (const Dictionary &syn_params, const size_t indx) |
| void | set_synapse_params (const Dictionary &syn_defaults, const Dictionary &syn_params, const size_t indx) |
| void | set_structural_plasticity_parameters (const std::vector< Dictionary > &syn_specs) |
| Set structural plasticity parameters (if provided) | |
| void | reset_weights_ () |
| Reset weight and delay pointers. | |
| void | reset_delays_ () |
Private Attributes | |
| std::vector< bool > | default_weight_and_delay_ |
| indicate that weight and delay should not be set per synapse | |
| std::vector< bool > | default_weight_ |
| indicate that weight should not be set per synapse | |
| std::vector< bool > | default_delay_ |
| indicate that delay should not be set per synapse | |
| std::vector< ConnParameter * > | weights_ |
| std::vector< ConnParameter * > | delays_ |
| std::vector< ConnParameterMap > | synapse_params_ |
| all other parameters, mapping name to value representation | |
| std::set< std::string > | skip_syn_params_ |
| synapse-specific parameters that should be skipped when we set default synapse parameters | |
Abstract base class for Bipartite ConnBuilders which form the components of ConnBuilder.
The base class extracts and holds parameters and provides the connect interface. Derived classes implement the connect method.
|
private |
| nest::BipartiteConnBuilder::BipartiteConnBuilder | ( | NodeCollectionPTR | sources, |
| NodeCollectionPTR | targets, | ||
| ThirdOutBuilder * | third_out, | ||
| const Dictionary & | conn_spec, | ||
| const std::vector< Dictionary > & | syn_specs | ||
| ) |
References nest::names::allow_autapses(), allow_autapses_, nest::names::allow_multapses(), allow_multapses_, default_delay_, default_weight_, default_weight_and_delay_, nest::names::delay(), delays_, nest::ModelManager::get_connector_defaults(), nest::kernel(), nest::names::make_symmetric(), make_symmetric_, nest::names::max_delay(), nest::names::min_delay(), nest::KernelManager::model_manager, nest::names::music_channel(), nest::names::num_connections(), param_dicts_, reset_delays_(), reset_weights_(), set_default_weight_or_delay_(), set_structural_plasticity_parameters(), set_synapse_model_(), set_synapse_params(), skip_syn_params_, sources_, nest::names::synapse_model(), synapse_model_id_, synapse_params_, targets_, third_out_, Dictionary::update_value(), nest::names::weight(), and weights_.
|
virtual |
References delays_, synapse_params_, and weights_.
|
protected |
References delays_, synapse_params_, and weights_.
Referenced by nest::AllToAllBuilder::is_symmetric().
|
inline |
References allow_autapses_.
|
inline |
References allow_multapses_.
| bool nest::BipartiteConnBuilder::change_connected_synaptic_elements | ( | size_t | snode_id, |
| size_t | tnode_id, | ||
| const size_t | tid, | ||
| int | update | ||
| ) |
Updates the number of connected synaptic elements in the target and the source.
| snode_id | The node ID of the source |
| tnode_id | The node ID of the target |
| tid | the thread of the target |
| update | Amount of connected synaptic elements to update |
References nest::NodeManager::get_node_or_proxy(), nest::kernel(), nest::KernelManager::node_manager, post_synaptic_element_name_, and pre_synaptic_element_name_.
Referenced by nest::SPBuilder::connect_(), nest::OneToOneBuilder::sp_connect_(), nest::AllToAllBuilder::sp_connect_(), nest::OneToOneBuilder::sp_disconnect_(), and nest::AllToAllBuilder::sp_disconnect_().
|
virtual |
Connect with or without structural plasticity.
Reimplemented in nest::ThirdOutBuilder.
References connect_(), creates_symmetric_connections_, exceptions_raised_, nest::ModelManager::get_connection_model(), is_symmetric(), nest::kernel(), make_symmetric_, nest::KernelManager::model_manager, nest::REQUIRES_SYMMETRIC, reset_delays_(), reset_weights_(), sources_, sp_connect_(), supports_symmetric(), synapse_model_id_, synapse_params_, targets_, and use_structural_plasticity_.
Referenced by nest::ConnBuilder::connect().
|
protectedpure virtual |
Implements the actual connection algorithm.
Implemented in nest::ThirdInBuilder, nest::ThirdBernoulliWithPoolBuilder, nest::OneToOneBuilder, nest::AllToAllBuilder, nest::FixedInDegreeBuilder, nest::FixedOutDegreeBuilder, nest::FixedTotalNumberBuilder, nest::BernoulliBuilder, nest::PoissonBuilder, nest::SymmetricBernoulliBuilder, nest::SPBuilder, and nest::SPBuilder.
Referenced by connect().
|
virtual |
Delete synapses with or without structural plasticity.
References disconnect_(), exceptions_raised_, sp_disconnect_(), and use_structural_plasticity_.
Referenced by nest::ConnBuilder::disconnect(), and nest::SPManager::disconnect().
|
inlineprotectedvirtual |
Reimplemented in nest::OneToOneBuilder, and nest::AllToAllBuilder.
Referenced by disconnect().
|
inline |
References default_delay_, and synapse_model_id_.
Referenced by nest::SPManager::set_status(), and nest::SPBuilder::update_delay().
|
inline |
References synapse_model_id_.
Referenced by nest::SPBuilder::update_delay(), and nest::SPManager::update_structural_plasticity().
|
inlinevirtual |
Return true if rule automatically creates symmetric connectivity.
Reimplemented in nest::AllToAllBuilder.
Referenced by connect().
|
protected |
Returns true if conventional looping over targets is indicated.
Conventional looping over targets must be used if
Conventional looping should be used if
For background, see Ippen et al (2017).
References nest::kernel(), nest::KernelManager::node_manager, parameters_requiring_skipping_, nest::NodeManager::size(), and targets_.
Referenced by nest::OneToOneBuilder::connect_(), nest::AllToAllBuilder::connect_(), nest::FixedInDegreeBuilder::connect_(), nest::BernoulliBuilder::connect_(), and nest::PoissonBuilder::connect_().
|
inlineprivate |
Collects all array parameters in a vector.
If the inserted parameter is an array it will be added to a vector of ConnParameters. This vector will be exploited in some connection routines to ensuring thread-safety.
References nest::ConnParameter::is_array(), and parameters_requiring_skipping_.
Referenced by set_default_weight_or_delay_(), and set_synapse_params().
|
inlinevirtual |
Return true if rule is applicable only to nodes with proxies.
Reimplemented in nest::OneToOneBuilder, and nest::AllToAllBuilder.
Referenced by single_connect_().
|
private |
References delays_.
Referenced by BipartiteConnBuilder(), and connect().
|
private |
Reset weight and delay pointers.
References weights_.
Referenced by BipartiteConnBuilder(), and connect().
|
private |
References Dictionary::at(), nest::ConnParameter::create(), default_delay_, default_weight_, default_weight_and_delay_, nest::names::delay(), delays_, nest::ModelManager::get_connector_defaults(), nest::kernel(), Dictionary::known(), nest::KernelManager::model_manager, register_parameters_requiring_skipping_(), synapse_model_id_, nest::names::weight(), and weights_.
Referenced by BipartiteConnBuilder().
|
private |
Set structural plasticity parameters (if provided)
This function first checks if any of the given syn_specs contains one of the structural plasticity parameters pre_synaptic_element or post_synaptic_element. If that is the case and only a single syn_spec is given, the parameters are copied to the variables pre_synaptic_element_name_ and post_synaptic_element_name_, and the flag use_structural_plasticity_ is set to true.
An exception is thrown if either
References Dictionary::get(), Dictionary::known(), nest::names::post_synaptic_element(), post_synaptic_element_name_, nest::names::pre_synaptic_element(), pre_synaptic_element_name_, and use_structural_plasticity_.
Referenced by BipartiteConnBuilder().
|
private |
Set synapse specific parameters.
References Dictionary::get(), nest::ModelManager::get_connection_model(), nest::ModelManager::get_synapse_model_id(), nest::kernel(), Dictionary::known(), nest::KernelManager::model_manager, nest::names::synapse_model(), and synapse_model_id_.
Referenced by BipartiteConnBuilder().
|
private |
References Dictionary::at(), nest::ConnParameter::create(), nest::VPManager::get_num_threads(), nest::kernel(), Dictionary::known(), param_dicts_, register_parameters_requiring_skipping_(), skip_syn_params_, synapse_params_, and nest::KernelManager::vp_manager.
Referenced by BipartiteConnBuilder().
| void nest::BipartiteConnBuilder::set_synaptic_element_names | ( | const std::string & | pre_name, |
| const std::string & | post_name | ||
| ) |
References post_synaptic_element_name_, pre_synaptic_element_name_, and use_structural_plasticity_.
Referenced by nest::SPManager::disconnect().
|
protected |
Create connection between given nodes, fill parameter values.
References nest::ConnectionManager::connect(), nest::KernelManager::connection_manager, default_delay_, default_weight_, default_weight_and_delay_, delays_, nest::kernel(), numerics::nan, param_dicts_, requires_proxies(), synapse_model_id_, synapse_params_, nest::ThirdOutBuilder::third_connect(), third_out_, update_param_dict_(), and weights_.
Referenced by nest::ThirdInBuilder::connect_(), nest::OneToOneBuilder::connect_(), nest::FixedOutDegreeBuilder::connect_(), nest::FixedTotalNumberBuilder::connect_(), nest::SymmetricBernoulliBuilder::connect_(), nest::SPBuilder::connect_(), nest::BernoulliBuilder::inner_connect_(), nest::PoissonBuilder::inner_connect_(), nest::AllToAllBuilder::inner_connect_(), nest::FixedInDegreeBuilder::inner_connect_(), nest::OneToOneBuilder::sp_connect_(), nest::AllToAllBuilder::sp_connect_(), and nest::ThirdBernoulliWithPoolBuilder::third_connect().
|
inlineprotected |
References nest::SPManager::disconnect(), nest::kernel(), nest::KernelManager::sp_manager, and synapse_model_id_.
Referenced by nest::OneToOneBuilder::disconnect_(), nest::AllToAllBuilder::disconnect_(), nest::OneToOneBuilder::sp_disconnect_(), and nest::AllToAllBuilder::sp_disconnect_().
|
inlineprotected |
Moves pointer in parameter array.
Calls value-function of all parameters being instantiations of ArrayDoubleParameter or ArrayIntegerParameter, thus moving the pointer to the next parameter value. The function is called when the target node is not located on the current thread or MPI-process and read of an array.
References parameters_requiring_skipping_.
Referenced by nest::OneToOneBuilder::connect_(), nest::AllToAllBuilder::connect_(), nest::FixedInDegreeBuilder::connect_(), nest::FixedOutDegreeBuilder::connect_(), nest::BernoulliBuilder::connect_(), nest::PoissonBuilder::connect_(), nest::SPBuilder::connect_(), nest::AllToAllBuilder::inner_connect_(), nest::FixedInDegreeBuilder::inner_connect_(), nest::OneToOneBuilder::sp_connect_(), and nest::AllToAllBuilder::sp_connect_().
|
inlineprotectedvirtual |
Reimplemented in nest::OneToOneBuilder, and nest::AllToAllBuilder.
Referenced by connect().
|
inlineprotectedvirtual |
Reimplemented in nest::OneToOneBuilder, and nest::AllToAllBuilder.
Referenced by disconnect().
|
inlinevirtual |
Return true if rule allows creation of symmetric connectivity.
Reimplemented in nest::OneToOneBuilder, and nest::SymmetricBernoulliBuilder.
Referenced by connect().
|
protected |
References nest::kernel(), param_dicts_, and synapse_params_.
Referenced by single_connect_().
|
protected |
Referenced by allows_autapses(), BipartiteConnBuilder(), nest::OneToOneBuilder::connect_(), nest::FixedOutDegreeBuilder::connect_(), nest::FixedTotalNumberBuilder::connect_(), nest::SPBuilder::connect_(), nest::FixedOutDegreeBuilder::FixedOutDegreeBuilder(), nest::BernoulliBuilder::inner_connect_(), nest::PoissonBuilder::inner_connect_(), nest::AllToAllBuilder::inner_connect_(), nest::FixedInDegreeBuilder::inner_connect_(), nest::OneToOneBuilder::sp_connect_(), nest::AllToAllBuilder::sp_connect_(), and nest::SymmetricBernoulliBuilder::SymmetricBernoulliBuilder().
|
protected |
Referenced by allows_multapses(), BipartiteConnBuilder(), nest::FixedOutDegreeBuilder::connect_(), nest::FixedInDegreeBuilder::FixedInDegreeBuilder(), nest::FixedOutDegreeBuilder::FixedOutDegreeBuilder(), nest::FixedTotalNumberBuilder::FixedTotalNumberBuilder(), nest::FixedInDegreeBuilder::inner_connect_(), nest::PoissonBuilder::PoissonBuilder(), and nest::SymmetricBernoulliBuilder::SymmetricBernoulliBuilder().
|
protected |
Referenced by connect(), and nest::SymmetricBernoulliBuilder::SymmetricBernoulliBuilder().
|
private |
indicate that delay should not be set per synapse
Referenced by BipartiteConnBuilder(), get_default_delay(), set_default_weight_or_delay_(), and single_connect_().
|
private |
indicate that weight should not be set per synapse
Referenced by BipartiteConnBuilder(), set_default_weight_or_delay_(), and single_connect_().
|
private |
indicate that weight and delay should not be set per synapse
Referenced by BipartiteConnBuilder(), set_default_weight_or_delay_(), and single_connect_().
|
private |
|
protected |
buffer for exceptions raised in threads
Referenced by connect(), nest::OneToOneBuilder::connect_(), nest::AllToAllBuilder::connect_(), nest::FixedInDegreeBuilder::connect_(), nest::FixedOutDegreeBuilder::connect_(), nest::FixedTotalNumberBuilder::connect_(), nest::BernoulliBuilder::connect_(), nest::PoissonBuilder::connect_(), nest::SymmetricBernoulliBuilder::connect_(), nest::SPBuilder::connect_(), disconnect(), nest::OneToOneBuilder::disconnect_(), nest::AllToAllBuilder::disconnect_(), nest::SPBuilder::sp_connect(), nest::OneToOneBuilder::sp_connect_(), nest::AllToAllBuilder::sp_connect_(), nest::OneToOneBuilder::sp_disconnect_(), and nest::AllToAllBuilder::sp_disconnect_().
|
protected |
Referenced by BipartiteConnBuilder(), connect(), and nest::SymmetricBernoulliBuilder::SymmetricBernoulliBuilder().
|
protected |
Dictionaries to pass to connect function, one per thread for every syn_spec.
Outer dim: syn_spec, inner dim: thread
Referenced by BipartiteConnBuilder(), set_synapse_params(), single_connect_(), and update_param_dict_().
|
protected |
Pointers to connection parameters specified as arrays.
Referenced by loop_over_targets_(), register_parameters_requiring_skipping_(), and skip_conn_parameter_().
|
protected |
|
protected |
|
private |
synapse-specific parameters that should be skipped when we set default synapse parameters
Referenced by BipartiteConnBuilder(), and set_synapse_params().
|
protected |
Population to connect from.
Referenced by BipartiteConnBuilder(), connect(), nest::OneToOneBuilder::connect_(), nest::AllToAllBuilder::connect_(), nest::FixedOutDegreeBuilder::connect_(), nest::FixedTotalNumberBuilder::connect_(), nest::SymmetricBernoulliBuilder::connect_(), nest::OneToOneBuilder::disconnect_(), nest::AllToAllBuilder::disconnect_(), nest::FixedInDegreeBuilder::FixedInDegreeBuilder(), nest::FixedTotalNumberBuilder::FixedTotalNumberBuilder(), nest::BernoulliBuilder::inner_connect_(), nest::PoissonBuilder::inner_connect_(), nest::AllToAllBuilder::inner_connect_(), nest::FixedInDegreeBuilder::inner_connect_(), nest::AllToAllBuilder::is_symmetric(), nest::OneToOneBuilder::OneToOneBuilder(), nest::OneToOneBuilder::sp_connect_(), nest::AllToAllBuilder::sp_connect_(), nest::OneToOneBuilder::sp_disconnect_(), nest::AllToAllBuilder::sp_disconnect_(), and nest::ThirdBernoulliWithPoolBuilder::third_connect().
|
protected |
|
private |
all other parameters, mapping name to value representation
Referenced by all_parameters_scalar_(), BipartiteConnBuilder(), connect(), set_synapse_params(), single_connect_(), update_param_dict_(), and ~BipartiteConnBuilder().
|
protected |
Population to connect to.
Referenced by BipartiteConnBuilder(), connect(), nest::OneToOneBuilder::connect_(), nest::AllToAllBuilder::connect_(), nest::FixedInDegreeBuilder::connect_(), nest::FixedOutDegreeBuilder::connect_(), nest::FixedTotalNumberBuilder::connect_(), nest::BernoulliBuilder::connect_(), nest::PoissonBuilder::connect_(), nest::SymmetricBernoulliBuilder::connect_(), nest::OneToOneBuilder::disconnect_(), nest::AllToAllBuilder::disconnect_(), nest::FixedOutDegreeBuilder::FixedOutDegreeBuilder(), nest::FixedTotalNumberBuilder::FixedTotalNumberBuilder(), nest::AllToAllBuilder::is_symmetric(), loop_over_targets_(), nest::OneToOneBuilder::OneToOneBuilder(), nest::OneToOneBuilder::sp_connect_(), nest::AllToAllBuilder::sp_connect_(), nest::OneToOneBuilder::sp_disconnect_(), nest::AllToAllBuilder::sp_disconnect_(), nest::ThirdBernoulliWithPoolBuilder::ThirdBernoulliWithPoolBuilder(), and nest::ThirdBernoulliWithPoolBuilder::~ThirdBernoulliWithPoolBuilder().
|
protected |
To be triggered when primary connection is created.
Referenced by BipartiteConnBuilder(), and single_connect_().
|
protected |
|
private |