GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
ModelSpec Class Reference

Object used for specifying a neuronal network model. More...

#include <modelSpec.h>

Inheritance diagram for ModelSpec:
ModelSpecInternal

Public Types

typedef std::map< std::string, NeuronGroupInternal >::value_type NeuronGroupValueType
 
typedef std::map< std::string, SynapseGroupInternal >::value_type SynapseGroupValueType
 
typedef std::map< std::string, CurrentSourceInternal >::value_type CurrentSourceValueType
 
typedef std::map< std::string, CustomUpdateInternal >::value_type CustomUpdateValueType
 
typedef std::map< std::string, CustomUpdateWUInternal >::value_type CustomUpdateWUValueType
 

Public Member Functions

 ModelSpec ()
 
 ModelSpec (const ModelSpec &)=delete
 
ModelSpecoperator= (const ModelSpec &)=delete
 
 ~ModelSpec ()
 
void setName (const std::string &name)
 Method to set the neuronal network model name. More...
 
void setPrecision (FloatType)
 Set numerical precision for floating point. More...
 
void setTimePrecision (TimePrecision timePrecision)
 Set numerical precision for time. More...
 
void setDT (double dt)
 Set the integration step size of the model. More...
 
void setTiming (bool timingEnabled)
 Set whether timers and timing commands are to be included. More...
 
void setSeed (unsigned int rngSeed)
 Set the random seed (disables automatic seeding if argument not 0). More...
 
void setDefaultVarLocation (VarLocation loc)
 What is the default location for model state variables? More...
 
void setDefaultExtraGlobalParamLocation (VarLocation loc)
 What is the default location for model extra global parameters? More...
 
void setDefaultSparseConnectivityLocation (VarLocation loc)
 What is the default location for sparse synaptic connectivity? More...
 
void setDefaultNarrowSparseIndEnabled (bool enabled)
 Sets default for whether narrow i.e. less than 32-bit types are used for sparse matrix indices. More...
 
void setMergePostsynapticModels (bool merge)
 Should compatible postsynaptic models and dendritic delay buffers be fused? More...
 
void setFusePostsynapticModels (bool fuse)
 Should compatible postsynaptic models and dendritic delay buffers be fused? More...
 
void setFusePrePostWeightUpdateModels (bool fuse)
 Should compatible pre and postsynaptic weight update model variables and updates be fused? More...
 
void setBatchSize (unsigned int batchSize)
 
const std::string & getName () const
 Gets the name of the neuronal network model. More...
 
const std::string & getPrecision () const
 Gets the floating point numerical precision. More...
 
std::string getTimePrecision () const
 Gets the floating point numerical precision used to represent time. More...
 
double getDT () const
 Gets the model integration step size. More...
 
unsigned int getSeed () const
 Get the random seed. More...
 
bool isTimingEnabled () const
 Are timers and timing commands enabled. More...
 
unsigned int getBatchSize () const
 
unsigned int getNumNeurons () const
 How many neurons make up the entire model. More...
 
NeuronGroupfindNeuronGroup (const std::string &name)
 Find a neuron group by name. More...
 
template<typename NeuronModel >
NeuronGroupaddNeuronPopulation (const std::string &name, unsigned int size, const NeuronModel *model, const typename NeuronModel::ParamValues &paramValues, const typename NeuronModel::VarValues &varInitialisers)
 Adds a new neuron group to the model using a neuron model managed by the user. More...
 
template<typename NeuronModel >
NeuronGroupaddNeuronPopulation (const std::string &name, unsigned int size, const typename NeuronModel::ParamValues &paramValues, const typename NeuronModel::VarValues &varInitialisers)
 Adds a new neuron group to the model using a singleton neuron model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
