18 #define SET_INJECTION_CODE(INJECTION_CODE) virtual std::string getInjectionCode() const override{ return INJECTION_CODE; } 39 boost::uuids::detail::sha1::digest_type getHashDigest()
const;
42 void validate()
const;
94 "unsigned int numSpikes = 0;\n" 98 " p *= $(gennrand_uniform);\n" 99 "} while (p > $(ExpMinusLambda));\n" 100 "$(current) += $(Init) * (scalar)(numSpikes - 1);\n" 101 "$(injectCurrent, $(current));\n" 102 "$(current) *= $(ExpDecay);\n");
107 {
"ExpDecay", [](
const std::vector<double> &pars,
double dt){
return std::exp(-dt / pars[1]); }},
108 {
"Init", [](
const std::vector<double> &pars,
double dt){
return pars[0] * (1.0 - std::exp(-dt / pars[1])) * (pars[1] / dt); }},
109 {
"ExpMinusLambda", [](
const std::vector<double> &pars,
double dt){
return std::exp(-(pars[2] / 1000.0) * dt); }}});
#define SET_VARS(...)
Definition: models.h:39
#define SET_INJECTION_CODE(INJECTION_CODE)
Definition: currentSourceModels.h:18
Base class for all current source models.
Definition: currentSourceModels.h:26
Definition: currentSourceModels.h:23
Definition: currentSourceModels.h:88
#define GENN_EXPORT
Definition: gennExport.h:13
#define DECLARE_MODEL(TYPE, NUM_PARAMS, NUM_VARS)
Definition: models.h:31
DC source.
Definition: currentSourceModels.h:52
#define SET_DERIVED_PARAMS(...)
Definition: snippet.h:37
Noisy current source with noise drawn from normal distribution.
Definition: currentSourceModels.h:69
#define SET_PARAM_NAMES(...)
Definition: snippet.h:36
virtual std::string getInjectionCode() const
Gets the code that defines current injected each timestep.
Definition: currentSourceModels.h:33