23 #ifndef GENERICMODEL_H
24 #define GENERICMODEL_H
41 template <
typename ElementT>
105 template<
typename ElementT>
113 template<
typename ElementT>
121 template <
typename ElementT>
123 const std::string& newname)
125 proto_(oldmod.proto_)
131 template <
typename ElementT>
137 template<
typename ElementT>
140 Node *
n =
new(adr) ElementT(proto_);
144 template<
typename ElementT>
147 mem.
init(
sizeof(ElementT), 1000, 1);
150 template <
typename ElementT>
154 return proto_.has_proxies();
157 template <
typename ElementT>
161 return proto_.potential_global_receiver();
164 template <
typename ElementT>
168 return proto_.one_node_per_process();
171 template <
typename ElementT>
175 return proto_.is_off_grid();
178 template <
typename ElementT>
182 return proto_.send_test_event(target, receptor, syn_id, dummy_target);
185 template <
typename ElementT>
188 proto_.set_status(d);
191 template <
typename ElementT>
195 (*d)[
"elementsize"]=
sizeof(ElementT);
199 template <
typename ElementT>
202 return sizeof(ElementT);
205 template <
typename ElementT>
211 template <
typename ElementT>
214 proto_.set_model_id(i);
229 template <
class ModelT>
231 bool private_model =
false)
256 template <
class ModelT>
281 template <
class ModelT>
284 return register_model<ModelT>(net, name,
true);
size_t index
Unsigned long type for enumerations.
Definition: nest.h:109
size_t get_element_size() const
Return the size of the prototype.
Definition: genericmodel.h:200
index register_preconf_model(Network &net, const std::string &name, Dictionary &conf, bool private_model=false)
Register a pre-configured model prototype with the network.
Definition: genericmodel.h:257
index get_type_id() const
Definition: model.h:174
bool is_off_grid()
Definition: genericmodel.h:173
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
void init(size_t n, size_t initial=100, size_t growth=1)
Definition: allocator.cpp:65
bool all_accessed(std::string &missed) const
Check whether all elements have been accessed.
Definition: dict.h:161
index register_model(Network &net, const std::string &name, bool private_model=false)
Register a model prototype with the network.
Definition: genericmodel.h:230
bool has_proxies()
Definition: genericmodel.h:152
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
void init_memory_(sli::pool &)
Initialize the pool allocator with the node specific properties.
Definition: genericmodel.h:145
void set_model_id(int)
Set the model id on the prototype.
Definition: genericmodel.h:212
const Name std("std")
Miscellaneous parameters.
Definition: nest_names.h:265
A class that associates names and tokens.
Definition: dict.h:45
DictionaryDatum get_status_()
Definition: genericmodel.h:192
ElementT proto_
Prototype node from which all instances are constructed.
Definition: genericmodel.h:102
Node * allocate_(void *)
Call placement new on the supplied memory position.
Definition: genericmodel.h:138
void clear_access_flags()
Clear access flags on all dictionary elements.
Definition: dict.cc:142
port send_test_event(Node &, rport, synindex, bool)
Definition: genericmodel.h:180
void set_threads()
Set number of threads based on number set in network.
Definition: model.cpp:39
bool one_node_per_process()
Definition: genericmodel.h:166
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
Base class for all Models.
Definition: model.h:48
void set_status(DictionaryDatum)
Change properties of the prototype node according to the entries in the dictionary.
Definition: model.cpp:88
Main administrative interface to the network.
Definition: network.h:135
Generic Model template.
Definition: genericmodel.h:42
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
void set_type_id(index id)
Set the model id on the prototype.
Definition: model.h:169
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
Model * clone(const std::string &) const
Return pointer to cloned model with same name.
Definition: genericmodel.h:132
Node const & get_prototype() const
Return const reference to the prototype.
Definition: genericmodel.h:206
const Name n("n")
Number of synaptic release sites (int >=0) (Tsodyks2_connection)
Definition: nest_names.h:202
index register_private_model(Network &net, const std::string &name)
Register a private model prototype with the network.
Definition: genericmodel.h:282
pool is a specialized allocator class for many identical small objects.
Definition: allocator.h:50
Base class for all NEST network objects.
Definition: node.h:96
bool potential_global_receiver()
Definition: genericmodel.h:159
void set_status_(DictionaryDatum)
Definition: genericmodel.h:186
index register_model(Model &m, bool private_model=false)
Register a built-in model for use with the network.
Definition: network.cpp:1744
GenericModel(const std::string &)
Definition: genericmodel.h:106