18 #define SET_SIM_CODE(SIM_CODE) virtual std::string getSimCode() const override{ return SIM_CODE; } 19 #define SET_THRESHOLD_CONDITION_CODE(THRESHOLD_CONDITION_CODE) virtual std::string getThresholdConditionCode() const override{ return THRESHOLD_CONDITION_CODE; } 20 #define SET_RESET_CODE(RESET_CODE) virtual std::string getResetCode() const override{ return RESET_CODE; } 21 #define SET_SUPPORT_CODE(SUPPORT_CODE) virtual std::string getSupportCode() const override{ return SUPPORT_CODE; } 22 #define SET_EXTRA_GLOBAL_PARAMS(...) virtual StringPairVec getExtraGlobalParams() const override{ return __VA_ARGS__; } 23 #define SET_ADDITIONAL_INPUT_VARS(...) virtual NameTypeValVec getAdditionalInputVars() const override{ return __VA_ARGS__; } 65 virtual bool isPoisson()
const{
return false; }
98 virtual bool isPoisson()
const;
139 " $(V)= $(ip0)/(($(Vspike)) - $(V) - ($(beta))*$(Isyn)) +($(ip1));\n" 142 " if (($(V) < $(ip2)) && ($(preV) <= 0)) {\n" 148 " $(V)= -($(Vspike));\n" 158 {
"ip0", [](
const vector<double> &pars, double){
return pars[0] * pars[0] * pars[1]; }},
159 {
"ip1", [](
const vector<double> &pars, double){
return pars[0] * pars[2]; }},
160 {
"ip2", [](
const vector<double> &pars, double){
return (pars[0] * pars[1]) + (pars[0] * pars[2]); }}});
190 "if ($(V) >= 30.0){\n" 194 "$(V)+=0.5*(0.04*$(V)*$(V)+5.0*$(V)+140.0-$(U)+$(Isyn))*DT; //at two times for numerical stability\n" 195 "$(V)+=0.5*(0.04*$(V)*$(V)+5.0*$(V)+140.0-$(U)+$(Isyn))*DT;\n" 196 "$(U)+=$(a)*($(b)*$(V)-$(U))*DT;\n" 197 "if ($(V) > 30.0){ //keep this to not confuse users with unrealistiv voltage values \n" 230 SET_VARS({{
"V",
"scalar"}, {
"U",
"scalar"}, {
"a",
"scalar"},
231 {
"b",
"scalar"}, {
"c",
"scalar"}, {
"d",
"scalar"}});
269 "$(startSpike) != $(endSpike) && "
270 "$(t) >= $(spikeTimes)[$(startSpike)]" );
272 SET_VARS( {{
"startSpike",
"unsigned int"}, {
"endSpike",
"unsigned int"}} );
329 "if ($(V) > $(Vrest)) {\n" 332 "else if ($(t) - $(spikeTime) > ($(trefract))) {\n" 333 " MYRAND($(seed),theRnd);\n" 334 " if (theRnd < *($(rates)+$(offset)+$(id))) {\n" 335 " $(V)= $(Vspike);\n" 336 " $(spikeTime)= $(t);\n" 342 SET_VARS({{
"V",
"scalar"}, {
"seed",
"uint64_t"}, {
"spikeTime",
"scalar"}});
369 "if($(timeStepToSpike) <= 0.0f) {\n" 370 " $(timeStepToSpike) += $(isi) * $(gennrand_exponential);\n" 372 "$(timeStepToSpike) -= 1.0;\n" 379 SET_DERIVED_PARAMS({{
"isi", [](
const vector<double> &pars,
double dt){
return 1000.0 / (pars[0] * dt); }}});
438 "scalar mdt= DT/25.0;\n" 439 "for (mt=0; mt < 25; mt++) {\n" 440 " Imem= -($(m)*$(m)*$(m)*$(h)*$(gNa)*($(V)-($(ENa)))+\n" 441 " $(n)*$(n)*$(n)*$(n)*$(gK)*($(V)-($(EK)))+\n" 442 " $(gl)*($(V)-($(El)))-$(Isyn));\n" 444 " if (lV == -52.0) {\n" 448 " _a= 0.32*(-52.0-$(V))/(exp((-52.0-$(V))/4.0)-1.0);\n" 451 " if (lV == -25.0) {\n" 455 " _b= 0.28*($(V)+25.0)/(exp(($(V)+25.0)/5.0)-1.0);\n" 457 " $(m)+= (_a*(1.0-$(m))-_b*$(m))*mdt;\n" 458 " _a= 0.128*exp((-48.0-$(V))/18.0);\n" 459 " _b= 4.0 / (exp((-25.0-$(V))/5.0)+1.0);\n" 460 " $(h)+= (_a*(1.0-$(h))-_b*$(h))*mdt;\n" 461 " if (lV == -50.0) {\n" 465 " _a= 0.032*(-50.0-$(V))/(exp((-50.0-$(V))/5.0)-1.0);\n" 467 " _b= 0.5*exp((-55.0-$(V))/40.0);\n" 468 " $(n)+= (_a*(1.0-$(n))-_b*$(n))*mdt;\n" 469 " $(V)+= Imem/$(C)*mdt;\n" 475 SET_VARS({{
"V",
"scalar"}, {
"m",
"scalar"}, {
"h",
"scalar"}, {
"n",
"scalar"}});
491 "scalar mdt= DT/25.0;\n" 492 "for (mt=0; mt < 25; mt++) {\n" 493 " Imem= -($(m)*$(m)*$(m)*$(h)*$(gNa)*($(V)-($(ENa)))+\n" 494 " $(n)*$(n)*$(n)*$(n)*$(gK)*($(V)-($(EK)))+\n" 495 " $(gl)*($(V)-($(El)))-$(Isyn));\n" 496 " scalar _a= 0.32*(-52.0-$(V))/(exp((-52.0-$(V))/4.0)-1.0);\n" 497 " scalar _b= 0.28*($(V)+25.0)/(exp(($(V)+25.0)/5.0)-1.0);\n" 498 " $(m)+= (_a*(1.0-$(m))-_b*$(m))*mdt;\n" 499 " _a= 0.128*exp((-48.0-$(V))/18.0);\n" 500 " _b= 4.0 / (exp((-25.0-$(V))/5.0)+1.0);\n" 501 " $(h)+= (_a*(1.0-$(h))-_b*$(h))*mdt;\n" 502 " _a= 0.032*(-50.0-$(V))/(exp((-50.0-$(V))/5.0)-1.0);\n" 503 " _b= 0.5*exp((-55.0-$(V))/40.0);\n" 504 " $(n)+= (_a*(1.0-$(n))-_b*$(n))*mdt;\n" 505 " $(V)+= Imem/$(C)*mdt;\n" 522 "scalar mdt= DT/25.0;\n" 523 "for (mt=0; mt < 25; mt++) {\n" 524 " Imem= -($(m)*$(m)*$(m)*$(h)*$(gNa)*($(V)-($(ENa)))+\n" 525 " $(n)*$(n)*$(n)*$(n)*$(gK)*($(V)-($(EK)))+\n" 526 " $(gl)*($(V)-($(El)))-$(Isyn));\n" 527 " scalar volatile _tmp= abs(exp((-52.0-$(V))/4.0)-1.0);\n" 528 " scalar _a= 0.32*abs(-52.0-$(V))/(_tmp+SCALAR_MIN);\n" 529 " _tmp= abs(exp(($(V)+25.0)/5.0)-1.0);\n" 530 " scalar _b= 0.28*abs($(V)+25.0)/(_tmp+SCALAR_MIN);\n" 531 " $(m)+= (_a*(1.0-$(m))-_b*$(m))*mdt;\n" 532 " _a= 0.128*exp((-48.0-$(V))/18.0);\n" 533 " _b= 4.0 / (exp((-25.0-$(V))/5.0)+1.0);\n" 534 " $(h)+= (_a*(1.0-$(h))-_b*$(h))*mdt;\n" 535 " _tmp= abs(exp((-50.0-$(V))/5.0)-1.0);\n" 536 " _a= 0.032*abs(-50.0-$(V))/(_tmp+SCALAR_MIN);\n" 537 " _b= 0.5*exp((-55.0-$(V))/40.0);\n" 538 " $(n)+= (_a*(1.0-$(n))-_b*$(n))*mdt;\n" 539 " $(V)+= Imem/$(C)*mdt;\n" 556 "scalar mdt= DT/scalar($(ntimes));\n" 557 "for (mt=0; mt < $(ntimes); mt++) {\n" 558 " Imem= -($(m)*$(m)*$(m)*$(h)*$(gNa)*($(V)-($(ENa)))+\n" 559 " $(n)*$(n)*$(n)*$(n)*$(gK)*($(V)-($(EK)))+\n" 560 " $(gl)*($(V)-($(El)))-$(Isyn));\n" 562 " if (lV == -52.0) {\n" 566 " _a= 0.32*(-52.0-$(V))/(exp((-52.0-$(V))/4.0)-1.0);\n" 569 " if (lV == -25.0) {\n" 573 " _b= 0.28*($(V)+25.0)/(exp(($(V)+25.0)/5.0)-1.0);\n" 575 " $(m)+= (_a*(1.0-$(m))-_b*$(m))*mdt;\n" 576 " _a= 0.128*exp((-48.0-$(V))/18.0);\n" 577 " _b= 4.0 / (exp((-25.0-$(V))/5.0)+1.0);\n" 578 " $(h)+= (_a*(1.0-$(h))-_b*$(h))*mdt;\n" 579 " if (lV == -50.0) {\n" 583 " _a= 0.032*(-50.0-$(V))/(exp((-50.0-$(V))/5.0)-1.0);\n" 585 " _b= 0.5*exp((-55.0-$(V))/40.0);\n" 586 " $(n)+= (_a*(1.0-$(n))-_b*$(n))*mdt;\n" 587 " $(V)+= Imem/$(C)*mdt;\n" virtual std::string getSupportCode() const
Gets support code to be made available within the neuron kernel/funcion.
Definition: newNeuronModels.h:53
Izhikevich neuron with fixed parameters .
Definition: newNeuronModels.h:184
Hodgkin-Huxley neurons with Traub & Miles algorithm.
Definition: newNeuronModels.h:548
Hodgkin-Huxley neurons with Traub & Miles algorithm: Original fast implementation, using 25 inner iterations.
Definition: newNeuronModels.h:483
Hodgkin-Huxley neurons with Traub & Miles algorithm.
Definition: newNeuronModels.h:430
class for specifying a neuron model.
Definition: neuronModels.h:16
virtual std::string getResetCode() const
Gets code that defines the reset action taken after a spike occurred. This can be empty...
Definition: newNeuronModels.h:47
LegacyWrapper(unsigned int legacyTypeIndex)
Definition: newNeuronModels.h:75
std::vector< std::pair< std::string, std::pair< std::string, double > > > NameTypeValVec
Definition: snippet.h:118
virtual bool isPoisson() const override
Definition: newNeuronModels.h:345
Wrapper around old-style models stored in global arrays and referenced by index.
Definition: newModels.h:170
virtual std::string getSimCode() const
Gets the code that defines the execution of one timestep of integration of the neuron model...
Definition: newNeuronModels.h:40
Poisson neurons.
Definition: newNeuronModels.h:363
Poisson neurons.
Definition: newNeuronModels.h:322
#define SET_RESET_CODE(RESET_CODE)
Definition: newNeuronModels.h:20
Rulkov Map neuron.
Definition: newNeuronModels.h:131
Spike source array.
Definition: newNeuronModels.h:263
virtual NewModels::Base::NameTypeValVec getAdditionalInputVars() const
Definition: newNeuronModels.h:61
#define SET_THRESHOLD_CONDITION_CODE(THRESHOLD_CONDITION_CODE)
Definition: newNeuronModels.h:19
#define SET_SIM_CODE(SIM_CODE)
Definition: newNeuronModels.h:18
Base class for all models - in addition to the parameters snippets have, models can have state variab...
Definition: newModels.h:132
virtual std::string getThresholdConditionCode() const
Gets code which defines the condition for a true spike in the described neuron model.
Definition: newNeuronModels.h:44
#define SET_DERIVED_PARAMS(...)
Definition: snippet.h:29
#define DECLARE_MODEL(TYPE, NUM_PARAMS, NUM_VARS)
Definition: newModels.h:18
Wrapper around legacy weight update models stored in nModels array of neuronModel objects...
Definition: newNeuronModels.h:72
Izhikevich neuron with variable parameters .
Definition: newNeuronModels.h:224
Hodgkin-Huxley neurons with Traub & Miles algorithm.
Definition: newNeuronModels.h:514
virtual NewModels::Base::StringPairVec getExtraGlobalParams() const
Definition: newNeuronModels.h:57
vector< neuronModel > nModels
Global C++ vector containing all neuron model descriptions.
Definition: neuronModels.cc:28
#define SET_PARAM_NAMES(...)
Definition: snippet.h:28
#define SET_VARS(...)
Definition: newModels.h:26
Base class for all neuron models.
Definition: newNeuronModels.h:31
Definition: codeGenUtils.h:19
std::vector< std::pair< std::string, std::string > > StringPairVec
Definition: snippet.h:117
Definition: codeGenUtils.h:24
#define SET_EXTRA_GLOBAL_PARAMS(...)
Definition: newNeuronModels.h:22
Empty neuron which allows setting spikes from external sources.
Definition: newNeuronModels.h:240