/** * Set properties of this connection from position p in the properties * array given in dictionary. */ void ContDelayConnection::set_status(const DictionaryDatum & d, index p, ConnectorModel &cm) { //set delay if mentioned double_t delay; if ( set_property<double_t>(d, names::delays, p, delay) ) { double_t h = Time::get_resolution().get_ms(); double_t int_delay; double_t frac_delay = std::modf(delay/h, &int_delay); if (frac_delay == 0) { if (!cm.check_delay(delay)) throw BadDelay(delay); delay_ = Time(Time::ms(delay)).get_steps(); delay_offset_ = 0.0; } else { long_t lowerbound = static_cast<long_t>(int_delay); if (!cm.check_delays(Time(Time::step(lowerbound)).get_ms(), Time(Time::step(lowerbound + 1)).get_ms())) throw BadDelay(lowerbound); delay_ = lowerbound + 1; delay_offset_ = h * (1.0 - frac_delay); } } set_property<double_t>(d, names::weights, p, weight_); }
void STDP_Tsodyk_Connection_Plus::set_status(const DictionaryDatum & d, ConnectorModel &cm) { ConnectionHetWD::set_status(d, cm); updateValue<double_t>(d, "U", U_); updateValue<double_t>(d, "tau_psc", tau_psc_); updateValue<double_t>(d, "tau_rec", tau_rec_); updateValue<double_t>(d, "tau_fac", tau_fac_); double_t x = x_; double_t y = y_; updateValue<double_t>(d, "x", x); updateValue<double_t>(d, "y", y); if (x + y > 1.0) { cm.network().message(SLIInterpreter::M_ERROR, "TsodyksConnection::set_status()", "x + y must be <= 1.0."); throw BadProperty(); } else { x_ = x; y_ = y; } updateValue<double_t>(d, "u", u_); updateValue<double_t>(d, "tau_plus", tau_plus_); updateValue<double_t>(d, "lambda", lambda_); updateValue<double_t>(d, "alpha", alpha_); updateValue<double_t>(d, "mu_plus", mu_plus_); updateValue<double_t>(d, "mu_minus", mu_minus_); updateValue<double_t>(d, "Wmax", Wmax_); }
/** * Set properties of this connection from position p in the properties * array given in dictionary. */ void STDPRSNNSpikePairingConnectionHom::set_status(const DictionaryDatum & d, index p, ConnectorModel &cm) { ConnectionHetWD::set_status(d, p, cm); if (d->known("tau_pluss") || d->known("lambds") || d->known("alphas") || d->known("mu_pluss") || d->known("mu_minuss") || d->known("Wmaxs") ) { cm.network().message(SLIInterpreter::M_ERROR, "STDPRSNNSpikePairingConnectionHom::set_status()", "you are trying to set common properties via an individual synapse."); } }
void CommonPropertiesHomWD::set_status(const DictionaryDatum & d, ConnectorModel &cm) { CommonSynapseProperties::set_status(d, cm); double_t delay; if (updateValue<double_t>(d, names::delay, delay)) { if (!cm.check_delay(delay)) throw BadDelay(delay); delay_ = Time(Time::ms(delay)).get_steps(); } updateValue<double_t>(d, names::weight, weight_); }
/** * Set properties of this connection from position p in the properties * array given in dictionary. */ void STDP_Tsodyk_Connection_Plus::set_status(const DictionaryDatum & d, index p, ConnectorModel &cm) { ConnectionHetWD::set_status(d, p, cm); set_property<double_t>(d, "Us", p, U_); set_property<double_t>(d, "tau_pscs", p, tau_psc_); set_property<double_t>(d, "tau_facs", p, tau_fac_); set_property<double_t>(d, "tau_recs", p, tau_rec_); double_t x = x_; double_t y = y_; set_property<double_t>(d, "xs", p, x); set_property<double_t>(d, "ys", p, y); if (x + y > 1.0) { cm.network().message(SLIInterpreter::M_ERROR, "TsodyksConnection::set_status()", "x + y must be <= 1.0."); throw BadProperty(); } else { x_ = x; y_ = y; } set_property<double_t>(d, "us", p, u_); set_property<double_t>(d, "tau_pluss", p, tau_plus_); set_property<double_t>(d, "lambdas", p, lambda_); set_property<double_t>(d, "alphas", p, alpha_); set_property<double_t>(d, "mu_pluss", p, mu_plus_); set_property<double_t>(d, "mu_minuss", p, mu_minus_); set_property<double_t>(d, "Wmaxs", p, Wmax_); }