19 #define SET_SIM_CODE(SIM_CODE) virtual std::string getSimCode() const override{ return SIM_CODE; } 20 #define SET_THRESHOLD_CONDITION_CODE(THRESHOLD_CONDITION_CODE) virtual std::string getThresholdConditionCode() const override{ return THRESHOLD_CONDITION_CODE; } 21 #define SET_RESET_CODE(RESET_CODE) virtual std::string getResetCode() const override{ return RESET_CODE; } 22 #define SET_SUPPORT_CODE(SUPPORT_CODE) virtual std::string getSupportCode() const override{ return SUPPORT_CODE; } 23 #define SET_ADDITIONAL_INPUT_VARS(...) virtual ParamValVec getAdditionalInputVars() const override{ return __VA_ARGS__; } 24 #define SET_NEEDS_AUTO_REFRACTORY(AUTO_REFRACTORY_REQUIRED) virtual bool isAutoRefractoryRequired() const override{ return AUTO_REFRACTORY_REQUIRED; } 67 boost::uuids::detail::sha1::digest_type getHashDigest()
const;
70 void validate()
const;
111 " $(V)= $(ip0)/(($(Vspike)) - $(V) - ($(beta))*$(Isyn)) +($(ip1));\n" 114 " if (($(V) < $(ip2)) && ($(preV) <= 0)) {\n" 120 " $(V)= -($(Vspike));\n" 130 {
"ip0", [](
const std::vector<double> &pars, double){
return pars[0] * pars[0] * pars[1]; }},
131 {
"ip1", [](
const std::vector<double> &pars, double){
return pars[0] * pars[2]; }},
132 {
"ip2", [](
const std::vector<double> &pars, double){
return (pars[0] * pars[1]) + (pars[0] * pars[2]); }}});
162 "if ($(V) >= 30.0){\n" 166 "$(V)+=0.5*(0.04*$(V)*$(V)+5.0*$(V)+140.0-$(U)+$(Isyn))*DT; //at two times for numerical stability\n" 167 "$(V)+=0.5*(0.04*$(V)*$(V)+5.0*$(V)+140.0-$(U)+$(Isyn))*DT;\n" 168 "$(U)+=$(a)*($(b)*$(V)-$(U))*DT;\n" 169 "if ($(V) > 30.0){ //keep this to not confuse users with unrealistiv voltage values \n" 204 SET_VARS({{
"V",
"scalar"}, {
"U",
"scalar"},
218 "if ($(RefracTime) <= 0.0) {\n" 219 " scalar alpha = (($(Isyn) + $(Ioffset)) * $(Rmembrane)) + $(Vrest);\n" 220 " $(V) = alpha - ($(ExpTC) * (alpha - $(V)));\n" 223 " $(RefracTime) -= DT;\n" 230 "$(V) = $(Vreset);\n" 231 "$(RefracTime) = $(TauRefrac);\n");
243 {
"ExpTC", [](
const std::vector<double> &pars,
double dt){
return std::exp(-dt / pars[1]); }},
244 {
"Rmembrane", [](
const std::vector<double> &pars, double){
return pars[1] / pars[0]; }}});
246 SET_VARS({{
"V",
"scalar"}, {
"RefracTime",
"scalar"}});
287 "$(startSpike) != $(endSpike) && "
288 "$(t) >= $(spikeTimes)[$(startSpike)]" );
338 "if(($(t) - $(spikeTime)) > $(tspike) && $(V) > $(Vrest)){\n" 339 " $(V) = $(Vrest);\n" 341 "else if(($(t) - $(spikeTime)) > $(trefract)){\n" 342 " if($(gennrand_uniform) < $(firingProb)[$(offset) + $(id)]){\n" 343 " $(V) = $(Vspike);\n" 344 " $(spikeTime) = $(t);\n" 350 SET_VARS({{
"V",
"scalar"}, {
"spikeTime",
"scalar"}});
377 "if($(timeStepToSpike) <= 0.0f) {\n" 378 " $(timeStepToSpike) += $(isi) * $(gennrand_exponential);\n" 380 "$(timeStepToSpike) -= 1.0;\n" 387 SET_DERIVED_PARAMS({{
"isi", [](
const std::vector<double> &pars,
double dt){
return 1000.0 / (pars[0] * dt); }}});
447 "scalar mdt= DT/25.0;\n" 448 "for (mt=0; mt < 25; mt++) {\n" 449 " Imem= -($(m)*$(m)*$(m)*$(h)*$(gNa)*($(V)-($(ENa)))+\n" 450 " $(n)*$(n)*$(n)*$(n)*$(gK)*($(V)-($(EK)))+\n" 451 " $(gl)*($(V)-($(El)))-$(Isyn));\n" 453 " if (lV == -52.0) {\n" 457 " _a= 0.32*(-52.0-$(V))/(exp((-52.0-$(V))/4.0)-1.0);\n" 460 " if (lV == -25.0) {\n" 464 " _b= 0.28*($(V)+25.0)/(exp(($(V)+25.0)/5.0)-1.0);\n" 466 " $(m)+= (_a*(1.0-$(m))-_b*$(m))*mdt;\n" 467 " _a= 0.128*exp((-48.0-$(V))/18.0);\n" 468 " _b= 4.0 / (exp((-25.0-$(V))/5.0)+1.0);\n" 469 " $(h)+= (_a*(1.0-$(h))-_b*$(h))*mdt;\n" 470 " if (lV == -50.0) {\n" 474 " _a= 0.032*(-50.0-$(V))/(exp((-50.0-$(V))/5.0)-1.0);\n" 476 " _b= 0.5*exp((-55.0-$(V))/40.0);\n" 477 " $(n)+= (_a*(1.0-$(n))-_b*$(n))*mdt;\n" 478 " $(V)+= Imem/$(C)*mdt;\n" 484 SET_VARS({{
"V",
"scalar"}, {
"m",
"scalar"}, {
"h",
"scalar"}, {
"n",
"scalar"}});
502 "scalar mdt= DT/25.0;\n" 503 "for (mt=0; mt < 25; mt++) {\n" 504 " Imem= -($(m)*$(m)*$(m)*$(h)*$(gNa)*($(V)-($(ENa)))+\n" 505 " $(n)*$(n)*$(n)*$(n)*$(gK)*($(V)-($(EK)))+\n" 506 " $(gl)*($(V)-($(El)))-$(Isyn));\n" 507 " scalar _a= 0.32*(-52.0-$(V))/(exp((-52.0-$(V))/4.0)-1.0);\n" 508 " scalar _b= 0.28*($(V)+25.0)/(exp(($(V)+25.0)/5.0)-1.0);\n" 509 " $(m)+= (_a*(1.0-$(m))-_b*$(m))*mdt;\n" 510 " _a= 0.128*exp((-48.0-$(V))/18.0);\n" 511 " _b= 4.0 / (exp((-25.0-$(V))/5.0)+1.0);\n" 512 " $(h)+= (_a*(1.0-$(h))-_b*$(h))*mdt;\n" 513 " _a= 0.032*(-50.0-$(V))/(exp((-50.0-$(V))/5.0)-1.0);\n" 514 " _b= 0.5*exp((-55.0-$(V))/40.0);\n" 515 " $(n)+= (_a*(1.0-$(n))-_b*$(n))*mdt;\n" 516 " $(V)+= Imem/$(C)*mdt;\n" 535 "scalar mdt= DT/25.0;\n" 536 "for (mt=0; mt < 25; mt++) {\n" 537 " Imem= -($(m)*$(m)*$(m)*$(h)*$(gNa)*($(V)-($(ENa)))+\n" 538 " $(n)*$(n)*$(n)*$(n)*$(gK)*($(V)-($(EK)))+\n" 539 " $(gl)*($(V)-($(El)))-$(Isyn));\n" 540 " scalar volatile _tmp= abs(exp((-52.0-$(V))/4.0)-1.0);\n" 541 " scalar _a= 0.32*abs(-52.0-$(V))/(_tmp+SCALAR_MIN);\n" 542 " _tmp= abs(exp(($(V)+25.0)/5.0)-1.0);\n" 543 " scalar _b= 0.28*abs($(V)+25.0)/(_tmp+SCALAR_MIN);\n" 544 " $(m)+= (_a*(1.0-$(m))-_b*$(m))*mdt;\n" 545 " _a= 0.128*exp((-48.0-$(V))/18.0);\n" 546 " _b= 4.0 / (exp((-25.0-$(V))/5.0)+1.0);\n" 547 " $(h)+= (_a*(1.0-$(h))-_b*$(h))*mdt;\n" 548 " _tmp= abs(exp((-50.0-$(V))/5.0)-1.0);\n" 549 " _a= 0.032*abs(-50.0-$(V))/(_tmp+SCALAR_MIN);\n" 550 " _b= 0.5*exp((-55.0-$(V))/40.0);\n" 551 " $(n)+= (_a*(1.0-$(n))-_b*$(n))*mdt;\n" 552 " $(V)+= Imem/$(C)*mdt;\n" 571 "scalar mdt= DT/scalar($(ntimes));\n" 572 "for (mt=0; mt < $(ntimes); mt++) {\n" 573 " Imem= -($(m)*$(m)*$(m)*$(h)*$(gNa)*($(V)-($(ENa)))+\n" 574 " $(n)*$(n)*$(n)*$(n)*$(gK)*($(V)-($(EK)))+\n" 575 " $(gl)*($(V)-($(El)))-$(Isyn));\n" 577 " if (lV == -52.0) {\n" 581 " _a= 0.32*(-52.0-$(V))/(exp((-52.0-$(V))/4.0)-1.0);\n" 584 " if (lV == -25.0) {\n" 588 " _b= 0.28*($(V)+25.0)/(exp(($(V)+25.0)/5.0)-1.0);\n" 590 " $(m)+= (_a*(1.0-$(m))-_b*$(m))*mdt;\n" 591 " _a= 0.128*exp((-48.0-$(V))/18.0);\n" 592 " _b= 4.0 / (exp((-25.0-$(V))/5.0)+1.0);\n" 593 " $(h)+= (_a*(1.0-$(h))-_b*$(h))*mdt;\n" 594 " if (lV == -50.0) {\n" 598 " _a= 0.032*(-50.0-$(V))/(exp((-50.0-$(V))/5.0)-1.0);\n" 600 " _b= 0.5*exp((-55.0-$(V))/40.0);\n" 601 " $(n)+= (_a*(1.0-$(n))-_b*$(n))*mdt;\n" 602 " $(V)+= Imem/$(C)*mdt;\n"
virtual std::string getSupportCode() const
Gets support code to be made available within the neuron kernel/funcion.
Definition: neuronModels.h:54
#define SET_VARS(...)
Definition: models.h:39
Izhikevich neuron with fixed parameters .
Definition: neuronModels.h:156
Hodgkin-Huxley neurons with Traub & Miles algorithm.
Definition: neuronModels.h:563
#define SET_NEEDS_AUTO_REFRACTORY(AUTO_REFRACTORY_REQUIRED)
Definition: neuronModels.h:24
Hodgkin-Huxley neurons with Traub & Miles algorithm: Original fast implementation, using 25 inner iterations.
Definition: neuronModels.h:494
Hodgkin-Huxley neurons with Traub & Miles algorithm.
Definition: neuronModels.h:439
#define GENN_EXPORT
Definition: gennExport.h:13
virtual std::string getResetCode() const
Gets code that defines the reset action taken after a spike occurred. This can be empty...
Definition: neuronModels.h:48
virtual std::string getSimCode() const
Gets the code that defines the execution of one timestep of integration of the neuron model...
Definition: neuronModels.h:41
virtual Models::Base::ParamValVec getAdditionalInputVars() const
Definition: neuronModels.h:58
#define SET_SIM_CODE(SIM_CODE)
Definition: neuronModels.h:19
Poisson neurons.
Definition: neuronModels.h:371
Poisson neurons.
Definition: neuronModels.h:332
#define SET_THRESHOLD_CONDITION_CODE(THRESHOLD_CONDITION_CODE)
Definition: neuronModels.h:20
#define DECLARE_MODEL(TYPE, NUM_PARAMS, NUM_VARS)
Definition: models.h:31
#define SET_RESET_CODE(RESET_CODE)
Definition: neuronModels.h:21
Rulkov Map neuron.
Definition: neuronModels.h:103
Spike source array.
Definition: neuronModels.h:281
Definition: neuronModels.h:212
virtual std::string getThresholdConditionCode() const
Gets code which defines the condition for a true spike in the described neuron model.
Definition: neuronModels.h:45
#define SET_DERIVED_PARAMS(...)
Definition: snippet.h:37
Izhikevich neuron with variable parameters .
Definition: neuronModels.h:198
virtual bool isAutoRefractoryRequired() const
Does this model require auto-refractory logic?
Definition: neuronModels.h:61
Hodgkin-Huxley neurons with Traub & Miles algorithm.
Definition: neuronModels.h:527
#define SET_PARAM_NAMES(...)
Definition: snippet.h:36
Base class for all neuron models.
Definition: neuronModels.h:32
Definition: neuronModels.h:29
#define SET_EXTRA_GLOBAL_PARAMS(...)
Definition: snippet.h:38
Empty neuron which allows setting spikes from external sources.
Definition: neuronModels.h:257
std::vector< ParamVal > ParamValVec
Definition: snippet.h:180