9 #define SET_CODE(CODE) virtual std::string getCode() const override{ return CODE; }    23     virtual std::string 
getCode()
 const{ 
return ""; }
    29     boost::uuids::detail::sha1::digest_type getHashDigest() 
const;
    35     bool requiresKernel() 
const;
    76     SET_CODE(
"$(value) = $(kernel)[$(id_kernel)];");
    95         "const scalar scale = $(max) - $(min);\n"    96         "$(value) = $(min) + ($(gennrand_uniform) * scale);");
   114     SET_CODE(
"$(value) = $(mean) + ($(gennrand_normal) * $(sd));");
   139         "   normal = $(mean) + ($(gennrand_normal) * $(sd));\n"   140         "} while (normal > $(max) || normal < $(min));\n"   141         "$(value) = normal;\n");
   168         "   normal = $(meanTimestep) + ($(gennrand_normal) * $(sdTimestep));\n"   169         "} while (normal > $(maxTimestep) || normal < $(minTimestep));\n"   170         "$(value) = rint(normal);\n");
   174         {
"meanTimestep", [](
const std::vector<double> &pars, 
double dt){ 
return pars[0] / dt; }},
   175         {
"sdTimestep", [](
const std::vector<double> &pars, 
double dt){ 
return pars[1] / dt; }},
   176         {
"minTimestep", [](
const std::vector<double> &pars, 
double dt){ 
return pars[2] / dt; }},
   177         {
"maxTimestep", [](
const std::vector<double> &pars, 
double dt){ 
return pars[3] / dt; }}});
   192     SET_CODE(
"$(value) = $(lambda) * $(gennrand_exponential);");
   210     SET_CODE(
"$(value) = $(b) * $(gennrand_gamma, $(a));");
   228     SET_CODE(
"$(value) = $(gennrand_binomial, (unsigned int)$(n), $(p));");
 Initialises variable by sampling from the exponential distribution. 
Definition: initVarSnippet.h:187
Initialises variable by sampling from the gamma distribution. 
Definition: initVarSnippet.h:205
Definition: initVarSnippet.h:130
Initialises variable to a constant value. 
Definition: initVarSnippet.h:58
Initialises variable by sampling from the normal distribution. 
Definition: initVarSnippet.h:109
#define GENN_EXPORT
Definition: gennExport.h:13
Used to mark variables as uninitialised - no initialisation code will be run. 
Definition: initVarSnippet.h:42
#define DECLARE_SNIPPET(TYPE, NUM_PARAMS)
Definition: snippet.h:19
Initialises variable by sampling from the binomial distribution. 
Definition: initVarSnippet.h:223
Definition: initVarSnippet.h:17
Definition: initVarSnippet.h:159
#define SET_DERIVED_PARAMS(...)
Definition: snippet.h:37
Base class for all value initialisation snippets. 
Definition: initVarSnippet.h:15
Base class for all code snippets. 
Definition: snippet.h:120
#define SET_PARAM_NAMES(...)
Definition: snippet.h:36
#define SET_CODE(CODE)
Definition: initVarSnippet.h:9
virtual std::string getCode() const
Definition: initVarSnippet.h:23
void validate() const
Validate names of parameters etc. 
Definition: snippet.h:218
Used to initialise synapse variables from a kernel. 
Definition: initVarSnippet.h:72
#define SET_EXTRA_GLOBAL_PARAMS(...)
Definition: snippet.h:38