SynapseGroupfindSynapseGroup (const std::string &name)
 Find a synapse group by name. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const std::string &name, SynapseMatrixType mtype, unsigned int delaySteps, const std::string &src, const std::string &trg, const WeightUpdateModel *wum, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers, const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers, const PostsynapticModel *psm, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitSparseConnectivitySnippet::Init &connectivityInitialiser=uninitialisedConnectivity())
 Adds a synapse population to the model using weight update and postsynaptic models managed by the user. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const std::string &name, SynapseMatrixType mtype, unsigned int delaySteps, const std::string &src, const std::string &trg, const WeightUpdateModel *wum, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers, const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers, const PostsynapticModel *psm, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitToeplitzConnectivitySnippet::Init &connectivityInitialiser)
 Adds a synapse population to the model using weight update and postsynaptic models managed by the user. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const std::string &name, SynapseMatrixType mtype, unsigned int delaySteps, const std::string &src, const std::string &trg, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitSparseConnectivitySnippet::Init &connectivityInitialiser=uninitialisedConnectivity())
 Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const std::string &name, SynapseMatrixType mtype, unsigned int delaySteps, const std::string &src, const std::string &trg, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitToeplitzConnectivitySnippet::Init &connectivityInitialiser)
 Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const std::string &name, SynapseMatrixType mtype, unsigned int delaySteps, const std::string &src, const std::string &trg, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers, const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitSparseConnectivitySnippet::Init &connectivityInitialiser=uninitialisedConnectivity())
 Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const std::string &name, SynapseMatrixType mtype, unsigned int delaySteps, const std::string &src, const std::string &trg, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers, const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitToeplitzConnectivitySnippet::Init &connectivityInitialiser)
 Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
template<typename PostsynapticModel >
SynapseGroupaddSlaveSynapsePopulation (const std::string &name, const std::string &weightSharingMasterName, unsigned int delaySteps, const std::string &src, const std::string &trg, const PostsynapticModel *psm, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers)
 Adds a synapse population to the model using shared per-synapse variables and a postsynaptic model managed by the user. More...
 
template<typename PostsynapticModel >
SynapseGroupaddSlaveSynapsePopulation (const std::string &name, const std::string &weightSharingMasterName, unsigned int delaySteps, const std::string &src, const std::string &trg, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers)
 Adds a synapse population to the model using shared per-synapse variables and a singleton postsynaptic model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
CurrentSourcefindCurrentSource (const std::string &name)
 Find a current source by name. More...
 
template<typename CurrentSourceModel >
CurrentSourceaddCurrentSource (const std::string &currentSourceName, const CurrentSourceModel *model, const std::string &targetNeuronGroupName, const typename CurrentSourceModel::ParamValues &paramValues, const typename CurrentSourceModel::VarValues &varInitialisers)
 Adds a new current source to the model using a current source model managed by the user. More...
 
template<typename CurrentSourceModel >
CurrentSourceaddCurrentSource (const std::string &currentSourceName, const std::string &targetNeuronGroupName, const typename CurrentSourceModel::ParamValues &paramValues, const typename CurrentSourceModel::VarValues &varInitialisers)
 Adds a new current source to the model using a singleton current source model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
template<typename CustomUpdateModel >
CustomUpdateaddCustomUpdate (const std::string &name, const std::string &updateGroupName, const CustomUpdateModel *model, const typename CustomUpdateModel::ParamValues &paramValues, const typename CustomUpdateModel::VarValues &varInitialisers, const typename CustomUpdateModel::VarReferences &varReferences, const typename CustomUpdateModel::EGPReferences &egpReferences={})
 Adds a new custom update with references to the model using a custom update model managed by the user. More...
 
template<typename CustomUpdateModel >
CustomUpdateWUaddCustomUpdate (const std::string &name, const std::string &updateGroupName, const CustomUpdateModel *model, const typename CustomUpdateModel::ParamValues &paramValues, const typename CustomUpdateModel::VarValues &varInitialisers, const typename CustomUpdateModel::WUVarReferences &varReferences, const typename CustomUpdateModel::EGPReferences &egpReferences={})
 
template<typename CustomUpdateModel >
CustomUpdateaddCustomUpdate (const std::string &name, const std::string &updateGroupName, const typename CustomUpdateModel::ParamValues &paramValues, const typename CustomUpdateModel::VarValues &varInitialisers, const typename CustomUpdateModel::VarReferences &varReferences, const typename CustomUpdateModel::EGPReferences &egpReferences={})
 
template<typename CustomUpdateModel >
CustomUpdateWUaddCustomUpdate (const std::string &name, const std::string &updateGroupName, const typename CustomUpdateModel::ParamValues &paramValues, const typename CustomUpdateModel::VarValues &varInitialisers, const typename CustomUpdateModel::WUVarReferences &varReferences, const typename CustomUpdateModel::EGPReferences &egpReferences={})
 

