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>
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. | |
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.
| nest::SPManager::SPManager | ( | ) |
|
override |
| 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_.
| 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_.
| 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().
| 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().
| 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().
| 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().
| void nest::SPManager::disable_structural_plasticity | ( | ) |
Disable structural plasticity.
References structural_plasticity_enabled_.
Referenced by nest::disable_structural_plasticity().
| 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.
| snode_id | node ID of the sending Node. |
| target | Pointer to target Node. |
| target_thread | Thread that hosts the target node. |
| syn_id | The 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.
| 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.
| sources | Node collection of the source Nodes. |
| targets | Node collection of the target Nodes. |
| connectivity | Params connectivity Dictionary |
| synapse | Params 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_().
| void nest::SPManager::enable_structural_plasticity | ( | ) |
Enable structural plasticity.
References nest::kernel(), and structural_plasticity_enabled_.
Referenced by nest::enable_structural_plasticity().
|
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.
| adjust_number_of_threads_or_rng_only | Pass true if calling from kernel_manager::change_number_of_threads() to limit operations to those necessary for thread adjustment. |
Implements nest::ManagerInterface.
References Dictionary::clear(), growthcurve_factories_, growthcurvedict_, and sp_conn_builders_.
|
overridevirtual |
Retrieve the status of the manager.
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().
|
inline |
References structural_plasticity_update_interval_.
| 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().
|
overridevirtual |
Prepare manager for operation.
After this method has completed, the manager should be completely initialized and "ready for action".
| adjust_number_of_threads_or_rng_only | Pass 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. |
Implements nest::ManagerInterface.
References structural_plasticity_enabled_, and structural_plasticity_update_interval_.
|
inline |
References structural_plasticity_enabled_.
Referenced by nest::KernelManager::change_number_of_threads().
|
inline |
Create a new Growth Curve object using the GrowthCurve Factory.
| name | which defines the type of NC to be created |
References Dictionary::get(), growthcurve_factories_, and growthcurvedict_.
Referenced by nest::SynapticElement::operator=(), nest::SynapticElement::set(), and nest::SynapticElement::SynapticElement().
| void nest::SPManager::register_growth_curve | ( | const std::string & | name | ) |
Add a growth curve for MSP.
References growthcurve_factories_, growthcurvedict_, and Dictionary::known().
| void nest::SPManager::serialize_id | ( | std::vector< size_t > & | id, |
| std::vector< int > & | n, | ||
| std::vector< size_t > & | res | ||
| ) |
|
overridevirtual |
Set status of synaptic plasticity variables: synaptic update interval, synapses and synaptic elements.
| d | dictionary 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_.
| void nest::SPManager::update_structural_plasticity | ( | ) |
References sp_conn_builders_, and update_structural_plasticity().
Referenced by nest::SimulationManager::update_(), and update_structural_plasticity().
| void nest::SPManager::update_structural_plasticity | ( | SPBuilder * | sp_builder | ) |
References nest::MPIManager::communicate(), nest::KernelManager::connection_manager, create_synapses(), delete_synapses_from_post(), delete_synapses_from_pre(), nest::SPBuilder::get_post_synaptic_element_name(), nest::SPBuilder::get_pre_synaptic_element_name(), nest::BipartiteConnBuilder::get_synapse_model(), get_synaptic_elements(), nest::kernel(), nest::KernelManager::mpi_manager, and nest::ConnectionManager::set_connections_have_changed().
|
private |
GrowthCurve factories, indexed by growthcurvedict_ elements.
Referenced by finalize(), new_growth_curve(), and register_growth_curve().
|
private |
Dictionary for growth rules.
Referenced by finalize(), get_status(), new_growth_curve(), and register_growth_curve().
|
private |
Referenced by builder_max_delay(), builder_min_delay(), disconnect(), finalize(), get_status(), set_status(), and update_structural_plasticity().
|
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().
|
private |
Time interval for structural plasticity update (creation/deletion of synapses).
Referenced by get_status(), get_structural_plasticity_update_interval(), initialize(), and set_status().