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

The SPManager class is in charge of managing the dynamic creation and deletion of synapses in the simulation when structural plasticity is enabled. More...

#include <sp_manager.h>

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

Public Member Functions

 SPManager ()
 
 ~SPManager () override
 
void initialize (const bool) override
 Prepare manager for operation.
 
void finalize (const bool) override
 Take down manager after operation.
 
void get_status (Dictionary &) override
 Retrieve the status of the manager.
 
void set_status (const Dictionary &) override
 Set status of synaptic plasticity variables: synaptic update interval, synapses and synaptic elements.
 
GrowthCurve * new_growth_curve (std::string name)
 Create a new Growth Curve object using the GrowthCurve Factory.
 
template<typename GrowthCurve >
void register_growth_curve (const std::string &name)
 Add a growth curve for MSP.
 
void disconnect (NodeCollectionPTR sources, NodeCollectionPTR targets, const Dictionary &conn_spec, const std::vector< Dictionary > &syn_specs)
 Disconnect two collections of nodes.
 
void disconnect (const size_t snode_id, Node *target, size_t target_thread, const size_t syn_id)
 Disconnect two nodes.
 
void update_structural_plasticity ()
 
void update_structural_plasticity (SPBuilder *)
 
void enable_structural_plasticity ()
 Enable structural plasticity.
 
void disable_structural_plasticity ()
 Disable structural plasticity.
 
bool is_structural_plasticity_enabled () const
 
double get_structural_plasticity_update_interval () const
 
long builder_min_delay () const
 Returns the minimum delay of all SP builders.
 
long builder_max_delay () const
 Returns the maximum delay of all SP builders.
 
bool create_synapses (std::vector< size_t > &pre_vacant_id, std::vector< int > &pre_vacant_n, std::vector< size_t > &post_vacant_id, std::vector< int > &post_vacant_n, SPBuilder *sp_conn_builder)
 
void delete_synapses_from_pre (const std::vector< size_t > &pre_deleted_id, std::vector< int > &pre_deleted_n, const size_t synapse_model, const std::string &se_pre_name, const std::string &se_post_name)
 
void delete_synapses_from_post (std::vector< size_t > &post_deleted_id, std::vector< int > &post_deleted_n, size_t synapse_model, std::string se_pre_name, std::string se_post_name)
 
void delete_synapse (size_t source, size_t target, long syn_id, std::string se_pre_name, std::string se_post_name)
 
void get_synaptic_elements (std::string se_name, std::vector< size_t > &se_vacant_id, std::vector< int > &se_vacant_n, std::vector< size_t > &se_deleted_id, std::vector< int > &se_deleted_n)
 
void serialize_id (std::vector< size_t > &id, std::vector< int > &n, std::vector< size_t > &res)
 
- Public Member Functions inherited from nest::ManagerInterface
 ManagerInterface (ManagerInterface const &)=delete
 
void operator= (ManagerInterface const &)=delete
 
 ManagerInterface ()
 
virtual ~ManagerInterface ()
 
virtual void prepare ()
 
virtual void cleanup ()
 

Private Attributes

double structural_plasticity_update_interval_
 Time interval for structural plasticity update (creation/deletion of synapses).
 
bool structural_plasticity_enabled_
 Indicates whether the Structrual Plasticity functionality is On (True) of Off (False).
 
std::vector< SPBuilder * > sp_conn_builders_
 
std::vector< GenericGrowthCurveFactory * > growthcurve_factories_
 GrowthCurve factories, indexed by growthcurvedict_ elements.
 
Dictionary growthcurvedict_
 Dictionary for growth rules.
 

Detailed Description

The SPManager class is in charge of managing the dynamic creation and deletion of synapses in the simulation when structural plasticity is enabled.

Otherwise it behaves as the normal ConnectionManager.

Parameters

Constructor & Destructor Documentation

◆ SPManager()

nest::SPManager::SPManager ( )

◆ ~SPManager()

nest::SPManager::~SPManager ( )
override

Member Function Documentation

◆ builder_max_delay()

long nest::SPManager::builder_max_delay ( ) const

Returns the maximum delay of all SP builders.