Protected Member Functions

void finalize ()
 Finalise model. More...
 
std::string scalarExpr (double) const
 Get the string literal that should be used to represent a value in the model's floating-point type. More...
 
bool zeroCopyInUse () const
 Are any variables in any populations in this model using zero-copy memory? More...
 
bool isRecordingInUse () const
 Is recording enabled on any population in this model? More...
 
boost::uuids::detail::sha1::digest_type getHashDigest () const
 Get hash digest used for detecting changes. More...
 
const std::map< std::string, NeuronGroupInternal > & getNeuronGroups () const
 Get std::map containing local named NeuronGroup objects in model. More...
 
const std::map< std::string, SynapseGroupInternal > & getSynapseGroups () const
 Get std::map containing local named SynapseGroup objects in model. More...
 
const std::map< std::string, CurrentSourceInternal > & getLocalCurrentSources () const
 Get std::map containing local named CurrentSource objects in model. More...
 
const std::map< std::string, CustomUpdateInternal > & getCustomUpdates () const
 Get std::map containing named CustomUpdate objects in model. More...
 
const std::map< std::string, CustomUpdateWUInternal > & getCustomWUUpdates () const
 

Detailed Description

Object used for specifying a neuronal network model.

Member Typedef Documentation

◆ CurrentSourceValueType

typedef std::map<std::string, CurrentSourceInternal>::value_type ModelSpec::CurrentSourceValueType

◆ CustomUpdateValueType

typedef std::map<std::string, CustomUpdateInternal>::value_type ModelSpec::CustomUpdateValueType

◆ CustomUpdateWUValueType

typedef std::map<std::string, CustomUpdateWUInternal>::value_type ModelSpec::CustomUpdateWUValueType

◆ NeuronGroupValueType

typedef std::map<std::string, NeuronGroupInternal>::value_type ModelSpec::NeuronGroupValueType

◆ SynapseGroupValueType

typedef std::map<std::string, SynapseGroupInternal>::value_type ModelSpec::SynapseGroupValueType

Constructor & Destructor Documentation

◆ ModelSpec() [1/2]

ModelSpec::ModelSpec ( )

◆ ModelSpec() [2/2]

ModelSpec::ModelSpec ( const ModelSpec )
delete

◆ ~ModelSpec()

ModelSpec::~ModelSpec ( )

Member Function Documentation

◆ addCurrentSource() [1/2]

template<typename CurrentSourceModel >
CurrentSource* ModelSpec::addCurrentSource ( const std::string &  currentSourceName,
const CurrentSourceModel *  model,
const std::string &  targetNeuronGroupName,
const typename CurrentSourceModel::ParamValues &  paramValues,
const typename CurrentSourceModel::VarValues &  varInitialisers 
)
inline

Adds a new current source to the model using a current source model managed by the user.

Template Parameters
CurrentSourceModeltype of current source model (derived from CurrentSourceModels::Base).
Parameters
currentSourceNamestring containing unique name of current source.
modelcurrent source model to use for current source.
targetNeuronGroupNamestring name of the target neuron group
paramValuesparameters for model wrapped in CurrentSourceModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in CurrentSource::VarValues object.
Returns
pointer to newly created CurrentSource

◆ addCurrentSource() [2/2]

template<typename CurrentSourceModel >
CurrentSource* ModelSpec::addCurrentSource ( const std::string &  currentSourceName,
const std::string &  targetNeuronGroupName,
const typename CurrentSourceModel::ParamValues &  paramValues,
const typename CurrentSourceModel::VarValues &  varInitialisers 
)
inline

Adds a new current source to the model using a singleton current source model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
CurrentSourceModeltype of neuron model (derived from CurrentSourceModel::Base).
Parameters
currentSourceNamestring containing unique name of current source.
targetNeuronGroupNamestring name of the target neuron group
paramValuesparameters for model wrapped in CurrentSourceModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in CurrentSourceModel::VarValues object.
Returns
pointer to newly created CurrentSource

◆ addCustomUpdate() [1/4]

template<typename CustomUpdateModel >
CustomUpdate* ModelSpec::addCustomUpdate ( const std::string &  name,
const std::string &  updateGroupName,
const CustomUpdateModel *  model,
const typename CustomUpdateModel::ParamValues &  paramValues,
const typename CustomUpdateModel::VarValues &  varInitialisers,
const typename CustomUpdateModel::VarReferences &  varReferences,
const typename CustomUpdateModel::EGPReferences &  egpReferences = {} 
)
inline

