NEST main@caf0ae8
 
Loading...
Searching...
No Matches
sp_manager.h
Go to the documentation of this file.
1/*
2 * sp_manager.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef SP_MANAGER_H
24#define SP_MANAGER_H
25
26// C++ includes:
27#include <vector>
28
29// Includes from libnestutil:
30#include "manager_interface.h"
31
32// Includes from nestkernel:
34#include "nest_time.h"
35#include "nest_types.h"
36#include "node_collection.h"
37
38
39namespace nest
40{
41class Node;
42
43class SPBuilder;
44
53{
54
55public:
56 SPManager();
57 ~SPManager() override;
58
59 void initialize( const bool ) override;
60 void finalize( const bool ) override;
61
62 void get_status( Dictionary& ) override;
63
70 void set_status( const Dictionary& ) override;
71
78 GrowthCurve* new_growth_curve( std::string name );
79
83 template < typename GrowthCurve >
84 void register_growth_curve( const std::string& name );
85
101 void disconnect( NodeCollectionPTR sources,
102 NodeCollectionPTR targets,
103 const Dictionary& conn_spec,
104 const std::vector< Dictionary >& syn_specs );
105
118 void disconnect( const size_t snode_id, Node* target, size_t target_thread, const size_t syn_id );
119
122
127
132
134
136
145 long builder_min_delay() const;
146
155 long builder_max_delay() const;
156
157 // Creation of synapses
158 bool create_synapses( std::vector< size_t >& pre_vacant_id,
159 std::vector< int >& pre_vacant_n,
160 std::vector< size_t >& post_vacant_id,
161 std::vector< int >& post_vacant_n,
162 SPBuilder* sp_conn_builder );
163 // Deletion of synapses on the pre synaptic side
164 void delete_synapses_from_pre( const std::vector< size_t >& pre_deleted_id,
165 std::vector< int >& pre_deleted_n,
166 const size_t synapse_model,
167 const std::string& se_pre_name,
168 const std::string& se_post_name );
169 // Deletion of synapses on the postsynaptic side
170 void delete_synapses_from_post( std::vector< size_t >& post_deleted_id,
171 std::vector< int >& post_deleted_n,
172 size_t synapse_model,
173 std::string se_pre_name,
174 std::string se_post_name );
175 // Deletion of synapses
176 void delete_synapse( size_t source, size_t target, long syn_id, std::string se_pre_name, std::string se_post_name );
177
178 void get_synaptic_elements( std::string se_name,
179 std::vector< size_t >& se_vacant_id,
180 std::vector< int >& se_vacant_n,
181 std::vector< size_t >& se_deleted_id,
182 std::vector< int >& se_deleted_n );
183
184 void serialize_id( std::vector< size_t >& id, std::vector< int >& n, std::vector< size_t >& res );
185
186private:
192
198 std::vector< SPBuilder* > sp_conn_builders_;
199
203 std::vector< GenericGrowthCurveFactory* > growthcurve_factories_;
204
206};
207
208inline GrowthCurve*
210{
211 const long nc_id = growthcurvedict_.get< long >( name );
212 return growthcurve_factories_.at( nc_id )->create();
213}
214
215inline bool
220
221inline double
226
227} // namespace nest
228
229#endif /* #ifndef SP_MANAGER_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
T get(const std::string &key) const
Get the value at key in the specified type.
Definition dictionary.h:710
Defines the way the number of synaptic elements changes through time according to the calcium concent...
Definition growth_curve.h:50
Interface for kernel manager classes.
Definition manager_interface.h:46
Base class for all NEST network objects.
Definition node.h:99
Definition conn_builder.h:773
The SPManager class is in charge of managing the dynamic creation and deletion of synapses in the sim...
Definition sp_manager.h:53
void initialize(const bool) override
Prepare manager for operation.
Definition sp_manager.cpp:55
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)
Definition sp_manager.cpp:562
long builder_max_delay() const
Returns the maximum delay of all SP builders.
Definition sp_manager.cpp:184
bool structural_plasticity_enabled_
Indicates whether the Structrual Plasticity functionality is On (True) of Off (False).
Definition sp_manager.h:197
double get_structural_plasticity_update_interval() const
Definition sp_manager.h:222
std::vector< SPBuilder * > sp_conn_builders_
Definition sp_manager.h:198
~SPManager() override
Definition sp_manager.cpp:50
void register_growth_curve(const std::string &name)
Add a growth curve for MSP.
Definition sp_manager_impl.h:40
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)
Definition sp_manager.cpp:515
void disconnect(NodeCollectionPTR sources, NodeCollectionPTR targets, const Dictionary &conn_spec, const std::vector< Dictionary > &syn_specs)
Disconnect two collections of nodes.
Definition sp_manager.cpp:238
SPManager()
Definition sp_manager.cpp:40
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)
Definition sp_manager.cpp:407
bool is_structural_plasticity_enabled() const
Definition sp_manager.h:216
void update_structural_plasticity()
Definition sp_manager.cpp:319
void serialize_id(std::vector< size_t > &id, std::vector< int > &n, std::vector< size_t > &res)
Definition sp_manager.cpp:624
long builder_min_delay() const
Returns the minimum delay of all SP builders.
Definition sp_manager.cpp:170
Dictionary growthcurvedict_
Dictionary for growth rules.
Definition sp_manager.h:205
std::vector< GenericGrowthCurveFactory * > growthcurve_factories_
GrowthCurve factories, indexed by growthcurvedict_ elements.
Definition sp_manager.h:203
void enable_structural_plasticity()
Enable structural plasticity.
Definition sp_manager.cpp:643
GrowthCurve * new_growth_curve(std::string name)
Create a new Growth Curve object using the GrowthCurve Factory.
Definition sp_manager.h:209
void finalize(const bool) override
Take down manager after operation.
Definition sp_manager.cpp:70
void get_status(Dictionary &) override
Retrieve the status of the manager.
Definition sp_manager.cpp:90
void set_status(const Dictionary &) override
Set status of synaptic plasticity variables: synaptic update interval, synapses and synaptic elements...
Definition sp_manager.cpp:119
double structural_plasticity_update_interval_
Time interval for structural plasticity update (creation/deletion of synapses).
Definition sp_manager.h:191
void disable_structural_plasticity()
Disable structural plasticity.
Definition sp_manager.cpp:665
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)
Definition sp_manager.cpp:439
void delete_synapse(size_t source, size_t target, long syn_id, std::string se_pre_name, std::string se_post_name)
Definition sp_manager.cpp:483
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
std::shared_ptr< NodeCollection > NodeCollectionPTR
Definition node_collection.h:50