This influences the max_delay of the kernel, as the connections are build during the simulation. Hence, the ConnectionManager::max_delay() methods have to respect this delay as well.

References nest::Time::get_steps(), nest::Time::neg_inf(), and sp_conn_builders_.

Here is the call graph for this function:

◆ builder_min_delay()

long nest::SPManager::builder_min_delay ( ) const

Returns the minimum delay of all SP builders.

This influences the min_delay of the kernel, as the connections are build during the simulation. Hence, the ConnectionManager::min_delay() methods have to respect this delay as well.

References nest::Time::get_steps(), nest::Time::pos_inf(), and sp_conn_builders_.

Here is the call graph for this function:

◆ create_synapses()

bool nest::SPManager::create_synapses ( std::vector< size_t > &  pre_vacant_id,
std::vector< int > &  pre_vacant_n,
std::vector< size_t > &  post_vacant_id,
std::vector< int > &  post_vacant_n,
SPBuilder *  sp_conn_builder 
)

References nest::get_rank_synced_rng(), nest::BaseRandomGenerator::partial_shuffle(), serialize_id(), and nest::SPBuilder::sp_connect().

Referenced by update_structural_plasticity().

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

◆ delete_synapse()

void nest::SPManager::delete_synapse ( size_t  source,
size_t  target,
long  syn_id,
std::string  se_pre_name,
std::string  se_post_name 
)

References nest::KernelManager::connection_manager, nest::ConnectionManager::disconnect(), nest::NodeManager::get_node_or_proxy(), nest::VPManager::get_thread_id(), nest::kernel(), nest::KernelManager::node_manager, and nest::KernelManager::vp_manager.

Referenced by delete_synapses_from_post(), and delete_synapses_from_pre().

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

◆ delete_synapses_from_post()

void nest::SPManager::delete_synapses_from_post ( std::vector< size_t > &  post_deleted_id,
std::vector< int > &  post_deleted_n,
size_t  synapse_model,
std::string  se_pre_name,
std::string  se_post_name 
)

References nest::MPIManager::communicate(), nest::KernelManager::connection_manager, delete_synapse(), nest::get_rank_synced_rng(), nest::ConnectionManager::get_sources(), nest::kernel(), nest::KernelManager::mpi_manager, and nest::BaseRandomGenerator::partial_shuffle().

Referenced by update_structural_plasticity().

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

◆ delete_synapses_from_pre()

void nest::SPManager::delete_synapses_from_pre ( const std::vector< size_t > &  pre_deleted_id,
std::vector< int > &  pre_deleted_n,
const size_t  synapse_model,
const std::string &  se_pre_name,
const std::string &  se_post_name 
)

References nest::MPIManager::communicate(), nest::KernelManager::connection_manager, delete_synapse(), nest::get_rank_synced_rng(), nest::ConnectionManager::get_targets(), nest::kernel(), nest::KernelManager::mpi_manager, and nest::BaseRandomGenerator::partial_shuffle().

Referenced by update_structural_plasticity().

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

◆ disable_structural_plasticity()

void nest::SPManager::disable_structural_plasticity ( )

Disable structural plasticity.

References structural_plasticity_enabled_.

Referenced by nest::disable_structural_plasticity().

Here is the caller graph for this function:

◆ disconnect() [1/2]

void nest::SPManager::disconnect ( const size_t  snode_id,
Node *  target,
size_t  target_thread,
const size_t  syn_id 
)

Disconnect two nodes.

The source node is defined by its global ID. The target node is defined by the node. The connection is established on the thread/process that owns the target node.

Parameters
snode_idnode ID of the sending Node.
targetPointer to target Node.
target_threadThread that hosts the target node.
syn_idThe synapse model to use.

References nest::KernelManager::connection_manager, nest::ConnectionManager::disconnect(), nest::NodeManager::get_node_or_proxy(), nest::VPManager::get_num_threads(), nest::kernel(), nest::KernelManager::node_manager, and nest::KernelManager::vp_manager.

Here is the call graph for this function:

◆ disconnect() [2/2]

void nest::SPManager::disconnect ( NodeCollectionPTR  sources,
NodeCollectionPTR  targets,
const Dictionary &  conn_spec,
const std::vector< Dictionary > &  syn_specs 
)