Adds a new custom update with references to the model using a custom update model managed by the user.

Template Parameters
CustomUpdateModeltype of custom update model (derived from CustomUpdateModels::Base).
Parameters
namestring containing unique name of custom update
updateGroupNamestring containing name of group to add this custom update to
modelcustom update model to use for custom update.
paramValuesparameters for model wrapped in CustomUpdateModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in CustomUpdateModel::VarValues object.
varReferencesvariable references wrapped in CustomUpdateModel::VarReferences object.
Returns
pointer to newly created CustomUpdateBase

◆ addCustomUpdate() [2/4]

template<typename CustomUpdateModel >
CustomUpdateWU* ModelSpec::addCustomUpdate ( const std::string &  name,
const std::string &  updateGroupName,
const CustomUpdateModel *  model,
const typename CustomUpdateModel::ParamValues &  paramValues,
const typename CustomUpdateModel::VarValues &  varInitialisers,
const typename CustomUpdateModel::WUVarReferences &  varReferences,
const typename CustomUpdateModel::EGPReferences &  egpReferences = {} 
)
inline

Adds a new custom update with references to weight update model variable to the model using a custom update model managed by the user

Template Parameters
CustomUpdateModeltype of custom update model (derived from CustomUpdateModels::Base).
Parameters
namestring containing unique name of custom update
updateGroupNamestring containing name of group to add this custom update to
operationCustomUpdate::Operation specifying operation update should be performed within
modelcustom update model to use for custom update.
paramValuesparameters for model wrapped in CustomUpdateModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in CustomUpdateModel::VarValues object.
varReferencesvariable references wrapped in CustomUpdateModel::VarReferences object.
Returns
pointer to newly created CustomUpdateBase

◆ addCustomUpdate() [3/4]

template<typename CustomUpdateModel >
CustomUpdate* ModelSpec::addCustomUpdate ( const std::string &  name,
const std::string &  updateGroupName,
const typename CustomUpdateModel::ParamValues &  paramValues,
const typename CustomUpdateModel::VarValues &  varInitialisers,
const typename CustomUpdateModel::VarReferences &  varReferences,
const typename CustomUpdateModel::EGPReferences &  egpReferences = {} 
)
inline

Adds a new custom update to the model using a singleton custom update model created using standard DECLARE_CUSTOM_UPDATE_MODEL and IMPLEMENT_MODEL macros

Template Parameters
CustomUpdateModeltype of custom update model (derived from CustomUpdateModels::Base).
Parameters
namestring containing unique name of custom update
updateGroupNamestring containing name of group to add this custom update to
paramValuesparameters for model wrapped in CustomUpdateModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in CustomUpdateModel::VarValues object.
varInitialisersvariable references wrapped in CustomUpdateModel::VarReferences object.
Returns
pointer to newly created CustomUpdateBase

◆ addCustomUpdate() [4/4]

template<typename CustomUpdateModel >
CustomUpdateWU* ModelSpec::addCustomUpdate ( const std::string &  name,
const std::string &  updateGroupName,
const typename CustomUpdateModel::ParamValues &  paramValues,
const typename CustomUpdateModel::VarValues &  varInitialisers,
const typename CustomUpdateModel::WUVarReferences &  varReferences,
const typename CustomUpdateModel::EGPReferences &  egpReferences = {} 
)
inline

Adds a new custom update with references to weight update model variables to the model using a singleton custom update model created using standard DECLARE_CUSTOM_UPDATE_MODEL and IMPLEMENT_MODEL macros

Template Parameters
CustomUpdateModeltype of neuron model (derived from CustomUpdateModels::Base).
Parameters
namestring containing unique name of custom update
updateGroupNamestring containing name of group to add this custom update to
operationCustomUpdate::Operation specifying operation update should be performed within
paramValuesparameters for model wrapped in CustomUpdateModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in CustomUpdateModel::VarValues object.
varInitialisersvariable references wrapped in CustomUpdateModel::VarReferences object.
Returns
pointer to newly created CustomUpdateBase

◆ addNeuronPopulation() [1/2]

