NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::ThirdBernoulliWithPoolBuilder Class Reference

Build third-factor connectivity based on Bernoulli trials, selecting third factor nodes from a fixed pool per target node. More...

#include <conn_builder.h>

Inheritance diagram for nest::ThirdBernoulliWithPoolBuilder:
[legend]
Collaboration diagram for nest::ThirdBernoulliWithPoolBuilder:
[legend]

Public Member Functions

 ThirdBernoulliWithPoolBuilder (NodeCollectionPTR, NodeCollectionPTR, ThirdInBuilder *, const Dictionary &, const std::vector< Dictionary > &)
 
 ~ThirdBernoulliWithPoolBuilder ()
 
void third_connect (size_t source_gid, Node &target) override
 Create third-factor connection for given primary connection.
 
- Public Member Functions inherited from nest::ThirdOutBuilder
 ThirdOutBuilder (const NodeCollectionPTR third, const NodeCollectionPTR targets, ThirdInBuilder *third_in, const Dictionary &third_conn_spec, const std::vector< Dictionary > &syn_specs)
 Create ThirdOutBuilder.
 
void connect () override final
 Only call third_connect() on ThirdOutBuilder.
 
- Public Member Functions inherited from nest::BipartiteConnBuilder
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.
 

Private Types

typedef std::vector< NodeIDTriple > PoolType_
 Type for single pool of third-factor nodes.
 
typedef std::map< size_t, PoolType_ > TgtPoolMap_
 Type mapping target GID to pool for this target.
 

Private Member Functions

void connect_ () override
 only call third_connect()
 
size_t get_first_pool_index_ (const size_t target_index) const
 For block pool, return index of first pool element for given target node.
 

Private Attributes

double p_
 probability of creating a third-factor connection
 
bool random_pool_
 random or block pool?
 
size_t pool_size_
 number of nodes per pool
 
size_t targets_per_third_
 number of target nodes per third-factor node
 
std::vector< TgtPoolMap_ * > pools_
 Thread-specific pools of third-factor nodes.
 

Additional Inherited Members

- Protected Member Functions inherited from nest::BipartiteConnBuilder
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 inherited from nest::ThirdOutBuilder
ThirdInBuilder * third_in_
 
- Protected Attributes inherited from nest::BipartiteConnBuilder
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.
 

Detailed Description

Build third-factor connectivity based on Bernoulli trials, selecting third factor nodes from a fixed pool per target node.

Member Typedef Documentation

◆ PoolType_

Type for single pool of third-factor nodes.

Todo:
Could probably be BlockVector, but currently some problem with back_inserter when sampling pool.

◆ TgtPoolMap_

typedef std::map< size_t, PoolType_ > nest::ThirdBernoulliWithPoolBuilder::TgtPoolMap_
private

Type mapping target GID to pool for this target.

Constructor & Destructor Documentation

◆ ThirdBernoulliWithPoolBuilder()

nest::ThirdBernoulliWithPoolBuilder::ThirdBernoulliWithPoolBuilder ( NodeCollectionPTR  third,
NodeCollectionPTR  targets,
ThirdInBuilder *  third_in,
const Dictionary &  conn_spec,
const std::vector< Dictionary > &  syn_specs 
)

◆ ~ThirdBernoulliWithPoolBuilder()

nest::ThirdBernoulliWithPoolBuilder::~ThirdBernoulliWithPoolBuilder ( )

References nest::NodeManager::get_node_or_proxy(), nest::VPManager::get_thread_id(), nest::Node::is_proxy(), nest::kernel(), nest::KernelManager::node_manager, pools_, random_pool_, nest::Node::set_tmp_nc_index(), nest::BipartiteConnBuilder::targets_, and nest::KernelManager::vp_manager.

Here is the call graph for this function:

Member Function Documentation

◆ connect_()

void nest::ThirdBernoulliWithPoolBuilder::connect_ ( )
inlineoverrideprivatevirtual

◆ get_first_pool_index_()

size_t nest::ThirdBernoulliWithPoolBuilder::get_first_pool_index_ ( const size_t  target_index) const
private

For block pool, return index of first pool element for given target node.

Parameters
targe_index

References pool_size_, and targets_per_third_.

Referenced by third_connect().

Here is the caller graph for this function:

◆ third_connect()

void nest::ThirdBernoulliWithPoolBuilder::third_connect ( size_t  source_gid,
Node &  target 
)
overridevirtual

Create third-factor connection for given primary connection.

Parameters
source_gidGID of source of primary connection
targetTarget node of primary connection

Implements nest::ThirdOutBuilder.

References nest::BaseRandomGenerator::drand(), get_first_pool_index_(), nest::Node::get_node_id(), nest::VPManager::get_thread_id(), nest::Node::get_tmp_nc_index(), nest::get_vp_specific_rng(), nest::kernel(), p_, pool_size_, pools_, random_pool_, nest::ThirdInBuilder::register_connection(), nest::BipartiteConnBuilder::single_connect_(), nest::BipartiteConnBuilder::sources_, nest::BaseRandomGenerator::stable_sample(), nest::ThirdOutBuilder::third_in_, nest::BaseRandomGenerator::ulrand(), and nest::KernelManager::vp_manager.

Here is the call graph for this function:

Member Data Documentation

◆ p_

double nest::ThirdBernoulliWithPoolBuilder::p_
private

probability of creating a third-factor connection

Referenced by third_connect(), and ThirdBernoulliWithPoolBuilder().

◆ pool_size_

size_t nest::ThirdBernoulliWithPoolBuilder::pool_size_
private

number of nodes per pool

Referenced by get_first_pool_index_(), third_connect(), and ThirdBernoulliWithPoolBuilder().

◆ pools_

std::vector< TgtPoolMap_* > nest::ThirdBernoulliWithPoolBuilder::pools_
private

Thread-specific pools of third-factor nodes.

Each thread maintains a map from target node IDs to the third-factor node pool for that target node. Since each target lives on exactly one thread, there will be no overlap. For each node, the pool is created when a third-factor connection needs to be made to that node for the first time. The pools are deleted when the ConnBuilder is destroyed at the end of the connect call. We store a pointer instead of the map itself to ensure that the map is in thread-local memory.

Referenced by third_connect(), ThirdBernoulliWithPoolBuilder(), and ~ThirdBernoulliWithPoolBuilder().

◆ random_pool_

bool nest::ThirdBernoulliWithPoolBuilder::random_pool_
private

◆ targets_per_third_

size_t nest::ThirdBernoulliWithPoolBuilder::targets_per_third_
private

number of target nodes per third-factor node

Referenced by get_first_pool_index_().


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