Disconnect two collections of nodes.

The connection is established on the thread/process that owns the target node.

Obtains the right connection builder and performs a synapse deletion according to the specified connection specs.

Parameters
sourcesNode collection of the source Nodes.
targetsNode collection of the target Nodes.
connectivityParams connectivity Dictionary
synapseParams synapse parameters Dictionary conn_spec disconnection specs. For now only all to all and one to one rules are implemented.

References Dictionary::all_entries_accessed(), nest::KernelManager::connection_manager, nest::BipartiteConnBuilder::disconnect(), Dictionary::get(), nest::ConnectionManager::get_conn_builder(), nest::ModelManager::get_synapse_model_id(), nest::VPManager::get_thread_id(), Dictionary::init_access_flags(), nest::kernel(), Dictionary::known(), nest::KernelManager::model_manager, nest::KernelManager::node_manager, nest::names::rule(), nest::ConnectionManager::set_connections_have_changed(), nest::BipartiteConnBuilder::set_synaptic_element_names(), nest::KernelManager::simulation_manager, sp_conn_builders_, nest::names::synapse_model(), nest::SimulationManager::update_connection_infrastructure(), nest::NodeManager::update_thread_local_node_data(), nest::ConnectionManager::valid_connection_rule(), and nest::KernelManager::vp_manager.

Referenced by nest::disconnect(), nest::disconnect(), and nest::BipartiteConnBuilder::single_disconnect_().

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

◆ enable_structural_plasticity()

void nest::SPManager::enable_structural_plasticity ( )

Enable structural plasticity.

References nest::kernel(), and structural_plasticity_enabled_.

Referenced by nest::enable_structural_plasticity().

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

◆ finalize()

void nest::SPManager::finalize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Take down manager after operation.

After this method has completed, all dynamic data structures created by the manager shall be deallocated and containers emptied. Plain variables need not be reset.

Note
Finalization of any given manager may depend on other managers not having been finalized yet. KernelManager::finalize() is responsible for calling the initialization routines on the specific managers in correct order, i.e., the opposite order of initialize() calls.
Parameters
adjust_number_of_threads_or_rng_onlyPass true if calling from kernel_manager::change_number_of_threads() to limit operations to those necessary for thread adjustment.
See also
initialize()

Implements nest::ManagerInterface.

References Dictionary::clear(), growthcurve_factories_, growthcurvedict_, and sp_conn_builders_.

Here is the call graph for this function:

◆ get_status()

void nest::SPManager::get_status ( Dictionary &  )
overridevirtual

Retrieve the status of the manager.

Note
This would ideally be a const function. However, some managers delay the update of internal variables up to the point where they are needed (e.g., before reporting their values to the user, or before simulate is called). An example for this pattern is the call to update_delay_extrema_() right at the beginning of ConnectionManager::get_status().
See also
set_status()

Implements nest::ManagerInterface.

References nest::names::allow_autapses(), nest::names::allow_multapses(), nest::ModelManager::get_connection_model(), nest::ConnectorModel::get_name(), nest::names::growth_curves(), growthcurvedict_, nest::kernel(), nest::KernelManager::model_manager, nest::names::post_synaptic_element(), nest::names::pre_synaptic_element(), sp_conn_builders_, nest::names::structural_plasticity_synapses(), nest::names::structural_plasticity_update_interval(), structural_plasticity_update_interval_, and nest::names::synapse_model().

Here is the call graph for this function:

◆ get_structural_plasticity_update_interval()

double nest::SPManager::get_structural_plasticity_update_interval ( ) const
inline

◆ get_synaptic_elements()

void nest::SPManager::get_synaptic_elements ( std::string  se_name,
std::vector< size_t > &  se_vacant_id,
std::vector< int > &  se_vacant_n,
std::vector< size_t > &  se_deleted_id,
std::vector< int > &  se_deleted_n 
)

References nest::SparseNodeArray::begin(), nest::SparseNodeArray::end(), nest::NodeManager::get_local_nodes(), nest::VPManager::get_num_threads(), nest::Node::get_synaptic_elements_vacant(), nest::kernel(), nest::KernelManager::node_manager, nest::NodeManager::size(), and nest::KernelManager::vp_manager.