template<typename NeuronModel >
NeuronGroup* ModelSpec::addNeuronPopulation ( const std::string &  name,
unsigned int  size,
const NeuronModel *  model,
const typename NeuronModel::ParamValues &  paramValues,
const typename NeuronModel::VarValues &  varInitialisers 
)
inline

Adds a new neuron group to the model using a neuron model managed by the user.

Template Parameters
NeuronModeltype of neuron model (derived from NeuronModels::Base).
Parameters
namestring containing unique name of neuron population.
sizeinteger specifying how many neurons are in the population.
modelneuron model to use for neuron group.
paramValuesparameters for model wrapped in NeuronModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created NeuronGroup

◆ addNeuronPopulation() [2/2]

template<typename NeuronModel >
NeuronGroup* ModelSpec::addNeuronPopulation ( const std::string &  name,
unsigned int  size,
const typename NeuronModel::ParamValues &  paramValues,
const typename NeuronModel::VarValues &  varInitialisers 
)
inline

Adds a new neuron group to the model using a singleton neuron model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
NeuronModeltype of neuron model (derived from NeuronModels::Base).
Parameters
namestring containing unique name of neuron population.
sizeinteger specifying how many neurons are in the population.
paramValuesparameters for model wrapped in NeuronModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created NeuronGroup

◆ addSlaveSynapsePopulation() [1/2]

template<typename PostsynapticModel >
SynapseGroup* ModelSpec::addSlaveSynapsePopulation ( const std::string &  name,
const std::string &  weightSharingMasterName,
unsigned int  delaySteps,
const std::string &  src,
const std::string &  trg,
const PostsynapticModel *  psm,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers 
)
inline

Adds a synapse population to the model using shared per-synapse variables and a postsynaptic model managed by the user.

Template Parameters
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of synapse population.
weightSharingMasterNamestring containing name of 'master' synapse population
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
psmpostsynaptic model to use for synapse group.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created SynapseGroup

◆ addSlaveSynapsePopulation() [2/2]

template<typename PostsynapticModel >
SynapseGroup* ModelSpec::addSlaveSynapsePopulation ( const std::string &  name,
const std::string &  weightSharingMasterName,
unsigned int  delaySteps,
const std::string &  src,
const std::string &  trg,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers 
)
inline

Adds a synapse population to the model using shared per-synapse variables and a singleton postsynaptic model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of synapse population.
weightSharingMasterNamestring containing name of 'master' synapse population
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created SynapseGroup

◆ addSynapsePopulation() [1/6]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* ModelSpec::addSynapsePopulation ( const std::string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const std::string &  src,
const std::string &  trg,
const WeightUpdateModel *  wum,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &  weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &  weightPostVarInitialisers,
const PostsynapticModel *  psm,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitSparseConnectivitySnippet::Init connectivityInitialiser = uninitialisedConnectivity() 
)
inline

Adds a synapse population to the model using weight update and postsynaptic models managed by the user.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of synapse population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
wumweight update model to use for synapse group.
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPreVarInitialisersweight update model presynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPostVarInitialisersweight update model postsynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
psmpostsynaptic model to use for synapse group.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
connectivityInitialisersparse connectivity initialisation snippet used to initialise connectivity for SynapseMatrixConnectivity::SPARSE or SynapseMatrixConnectivity::BITMASK. Typically wrapped with it's parameters using initConnectivity function
Returns
pointer to newly created SynapseGroup

◆ addSynapsePopulation() [2/6]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* ModelSpec::addSynapsePopulation ( const std::string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const std::string &  src,
const std::string &  trg,
const WeightUpdateModel *  wum,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &  weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &  weightPostVarInitialisers,
const PostsynapticModel *  psm,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitToeplitzConnectivitySnippet::Init connectivityInitialiser 
)
inline

Adds a synapse population to the model using weight update and postsynaptic models managed by the user.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of synapse population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
wumweight update model to use for synapse group.
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPreVarInitialisersweight update model presynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPostVarInitialisersweight update model postsynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
psmpostsynaptic model to use for synapse group.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
connectivityInitialisertoeplitz connectivity initialisation snippet used to initialise connectivity for SynapseMatrixConnectivity::TOEPLITZ. Typically wrapped with it's parameters using initToeplitzConnectivity function
Returns
pointer to newly created SynapseGroup

