NEST  2.6.0,not_revisioned_source_dir@0
conn_builder.h
Go to the documentation of this file.
1 /*
2  * conn_builder.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 CONN_BUILDER_H
24 #define CONN_BUILDER_H
25 
34 #include <map>
35 #include <vector>
36 
37 #include "dictdatum.h"
38 #include "gid_collection.h"
39 #include "lockptr.h"
40 #include "sliexceptions.h"
41 
42 #include "gslrandomgen.h"
43 
44 namespace nest {
45 
46  class Network;
47  class Node;
48  class ConnParameter;
49 
61  {
62  public:
63 
73  virtual void connect();
74 
77  const GIDCollection&, const GIDCollection&,
78  const DictionaryDatum&, const DictionaryDatum&);
79  virtual ~ConnBuilder();
80 
81  protected:
82 
84  virtual void connect_() =0;
85 
88 
90 
93 
94  bool autapses_;
95  bool multapses_;
96 
98  std::vector<lockPTR<WrappedThreadException> > exceptions_raised_;
99 
100  private:
101  typedef std::map<Name, ConnParameter*> ConnParameterMap;
102 
104 
107 
110 
111  // null-pointer indicates that default be used
114 
117 
119  std::vector<DictionaryDatum> param_dicts_;
120 
121  // check for synapse specific errors or warnings
122  // This is a temporary function which should be removed once all parameter types work with Connect.
123  // The remaining error and warnings should then be handled within the synapse model.
124  void check_synapse_params_(std::string, const DictionaryDatum& );
125  };
126 
128  {
129  public:
131  const GIDCollection& sources,
132  const GIDCollection& targets,
133  const DictionaryDatum& conn_spec,
134  const DictionaryDatum& syn_spec)
135  : ConnBuilder(net, sources, targets, conn_spec, syn_spec)
136  {}
137 
138  protected:
139  void connect_();
140  };
141 
143  {
144  public:
146  const GIDCollection& sources,
147  const GIDCollection& targets,
148  const DictionaryDatum& conn_spec,
149  const DictionaryDatum& syn_spec)
150  : ConnBuilder(net, sources, targets, conn_spec, syn_spec)
151  {}
152 
153  protected:
154  void connect_();
155  };
156 
157 
159  {
160  public:
162  const GIDCollection&,
163  const GIDCollection&,
164  const DictionaryDatum&,
165  const DictionaryDatum&);
166 
167  protected:
168  void connect_();
169 
170  private:
171  long indegree_;
172  };
173 
175  {
176  public:
178  const GIDCollection&,
179  const GIDCollection&,
180  const DictionaryDatum&,
181  const DictionaryDatum&);
182 
183  protected:
184  void connect_();
185 
186  private:
187  long outdegree_;
188  };
189 
191  {
192  public:
194  const GIDCollection&,
195  const GIDCollection&,
196  const DictionaryDatum&,
197  const DictionaryDatum&);
198 
199  protected:
200  void connect_();
201 
202  private:
203  long N_;
204  };
205 
207  {
208  public:
210  const GIDCollection&,
211  const GIDCollection&,
212  const DictionaryDatum&,
213  const DictionaryDatum&);
214 
215  protected:
216  void connect_();
217 
218  private:
219  double p_;
220  };
221 
222 
223 } // namespace nest
224 
225 #endif
size_t index
Unsigned long type for enumerations.
Definition: nest.h:109
bool multapses_
Definition: conn_builder.h:95
void check_synapse_params_(std::string, const DictionaryDatum &)
Definition: conn_builder.cpp:179
std::map< Name, ConnParameter * > ConnParameterMap
Definition: conn_builder.h:101
void single_connect_(index, Node &, thread, librandom::RngPtr &)
Create connection between given nodes, fill parameter values.
Definition: conn_builder.cpp:261
Definition: conn_builder.h:190
FixedTotalNumberBuilder(Network &, const GIDCollection &, const GIDCollection &, const DictionaryDatum &, const DictionaryDatum &)
Definition: conn_builder.cpp:602
long indegree_
Definition: conn_builder.h:171
bool default_weight_
indicate that weight should not be set per synapse
Definition: conn_builder.h:109
void connect_()
Implements the actual connection algorithm.
Definition: conn_builder.cpp:529
virtual ~ConnBuilder()
Definition: conn_builder.cpp:167
OneToOneBuilder(Network &net, const GIDCollection &sources, const GIDCollection &targets, const DictionaryDatum &conn_spec, const DictionaryDatum &syn_spec)
Definition: conn_builder.h:130
ConnParameterMap synapse_params_
all other parameters, mapping name to value representation
Definition: conn_builder.h:116
ConnParameter * delay_
Definition: conn_builder.h:113
virtual void connect()
Connect sources to targets according to specifications in dictionary.
Definition: conn_builder.cpp:250
virtual void connect_()=0
Implements the actual connection algorithm.
double p_
connection probability
Definition: conn_builder.h:219
bool autapses_
Definition: conn_builder.h:94
Definition: conn_builder.h:158
long N_
Definition: conn_builder.h:203
ConnParameter * weight_
Definition: conn_builder.h:112
ConnBuilder(Network &, const GIDCollection &, const GIDCollection &, const DictionaryDatum &, const DictionaryDatum &)
parameters: sources, targets, specifications
Definition: conn_builder.cpp:44
index synapse_model_
Definition: conn_builder.h:103
Definition: conn_parameter.h:49
BernoulliBuilder(Network &, const GIDCollection &, const GIDCollection &, const DictionaryDatum &, const DictionaryDatum &)
Definition: conn_builder.cpp:741
FixedInDegreeBuilder(Network &, const GIDCollection &, const GIDCollection &, const DictionaryDatum &, const DictionaryDatum &)
Definition: conn_builder.cpp:429
AllToAllBuilder(Network &net, const GIDCollection &sources, const GIDCollection &targets, const DictionaryDatum &conn_spec, const DictionaryDatum &syn_spec)
Definition: conn_builder.h:145
Definition: gid_collection.h:37
bool default_weight_and_delay_
indicate that weight and delay should not be set per synapse
Definition: conn_builder.h:106
Network & net_
Definition: conn_builder.h:89
void connect_()
Implements the actual connection algorithm.
Definition: conn_builder.cpp:752
const Name sources("sources")
Definition: topology_names.h:56
void connect_()
Implements the actual connection algorithm.
Definition: conn_builder.cpp:449
Main administrative interface to the network.
Definition: network.h:135
void connect_()
Implements the actual connection algorithm.
Definition: conn_builder.cpp:629
Definition: conn_builder.h:127
const GIDCollection & sources_
Definition: conn_builder.h:91
void connect_()
Implements the actual connection algorithm.
Definition: conn_builder.cpp:378
std::vector< lockPTR< WrappedThreadException > > exceptions_raised_
buffer for exceptions raised in threads
Definition: conn_builder.h:98
Base class for all NEST network objects.
Definition: node.h:96
const Name targets("targets")
Connection parameters.
Definition: nest_names.h:284
void connect_()
Implements the actual connection algorithm.
Definition: conn_builder.cpp:326
Definition: conn_builder.h:174
Definition: conn_builder.h:142
const GIDCollection & targets_
Definition: conn_builder.h:92
Definition: conn_builder.h:206
int_t thread
Thread index type.
Definition: nest.h:133
long outdegree_
Definition: conn_builder.h:187
FixedOutDegreeBuilder(Network &, const GIDCollection &, const GIDCollection &, const DictionaryDatum &, const DictionaryDatum &)
Definition: conn_builder.cpp:510
Abstract base class for ConnBuilders.
Definition: conn_builder.h:60
std::vector< DictionaryDatum > param_dicts_
dictionaries to pass to connect function, one per thread
Definition: conn_builder.h:119