Referenced by update_structural_plasticity().

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

◆ initialize()

void nest::SPManager::initialize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Prepare manager for operation.

After this method has completed, the manager should be completely initialized and "ready for action".

Note
Initialization of any given manager may depend on other managers having been initialized before. KernelManager::initialize() is responsible for calling the initialization routines on the specific managers in correct order.
Parameters
adjust_number_of_threads_or_rng_onlyPass true if calling from kernel_manager::change_number_of_threads() or RandomManager::get_status() to limit operations to those necessary for thread adjustment or switch or re-seeding of RNG.
See also
finalize()

Implements nest::ManagerInterface.

References structural_plasticity_enabled_, and structural_plasticity_update_interval_.

◆ is_structural_plasticity_enabled()

bool nest::SPManager::is_structural_plasticity_enabled ( ) const
inline

References structural_plasticity_enabled_.

Referenced by nest::KernelManager::change_number_of_threads().

Here is the caller graph for this function:

◆ new_growth_curve()

GrowthCurve * nest::SPManager::new_growth_curve ( std::string  name)
inline

Create a new Growth Curve object using the GrowthCurve Factory.

Parameters
namewhich defines the type of NC to be created
Returns
a new Growth Curve object of the type indicated by name

References Dictionary::get(), growthcurve_factories_, and growthcurvedict_.

Referenced by nest::SynapticElement::operator=(), nest::SynapticElement::set(), and nest::SynapticElement::SynapticElement().

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

◆ register_growth_curve()

template<typename GrowthCurve >
void nest::SPManager::register_growth_curve ( const std::string &  name)

Add a growth curve for MSP.

References growthcurve_factories_, growthcurvedict_, and Dictionary::known().

Here is the call graph for this function:

◆ serialize_id()

void nest::SPManager::serialize_id ( std::vector< size_t > &  id,
std::vector< int > &  n,
std::vector< size_t > &  res 
)

Referenced by create_synapses().

Here is the caller graph for this function:

◆ set_status()

void nest::SPManager::set_status ( const Dictionary &  d)
overridevirtual

Set status of synaptic plasticity variables: synaptic update interval, synapses and synaptic elements.

Parameters
ddictionary containing the values to be set

Implements nest::ManagerInterface.

References nest::names::allow_autapses(), nest::names::allow_multapses(), Dictionary::get(), nest::BipartiteConnBuilder::get_default_delay(), nest::kernel(), nest::SPBuilder::set_name(), sp_conn_builders_, nest::names::structural_plasticity_synapses(), nest::names::structural_plasticity_update_interval(), and structural_plasticity_update_interval_.

Here is the call graph for this function:

◆ update_structural_plasticity() [1/2]

void nest::SPManager::update_structural_plasticity ( )

References sp_conn_builders_, and update_structural_plasticity().

Referenced by nest::SimulationManager::update_(), and update_structural_plasticity().

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

◆ update_structural_plasticity() [2/2]

Member Data Documentation

◆ growthcurve_factories_

std::vector< GenericGrowthCurveFactory* > nest::SPManager::growthcurve_factories_
private

GrowthCurve factories, indexed by growthcurvedict_ elements.

Referenced by finalize(), new_growth_curve(), and register_growth_curve().

◆ growthcurvedict_

Dictionary nest::SPManager::growthcurvedict_
private

◆ sp_conn_builders_

std::vector< SPBuilder* > nest::SPManager::sp_conn_builders_
private

◆ structural_plasticity_enabled_

bool nest::SPManager::structural_plasticity_enabled_
private

Indicates whether the Structrual Plasticity functionality is On (True) of Off (False).

Referenced by disable_structural_plasticity(), enable_structural_plasticity(), initialize(), and is_structural_plasticity_enabled().

◆ structural_plasticity_update_interval_

double nest::SPManager::structural_plasticity_update_interval_
private

Time interval for structural plasticity update (creation/deletion of synapses).

Referenced by get_status(), get_structural_plasticity_update_interval(), initialize(), and set_status().


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