◆ addSynapsePopulation() [3/6]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* ModelSpec::addSynapsePopulation ( const std::string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const std::string &  src,
const std::string &  trg,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitSparseConnectivitySnippet::Init connectivityInitialiser = uninitialisedConnectivity() 
)
inline

Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of synapse population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
connectivityInitialisersparse connectivity initialisation snippet used to initialise connectivity for SynapseMatrixConnectivity::SPARSE or SynapseMatrixConnectivity::BITMASK. Typically wrapped with it's parameters using initConnectivity function
Returns
pointer to newly created SynapseGroup

◆ addSynapsePopulation() [4/6]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* ModelSpec::addSynapsePopulation ( const std::string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const std::string &  src,
const std::string &  trg,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitToeplitzConnectivitySnippet::Init connectivityInitialiser 
)
inline

Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of synapse population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
connectivityInitialisertoeplitz connectivity initialisation snippet used to initialise connectivity for SynapseMatrixConnectivity::TOEPLITZ. Typically wrapped with it's parameters using initToeplitzConnectivity function
Returns
pointer to newly created SynapseGroup

◆ addSynapsePopulation() [5/6]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* ModelSpec::addSynapsePopulation ( const std::string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const std::string &  src,
const std::string &  trg,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &  weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &  weightPostVarInitialisers,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitSparseConnectivitySnippet::Init connectivityInitialiser = uninitialisedConnectivity() 
)
inline

Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of synapse population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model per-synapse state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPreVarInitialisersweight update model presynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPostVarInitialisersweight update model postsynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
connectivityInitialisersparse connectivity initialisation snippet used to initialise connectivity for SynapseMatrixConnectivity::SPARSE or SynapseMatrixConnectivity::BITMASK. Typically wrapped with it's parameters using initConnectivity function
Returns
pointer to newly created SynapseGroup

◆ addSynapsePopulation() [6/6]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* ModelSpec::addSynapsePopulation ( const std::string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const std::string &  src,
const std::string &  trg,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &  weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &  weightPostVarInitialisers,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitToeplitzConnectivitySnippet::Init connectivityInitialiser 
)
inline

Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of synapse population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model per-synapse state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPreVarInitialisersweight update model presynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPostVarInitialisersweight update model postsynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
connectivityInitialisertoeplitz connectivity initialisation snippet used to initialise connectivity for SynapseMatrixConnectivity::TOEPLITZ. Typically wrapped with it's parameters using initToeplitzConnectivity function
Returns
pointer to newly created SynapseGroup

◆ finalize()

void ModelSpec::finalize ( )
protected

Finalise model.

◆ findCurrentSource()

CurrentSource * ModelSpec::findCurrentSource ( const std::string &  name)

Find a current source by name.

This function attempts to find an existing current source.

◆ findNeuronGroup()

NeuronGroup* ModelSpec::findNeuronGroup ( const std::string &  name)
inline

Find a neuron group by name.

◆ findSynapseGroup()

SynapseGroup * ModelSpec::findSynapseGroup ( const std::string &  name)

Find a synapse group by name.

◆ getBatchSize()

unsigned int ModelSpec::getBatchSize ( ) const
inline

◆ getCustomUpdates()

const std::map<std::string, CustomUpdateInternal>& ModelSpec::getCustomUpdates ( ) const
inlineprotected

Get std::map containing named CustomUpdate objects in model.

◆ getCustomWUUpdates()

const std::map<std::string, CustomUpdateWUInternal>& ModelSpec::getCustomWUUpdates ( ) const
inlineprotected

◆ getDT()

double ModelSpec::getDT ( ) const
inline

Gets the model integration step size.

◆ getHashDigest()

boost::uuids::detail::sha1::digest_type ModelSpec::getHashDigest ( ) const
protected

Get hash digest used for detecting changes.

◆ getLocalCurrentSources()

const std::map<std::string, CurrentSourceInternal>& ModelSpec::getLocalCurrentSources ( ) const
inlineprotected

Get std::map containing local named CurrentSource objects in model.

◆ getName()

const std::string& ModelSpec::getName ( ) const
inline

Gets the name of the neuronal network model.

◆ getNeuronGroups()

const std::map<std::string, NeuronGroupInternal>& ModelSpec::getNeuronGroups ( ) const
inlineprotected

