23 #ifndef CONNECTOR_MODEL_IMPL_H
24 #define CONNECTOR_MODEL_IMPL_H
34 template<
typename T,
typename C>
88 template<
typename ConnectionT >
94 template <
typename ConnectionT >
98 default_connection_.calibrate(tc);
109 template <
typename ConnectionT >
117 default_connection_.get_status(d);
119 (*d)[
"min_delay"] = get_min_delay().get_ms();
120 (*d)[
"max_delay"] = get_max_delay().get_ms();
129 if ( updateValue<long_t>(d,
"num_connections", old_count) )
130 (*d)[
"num_connections"] = old_count + get_num_connections();
132 (*d)[
"num_connections"] = get_num_connections();
135 template <
typename ConnectionT >
151 Time min_delay, max_delay, new_delay;
153 bool min_delay_updated = updateValue<double_t>(
d,
"min_delay", delay_tmp);
155 bool max_delay_updated = updateValue<double_t>(
d,
"max_delay", delay_tmp);
159 if (! updateValue<double_t>(d,
"delay", delay_tmp))
160 new_delay =
Time(
Time::ms(default_connection_.get_delay()));
164 if (min_delay_updated xor max_delay_updated)
166 "Both min_delay and max_delay have to be specified");
168 if (min_delay_updated && max_delay_updated)
170 if (num_connections_ > 0)
172 "Connections already exist. Please call ResetKernel first");
173 else if ( min_delay > new_delay )
175 "min_delay is not compatible with default delay");
176 else if ( max_delay < new_delay )
178 "max_delay is not compatible with default delay");
181 "min_delay must be greater than or equal to resolution");
184 "max_delay must be greater than or equal to resolution");
187 min_delay_ = min_delay;
188 max_delay_ = max_delay;
189 user_set_delay_extrema_ =
true;
201 Time min_delay_tmp = min_delay_;
202 Time max_delay_tmp = max_delay_;
204 cp_.set_status(d, *
this);
205 default_connection_.set_status(d, *
this);
208 min_delay_ = min_delay_tmp;
209 max_delay_ = max_delay_tmp;
212 default_delay_needs_check_ =
true;
215 template <
typename ConnectionT >
222 if (default_delay_needs_check_)
224 assert_valid_delay_ms(default_connection_.get_delay());
225 default_delay_needs_check_ =
false;
229 template <
typename ConnectionT >
232 default_connection_.set_syn_id(syn_id);
241 template <
typename ConnectionT >
245 if (! std::isnan(delay))
246 assert_valid_delay_ms(delay);
249 ConnectionT
c = ConnectionT( default_connection_ );
250 if (! std::isnan(weight))
252 c.set_weight(weight);
254 if (! std::isnan(delay))
261 used_default_delay();
265 return add_connection(src, tgt, conn, syn_id, c, receptor_type_);
274 template<
typename ConnectionT >
278 if (! std::isnan(delay))
280 assert_valid_delay_ms(delay);
283 throw BadParameter(
"Parameter dictionary must not contain delay if delay is given explicitly.");
291 assert_valid_delay_ms(delay);
293 used_default_delay();
297 ConnectionT
c = ConnectionT( default_connection_ );
299 c.set_status(p, *
this);
300 if (! std::isnan(weight))
302 c.set_weight(weight);
304 if (! std::isnan(delay))
312 rport actual_receptor_type = receptor_type_;
319 return add_connection(src, tgt, conn, syn_id, c, actual_receptor_type);
326 template <
typename ConnectionT >
344 c.check_connection(src, tgt, receptor_type, 0., get_common_properties());
347 conn = allocate< Connector<1, ConnectionT> >(
c);
354 c.check_connection(src, tgt, receptor_type, conn->
get_t_lastspike(), get_common_properties());
372 hc->push_back( conn );
390 for (
size_t i=0; i<hc->size() && !found; i++)
393 if ((*hc)[i]->get_syn_id() == syn_id)
429 template <
class ConnectionT>
double_t weight
Weight of a connection.
Definition: nest.h:170
const Name delay("delay")
Connection parameters.
Definition: nest_names.h:92
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
const Name music_channel("music_channel")
Parameters for MUSIC devices.
Definition: nest_names.h:200
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
void set_status(const DictionaryDatum &)
Definition: connector_model_impl.h:136
synindex register_synapse_prototype(ConnectorModel *cf)
Register a synapse prototype at the connection manager.
Definition: network.h:942
Definition: connector_base.h:88
double_t get_t_lastspike() const
Definition: connector_base.h:119
Time from_old_steps(long_t s_old) const
Converts a given number of steps with respect to old representation into a time object in current rep...
Definition: nest_timeconverter.cpp:34
ConnectorModel * clone(std::string) const
Definition: connector_model_impl.h:89
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
Definition: nest_time.h:235
Exception to be thrown if a parameter cannot be set.
Definition: exceptions.h:445
Definition: nest_time.h:130
T * allocate(C c)
Definition: connector_model_impl.h:36
void set_syn_id(synindex syn_id)
Definition: connector_model_impl.h:230
Definition: connector_base.h:445
Declarations for class Network.
Main administrative interface to the network.
Definition: network.h:135
Class to convert times from one representation to another.
Definition: nest_timeconverter.h:45
void used_default_delay()
Definition: connector_model_impl.h:216
void * alloc(size_t obj_size)
Definition: allocator.cpp:174
double double_t
Double precision floating point numbers.
Definition: nest.h:93
Definition: namedatum.h:90
static Time get_resolution()
Definition: nest_time.h:303
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
void get_status(DictionaryDatum &) const
Definition: connector_model_impl.h:110
long_t delay
Delay of a connection.
Definition: nest.h:178
virtual ConnectorBase & push_back(const ConnectionT &c)=0
Base class for all NEST network objects.
Definition: node.h:96
static const int M_ERROR
Predefined error level for error messages.
Definition: interpret.h:180
void calibrate(const TimeConverter &tc)
Definition: connector_model_impl.h:95
virtual bool homogeneous_model()=0
const Name p("p")
current release probability (Tsodyks2_connection)
Definition: nest_names.h:218
const Name c("c")
Specific to Izhikevich 2003.
Definition: nest_names.h:62
Definition: connector_model.h:38
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
Definition: connector_base.h:132
Definition: connector_model.h:113
PoorMansAllocator poormansallocpool
Definition: allocator.cpp:196
ConnectorBase * add_connection(Node &src, Node &tgt, ConnectorBase *conn, synindex syn_id, double_t weight, double_t delay)
delay and weight have the default value NAN.
Definition: connector_model_impl.h:242
virtual synindex get_syn_id() const =0
synindex register_connection_model(Network &net, const std::string &name)
Register a synape with default Connector and without any common properties.
Definition: connector_model_impl.h:430