Get std::map containing local named NeuronGroup objects in model.

◆ getNumNeurons()

unsigned int ModelSpec::getNumNeurons ( ) const

How many neurons make up the entire model.

◆ getPrecision()

const std::string& ModelSpec::getPrecision ( ) const
inline

Gets the floating point numerical precision.

◆ getSeed()

unsigned int ModelSpec::getSeed ( ) const
inline

Get the random seed.

◆ getSynapseGroups()

const std::map<std::string, SynapseGroupInternal>& ModelSpec::getSynapseGroups ( ) const
inlineprotected

Get std::map containing local named SynapseGroup objects in model.

◆ getTimePrecision()

std::string ModelSpec::getTimePrecision ( ) const

Gets the floating point numerical precision used to represent time.

◆ isRecordingInUse()

bool ModelSpec::isRecordingInUse ( ) const
protected

Is recording enabled on any population in this model?

◆ isTimingEnabled()

bool ModelSpec::isTimingEnabled ( ) const
inline

Are timers and timing commands enabled.

◆ operator=()

ModelSpec& ModelSpec::operator= ( const ModelSpec )
delete

◆ scalarExpr()

std::string ModelSpec::scalarExpr ( double  val) const
protected

Get the string literal that should be used to represent a value in the model's floating-point type.

◆ setBatchSize()

void ModelSpec::setBatchSize ( unsigned int  batchSize)
inline

◆ setDefaultExtraGlobalParamLocation()

void ModelSpec::setDefaultExtraGlobalParamLocation ( VarLocation  loc)
inline

What is the default location for model extra global parameters?

Historically, this was just left up to the user to handle

◆ setDefaultNarrowSparseIndEnabled()

void ModelSpec::setDefaultNarrowSparseIndEnabled ( bool  enabled)
inline

Sets default for whether narrow i.e. less than 32-bit types are used for sparse matrix indices.

◆ setDefaultSparseConnectivityLocation()

void ModelSpec::setDefaultSparseConnectivityLocation ( VarLocation  loc)
inline

What is the default location for sparse synaptic connectivity?

Historically, everything was allocated on both the host AND device

◆ setDefaultVarLocation()

void ModelSpec::setDefaultVarLocation ( VarLocation  loc)
inline

What is the default location for model state variables?

Historically, everything was allocated on both the host AND device

◆ setDT()

void ModelSpec::setDT ( double  dt)
inline

Set the integration step size of the model.

◆ setFusePostsynapticModels()

void ModelSpec::setFusePostsynapticModels ( bool  fuse)
inline

Should compatible postsynaptic models and dendritic delay buffers be fused?

This can significantly reduce the cost of updating neuron population but means that per-synapse group inSyn arrays can not be retrieved

◆ setFusePrePostWeightUpdateModels()

void ModelSpec::setFusePrePostWeightUpdateModels ( bool  fuse)
inline

Should compatible pre and postsynaptic weight update model variables and updates be fused?

This can significantly reduce the cost of updating neuron populations but means that per-synaptic group per and postsynaptic variables cannot be retrieved

◆ setMergePostsynapticModels()

void ModelSpec::setMergePostsynapticModels ( bool  merge)
inline

Should compatible postsynaptic models and dendritic delay buffers be fused?

This can significantly reduce the cost of updating neuron population but means that per-synapse group inSyn arrays can not be retrieved

◆ setName()

void ModelSpec::setName ( const std::string &  name)
inline

Method to set the neuronal network model name.

◆ setPrecision()

void ModelSpec::setPrecision ( FloatType  floattype)

Set numerical precision for floating point.

This function sets the numerical precision of floating type variables. By default, it is GENN_GENN_FLOAT.

◆ setSeed()

void ModelSpec::setSeed ( unsigned int  rngSeed)
inline

Set the random seed (disables automatic seeding if argument not 0).

◆ setTimePrecision()

void ModelSpec::setTimePrecision ( TimePrecision  timePrecision)
inline

Set numerical precision for time.

◆ setTiming()

void ModelSpec::setTiming ( bool  timingEnabled)
inline

Set whether timers and timing commands are to be included.

◆ zeroCopyInUse()

bool ModelSpec::zeroCopyInUse ( ) const
protected

Are any variables in any populations in this model using zero-copy memory?


The documentation for this class was generated from the following files: