71 inline typename std::enable_if<std::is_same<typename S::ParamValues, Snippet::ValueBase<0>>::value,
Models::VarInit>::type
initVar()
81 return Models::VarInit(InitVarSnippet::Uninitialised::getInstance(), {});
169 const SynapseGroup *transposeSG =
nullptr,
const std::string &transposeVarName =
"")
241 void setName(
const std::string &name){ m_Name = name; }
253 void setTiming(
bool timingEnabled){ m_TimingEnabled = timingEnabled; }
256 void setSeed(
unsigned int rngSeed){ m_Seed = rngSeed; }
288 const std::string &
getName()
const{
return m_Name; }
294 std::string getTimePrecision()
const;
297 double getDT()
const {
return m_DT; }
300 unsigned int getSeed()
const {
return m_Seed; }
310 unsigned int getNumNeurons()
const;
323 template<
typename NeuronModel>
325 const typename NeuronModel::ParamValues ¶mValues,
326 const typename NeuronModel::VarValues &varInitialisers)
329 auto result = m_LocalNeuronGroups.emplace(std::piecewise_construct,
330 std::forward_as_tuple(name),
331 std::forward_as_tuple(name, size, model,
332 paramValues.getInitialisers(), varInitialisers.getInitialisers(),
333 m_DefaultVarLocation, m_DefaultExtraGlobalParamLocation));
336 throw std::runtime_error(
"Cannot add a neuron population with duplicate name:" + name);
339 return &result.first->second;
350 template<
typename NeuronModel>
352 const typename NeuronModel::ParamValues ¶mValues,
const typename NeuronModel::VarValues &varInitialisers)
354 return addNeuronPopulation<NeuronModel>(name, size, NeuronModel::getInstance(), paramValues, varInitialisers);
360 SynapseGroup *findSynapseGroup(
const std::string &name);
383 template<
typename WeightUpdateModel,
typename PostsynapticModel>
385 const WeightUpdateModel *wum,
const typename WeightUpdateModel::ParamValues &weightParamValues,
const typename WeightUpdateModel::VarValues &weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers,
386 const PostsynapticModel *psm,
const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers,
390 return addSynapsePopulation(name, mtype, delaySteps, src, trg,
391 wum, weightParamValues, weightVarInitialisers, weightPreVarInitialisers, weightPostVarInitialisers,
392 psm, postsynapticParamValues, postsynapticVarInitialisers,
393 connectivityInitialiser, uninitialisedToeplitz);
416 template<
typename WeightUpdateModel,
typename PostsynapticModel>
418 const WeightUpdateModel *wum,
const typename WeightUpdateModel::ParamValues &weightParamValues,
const typename WeightUpdateModel::VarValues &weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers,
419 const PostsynapticModel *psm,
const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers,
423 return addSynapsePopulation(name, mtype, delaySteps, src, trg,
424 wum, weightParamValues, weightVarInitialisers, weightPreVarInitialisers, weightPostVarInitialisers,
425 psm, postsynapticParamValues, postsynapticVarInitialisers,
445 template<
typename WeightUpdateModel,
typename PostsynapticModel>
447 const typename WeightUpdateModel::ParamValues &weightParamValues,
const typename WeightUpdateModel::VarValues &weightVarInitialisers,
448 const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers,
452 typename WeightUpdateModel::PreVarValues weightPreVarInitialisers;
453 typename WeightUpdateModel::PostVarValues weightPostVarInitialisers;
455 return addSynapsePopulation(name, mtype, delaySteps, src, trg,
456 WeightUpdateModel::getInstance(), weightParamValues, weightVarInitialisers, weightPreVarInitialisers, weightPostVarInitialisers,
457 PostsynapticModel::getInstance(), postsynapticParamValues, postsynapticVarInitialisers,
458 connectivityInitialiser);
476 template<
typename WeightUpdateModel,
typename PostsynapticModel>
478 const typename WeightUpdateModel::ParamValues &weightParamValues,
const typename WeightUpdateModel::VarValues &weightVarInitialisers,
479 const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers,
483 typename WeightUpdateModel::PreVarValues weightPreVarInitialisers;
484 typename WeightUpdateModel::PostVarValues weightPostVarInitialisers;
486 return addSynapsePopulation(name, mtype, delaySteps, src, trg,
487 WeightUpdateModel::getInstance(), weightParamValues, weightVarInitialisers, weightPreVarInitialisers, weightPostVarInitialisers,
488 PostsynapticModel::getInstance(), postsynapticParamValues, postsynapticVarInitialisers,
489 connectivityInitialiser);
510 template<
typename WeightUpdateModel,
typename PostsynapticModel>
512 const typename WeightUpdateModel::ParamValues &weightParamValues,
const typename WeightUpdateModel::VarValues &weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers,
513 const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers,
516 return addSynapsePopulation(name, mtype, delaySteps, src, trg,
517 WeightUpdateModel::getInstance(), weightParamValues, weightVarInitialisers, weightPreVarInitialisers, weightPostVarInitialisers,
518 PostsynapticModel::getInstance(), postsynapticParamValues, postsynapticVarInitialisers,
519 connectivityInitialiser);
540 template<
typename WeightUpdateModel,
typename PostsynapticModel>
542 const typename WeightUpdateModel::ParamValues &weightParamValues,
const typename WeightUpdateModel::VarValues &weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers,
543 const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers,
546 return addSynapsePopulation(name, mtype, delaySteps, src, trg,
547 WeightUpdateModel::getInstance(), weightParamValues, weightVarInitialisers, weightPreVarInitialisers, weightPostVarInitialisers,
548 PostsynapticModel::getInstance(), postsynapticParamValues, postsynapticVarInitialisers,
549 connectivityInitialiser);
565 template<
typename PostsynapticModel>
567 const PostsynapticModel *psm,
const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers)
570 auto srcNeuronGrp = findNeuronGroupInternal(src);
571 auto trgNeuronGrp = findNeuronGroupInternal(trg);
574 auto masterGrp = findSynapseGroupInternal(weightSharingMasterName);
575 const auto *wum = masterGrp->getWUModel();
578 const auto wumVars = wum->getVars();
580 std::any_of(wumVars.cbegin(), wumVars.cend(),
586 throw std::runtime_error(
"Individual synapse variables can only be shared if they are read-only");
590 if ((srcNeuronGrp->getNumNeurons() != masterGrp->getSrcNeuronGroup()->getNumNeurons())
591 || (trgNeuronGrp->getNumNeurons() != masterGrp->getTrgNeuronGroup()->getNumNeurons()))
593 throw std::runtime_error(
"Size of populations connected by shared weights must match");
598 if(!wum->getPreVars().empty() || !wum->getPostVars().empty()) {
599 throw std::runtime_error(
"Synapse groups with pre and postsynpatic variables cannot be shared");
604 auto result = m_LocalSynapseGroups.emplace(
605 std::piecewise_construct,
606 std::forward_as_tuple(name),
607 std::forward_as_tuple(name, masterGrp, masterGrp->getMatrixType(), delaySteps,
608 wum, masterGrp->getWUParams(), masterGrp->getWUVarInitialisers(), masterGrp->getWUPreVarInitialisers(), masterGrp->getWUPostVarInitialisers(),
609 psm, postsynapticParamValues.getInitialisers(), postsynapticVarInitialisers.getInitialisers(),
610 srcNeuronGrp, trgNeuronGrp, masterGrp->getConnectivityInitialiser(), uninitialisedToeplitz,
611 m_DefaultVarLocation, m_DefaultExtraGlobalParamLocation, m_DefaultSparseConnectivityLocation, m_DefaultNarrowSparseIndEnabled));
614 throw std::runtime_error(
"Cannot add a synapse population with duplicate name:" + name);
617 return &result.first->second;
631 template<
typename PostsynapticModel>
633 const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers)
635 return addSlaveSynapsePopulation(name, weightSharingMasterName, delaySteps, src, trg,
636 PostsynapticModel::getInstance(), postsynapticParamValues, postsynapticVarInitialisers);
652 template<
typename CurrentSourceModel>
654 const std::string &targetNeuronGroupName,
655 const typename CurrentSourceModel::ParamValues ¶mValues,
656 const typename CurrentSourceModel::VarValues &varInitialisers)
658 auto targetGroup = findNeuronGroupInternal(targetNeuronGroupName);
661 auto result = m_LocalCurrentSources.emplace(std::piecewise_construct,
662 std::forward_as_tuple(currentSourceName),
663 std::forward_as_tuple(currentSourceName, model, paramValues.getInitialisers(),
664 varInitialisers.getInitialisers(), targetGroup,
665 m_DefaultVarLocation, m_DefaultExtraGlobalParamLocation));
668 throw std::runtime_error(
"Cannot add a current source with duplicate name:" + currentSourceName);
671 targetGroup->injectCurrent(&result.first->second);
672 return &result.first->second;
683 template<
typename CurrentSourceModel>
685 const typename CurrentSourceModel::ParamValues ¶mValues,
686 const typename CurrentSourceModel::VarValues &varInitialisers)
688 return addCurrentSource<CurrentSourceModel>(currentSourceName, CurrentSourceModel::getInstance(),
689 targetNeuronGroupName, paramValues, varInitialisers);
701 template<
typename CustomUpdateModel>
703 const typename CustomUpdateModel::ParamValues ¶mValues,
704 const typename CustomUpdateModel::VarValues &varInitialisers,
705 const typename CustomUpdateModel::VarReferences &varReferences,
706 const typename CustomUpdateModel::EGPReferences &egpReferences = {})
709 auto result = m_CustomUpdates.emplace(std::piecewise_construct,
710 std::forward_as_tuple(name),
711 std::forward_as_tuple(name, updateGroupName, model,
712 paramValues.getInitialisers(), varInitialisers.getInitialisers(), varReferences.getInitialisers(),
713 egpReferences.getInitialisers(), m_DefaultVarLocation, m_DefaultExtraGlobalParamLocation));
716 throw std::runtime_error(
"Cannot add a custom update with duplicate name:" + name);
719 return &result.first->second;
734 template<
typename CustomUpdateModel>
736 const CustomUpdateModel *model,
const typename CustomUpdateModel::ParamValues ¶mValues,
737 const typename CustomUpdateModel::VarValues &varInitialisers,
738 const typename CustomUpdateModel::WUVarReferences &varReferences,
739 const typename CustomUpdateModel::EGPReferences &egpReferences = {})
742 auto result = m_CustomWUUpdates.emplace(std::piecewise_construct,
743 std::forward_as_tuple(name),
744 std::forward_as_tuple(name, updateGroupName, model,
745 paramValues.getInitialisers(), varInitialisers.getInitialisers(), varReferences.getInitialisers(),
746 egpReferences.getInitialisers(), m_DefaultVarLocation, m_DefaultExtraGlobalParamLocation));
749 throw std::runtime_error(
"Cannot add a custom update with duplicate name:" + name);
752 return &result.first->second;
765 template<
typename CustomUpdateModel>
767 const typename CustomUpdateModel::ParamValues ¶mValues,
768 const typename CustomUpdateModel::VarValues &varInitialisers,
769 const typename CustomUpdateModel::VarReferences &varReferences,
770 const typename CustomUpdateModel::EGPReferences &egpReferences = {})
772 return addCustomUpdate<CustomUpdateModel>(name, updateGroupName, CustomUpdateModel::getInstance(),
773 paramValues, varInitialisers, varReferences, egpReferences);
787 template<
typename CustomUpdateModel>
789 const typename CustomUpdateModel::ParamValues ¶mValues,
790 const typename CustomUpdateModel::VarValues &varInitialisers,
791 const typename CustomUpdateModel::WUVarReferences &varReferences,
792 const typename CustomUpdateModel::EGPReferences &egpReferences = {})
794 return addCustomUpdate<CustomUpdateModel>(name, updateGroupName, CustomUpdateModel::getInstance(),
795 paramValues, varInitialisers, varReferences, egpReferences);
809 std::string scalarExpr(
double)
const;
812 bool zeroCopyInUse()
const;
815 bool isRecordingInUse()
const;
818 boost::uuids::detail::sha1::digest_type getHashDigest()
const;
821 const std::map<std::string, NeuronGroupInternal> &
getNeuronGroups()
const{
return m_LocalNeuronGroups; }
824 const std::map<std::string, SynapseGroupInternal> &
getSynapseGroups()
const{
return m_LocalSynapseGroups; }
830 const std::map<std::string, CustomUpdateInternal> &
getCustomUpdates()
const {
return m_CustomUpdates; }
831 const std::map<std::string, CustomUpdateWUInternal> &
getCustomWUUpdates()
const {
return m_CustomWUUpdates; }
843 template<
typename WeightUpdateModel,
typename PostsynapticModel>
844 SynapseGroup *addSynapsePopulation(
const std::string &name,
SynapseMatrixType mtype,
unsigned int delaySteps,
const std::string& src,
const std::string& trg,
845 const WeightUpdateModel *wum,
const typename WeightUpdateModel::ParamValues &weightParamValues,
const typename WeightUpdateModel::VarValues &weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers,
846 const PostsynapticModel *psm,
const typename PostsynapticModel::ParamValues &postsynapticParamValues,
const typename PostsynapticModel::VarValues &postsynapticVarInitialisers,
850 auto srcNeuronGrp = findNeuronGroupInternal(src);
851 auto trgNeuronGrp = findNeuronGroupInternal(trg);
854 auto result = m_LocalSynapseGroups.emplace(
855 std::piecewise_construct,
856 std::forward_as_tuple(name),
857 std::forward_as_tuple(name,
nullptr, mtype, delaySteps,
858 wum, weightParamValues.getInitialisers(), weightVarInitialisers.getInitialisers(), weightPreVarInitialisers.getInitialisers(), weightPostVarInitialisers.getInitialisers(),
859 psm, postsynapticParamValues.getInitialisers(), postsynapticVarInitialisers.getInitialisers(),
860 srcNeuronGrp, trgNeuronGrp,
861 connectivityInitialiser, toeplitzConnectivityInitialiser,
862 m_DefaultVarLocation, m_DefaultExtraGlobalParamLocation,
863 m_DefaultSparseConnectivityLocation, m_DefaultNarrowSparseIndEnabled));
866 throw std::runtime_error(
"Cannot add a synapse population with duplicate name:" + name);
869 return &result.first->second;
877 std::map<std::string, NeuronGroupInternal> m_LocalNeuronGroups;
880 std::map<std::string, SynapseGroupInternal> m_LocalSynapseGroups;
883 std::map<std::string, CurrentSourceInternal> m_LocalCurrentSources;
886 std::map<std::string, CustomUpdateInternal> m_CustomUpdates;
887 std::map<std::string, CustomUpdateWUInternal> m_CustomWUUpdates;
893 std::string m_Precision;
902 bool m_TimingEnabled;
917 bool m_DefaultNarrowSparseIndEnabled;
921 bool m_ShouldFusePostsynapticModels;
925 bool m_ShouldFusePrePostWeightUpdateModels;
928 unsigned int m_BatchSize;
NeuronGroup * addNeuronPopulation(const std::string &name, unsigned int size, const typename NeuronModel::ParamValues ¶mValues, const typename NeuronModel::VarValues &varInitialisers)
Adds a new neuron group to the model using a singleton neuron model created using standard DECLARE_MO...
Definition: modelSpec.h:351
void setBatchSize(unsigned int batchSize)
Definition: modelSpec.h:285
Definition: neuronGroup.h:21
Definition: neuronGroupInternal.h:9
std::map< std::string, CustomUpdateInternal >::value_type CustomUpdateValueType
Definition: modelSpec.h:228
const std::map< std::string, SynapseGroupInternal > & getSynapseGroups() const
Get std::map containing local named SynapseGroup objects in model.
Definition: modelSpec.h:824
SynapseGroup * 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)
Adds a synapse population to the model using shared per-synapse variables and a postsynaptic model ma...
Definition: modelSpec.h:566
ModelSpec NNmodel
Definition: modelSpec.h:932
bool isTimingEnabled() const
Are timers and timing commands enabled.
Definition: modelSpec.h:303
VarLocation
< Flags defining which memory space variables should be allocated in
Definition: variableMode.h:10
Time uses default model precision.
unsigned int getBatchSize() const
Definition: modelSpec.h:305
Models::VarInit uninitialisedVar()
Mark a variable as uninitialised.
Definition: modelSpec.h:79
TimePrecision
Precision to use for variables which store time.
Definition: modelSpec.h:50
Models::WUVarReference createWUVarRef(const SynapseGroup *sg, const std::string &varName, const SynapseGroup *transposeSG=nullptr, const std::string &transposeVarName="")
Creates a reference to a weight update model variable.
Definition: modelSpec.h:168
static EGPReference createWUEGPRef(const SynapseGroup *sg, const std::string &egpName)
Definition: models.cc:214
Definition: customUpdate.h:199
Definition: initSparseConnectivitySnippet.h:81
void setSeed(unsigned int rngSeed)
Set the random seed (disables automatic seeding if argument not 0).
Definition: modelSpec.h:256
void setDefaultSparseConnectivityLocation(VarLocation loc)
What is the default location for sparse synaptic connectivity?
Definition: modelSpec.h:268
#define GENN_EXPORT
Definition: gennExport.h:13
CurrentSource * addCurrentSource(const std::string ¤tSourceName, const CurrentSourceModel *model, const std::string &targetNeuronGroupName, const typename CurrentSourceModel::ParamValues ¶mValues, const typename CurrentSourceModel::VarValues &varInitialisers)
Adds a new current source to the model using a current source model managed by the user...
Definition: modelSpec.h:653
CustomUpdateWU * addCustomUpdate(const std::string &name, const std::string &updateGroupName, const CustomUpdateModel *model, const typename CustomUpdateModel::ParamValues ¶mValues, const typename CustomUpdateModel::VarValues &varInitialisers, const typename CustomUpdateModel::WUVarReferences &varReferences, const typename CustomUpdateModel::EGPReferences &egpReferences={})
Definition: modelSpec.h:735
CustomUpdateWU * addCustomUpdate(const std::string &name, const std::string &updateGroupName, const typename CustomUpdateModel::ParamValues ¶mValues, const typename CustomUpdateModel::VarValues &varInitialisers, const typename CustomUpdateModel::WUVarReferences &varReferences, const typename CustomUpdateModel::EGPReferences &egpReferences={})
Definition: modelSpec.h:788
double getDT() const
Gets the model integration step size.
Definition: modelSpec.h:297
Time uses single precision - not suitable for long simulations.
Definition: customUpdate.h:252
SynapseGroup * 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)
Adds a synapse population to the model using weight update and postsynaptic models managed by the use...
Definition: modelSpec.h:417
Definition: initToeplitzConnectivitySnippet.h:66
static VarReference createWUPreVarRef(const SynapseGroup *sg, const std::string &varName)
Definition: models.cc:62
Models::VarReference createWUPreVarRef(const SynapseGroup *sg, const std::string &varName)
Creates a reference to a weight update model presynaptic variable.
Definition: modelSpec.h:156
Definition: synapseGroupInternal.h:9
Object used for specifying a neuronal network model.
Definition: modelSpec.h:220
std::map< std::string, CustomUpdateWUInternal >::value_type CustomUpdateWUValueType
Definition: modelSpec.h:229
Models::EGPReference createEGPRef(const NeuronGroup *ng, const std::string &egpName)
Creates a reference to a neuron group extra global parameter.
Definition: modelSpec.h:181
const std::string & getName() const
Gets the name of the neuronal network model.
Definition: modelSpec.h:288
static VarReference createWUPostVarRef(const SynapseGroup *sg, const std::string &varName)
Definition: models.cc:72
CustomUpdate * addCustomUpdate(const std::string &name, const std::string &updateGroupName, const CustomUpdateModel *model, const typename CustomUpdateModel::ParamValues ¶mValues, 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...
Definition: modelSpec.h:702
Models::EGPReference createWUEGPRef(const SynapseGroup *sg, const std::string &egpName)
Creates a reference to a weight update model extra global parameter.
Definition: modelSpec.h:211
static VarReference createVarRef(const NeuronGroup *ng, const std::string &varName)
Definition: models.cc:33
CurrentSource * addCurrentSource(const std::string ¤tSourceName, const std::string &targetNeuronGroupName, const typename CurrentSourceModel::ParamValues ¶mValues, const typename CurrentSourceModel::VarValues &varInitialisers)
Adds a new current source to the model using a singleton current source model created using standard ...
Definition: modelSpec.h:684
static EGPReference createEGPRef(const NeuronGroup *ng, const std::string &egpName)
Definition: models.cc:184
A variable has a name, a type and an access type.
Definition: models.h:58
Definition: synapseGroup.h:24
Models::VarReference createVarRef(const NeuronGroup *ng, const std::string &varName)
Creates a reference to a neuron group variable.
Definition: modelSpec.h:132
void setName(const std::string &name)
Method to set the neuronal network model name.
Definition: modelSpec.h:241
InitSparseConnectivitySnippet::Init initConnectivity(const typename S::ParamValues ¶ms)
Initialise connectivity using a sparse connectivity snippet.
Definition: modelSpec.h:89
void setMergePostsynapticModels(bool merge)
Should compatible postsynaptic models and dendritic delay buffers be fused?
Definition: modelSpec.h:275
NeuronGroup * addNeuronPopulation(const std::string &name, unsigned int size, const NeuronModel *model, const typename NeuronModel::ParamValues ¶mValues, const typename NeuronModel::VarValues &varInitialisers)
Adds a new neuron group to the model using a neuron model managed by the user.
Definition: modelSpec.h:324
const std::map< std::string, NeuronGroupInternal > & getNeuronGroups() const
Get std::map containing local named NeuronGroup objects in model.
Definition: modelSpec.h:821
SynapseGroup * 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())
Adds a synapse population to the model using singleton weight update and postsynaptic models created ...
Definition: modelSpec.h:511
void setDefaultVarLocation(VarLocation loc)
What is the default location for model state variables?
Definition: modelSpec.h:260
unsigned int getSeed() const
Get the random seed.
Definition: modelSpec.h:300
void setFusePostsynapticModels(bool fuse)
Should compatible postsynaptic models and dendritic delay buffers be fused?
Definition: modelSpec.h:279
Models::EGPReference createPSMEGPRef(const SynapseGroup *sg, const std::string &egpName)
Creates a reference to a postsynaptic model extra global parameter.
Definition: modelSpec.h:205
void setTiming(bool timingEnabled)
Set whether timers and timing commands are to be included.
Definition: modelSpec.h:253
void setDT(double dt)
Set the integration step size of the model.
Definition: modelSpec.h:250
std::map< std::string, CurrentSourceInternal >::value_type CurrentSourceValueType
Definition: modelSpec.h:227
Models::VarReference createPSMVarRef(const SynapseGroup *sg, const std::string &varName)
Creates a reference to a postsynaptic model variable.
Definition: modelSpec.h:150
InitToeplitzConnectivitySnippet::Init initToeplitzConnectivity(const typename S::ParamValues ¶ms)
Initialise toeplitz connectivity using a toeplitz connectivity snippet.
Definition: modelSpec.h:117
const std::map< std::string, CustomUpdateInternal > & getCustomUpdates() const
Get std::map containing named CustomUpdate objects in model.
Definition: modelSpec.h:830
SynapseMatrixType
Supported combinations of SynapticMatrixConnectivity and SynapticMatrixWeight.
Definition: synapseMatrixType.h:27
static VarReference createPSMVarRef(const SynapseGroup *sg, const std::string &varName)
Definition: models.cc:48
Models::VarInit initVar(const typename S::ParamValues ¶ms)
Initialise a variable using an initialisation snippet.
Definition: modelSpec.h:62
Time uses double precision - may reduce performance.
SynapseGroup * 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)
Adds a synapse population to the model using singleton weight update and postsynaptic models created ...
Definition: modelSpec.h:541
const std::map< std::string, CustomUpdateWUInternal > & getCustomWUUpdates() const
Definition: modelSpec.h:831
void setFusePrePostWeightUpdateModels(bool fuse)
Should compatible pre and postsynaptic weight update model variables and updates be fused...
Definition: modelSpec.h:283
static EGPReference createPSMEGPRef(const SynapseGroup *sg, const std::string &egpName)
Definition: models.cc:208
FloatType
Floating point precision to use for models.
Definition: modelSpec.h:42
std::map< std::string, SynapseGroupInternal >::value_type SynapseGroupValueType
Definition: modelSpec.h:226
void setTimePrecision(TimePrecision timePrecision)
Set numerical precision for time.
Definition: modelSpec.h:247
std::map< std::string, NeuronGroupInternal >::value_type NeuronGroupValueType
Definition: modelSpec.h:225
const std::map< std::string, CurrentSourceInternal > & getLocalCurrentSources() const
Get std::map containing local named CurrentSource objects in model.
Definition: modelSpec.h:827
void setDefaultExtraGlobalParamLocation(VarLocation loc)
What is the default location for model extra global parameters?
Definition: modelSpec.h:264
Definition: modelSpec.h:46
SynapseGroup * 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())
Adds a synapse population to the model using weight update and postsynaptic models managed by the use...
Definition: modelSpec.h:384
SynapseGroup * 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)
Adds a synapse population to the model using shared per-synapse variables and a singleton postsynapti...
Definition: modelSpec.h:632
const std::string & getPrecision() const
Gets the floating point numerical precision.
Definition: modelSpec.h:291
Models::VarReference createWUPostVarRef(const SynapseGroup *sg, const std::string &varName)
Creates a reference to a weight update model postsynapticvariable.
Definition: modelSpec.h:162
NeuronGroup * findNeuronGroup(const std::string &name)
Find a neuron group by name.
Definition: modelSpec.h:313
SynapseGroup * 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())
Adds a synapse population to the model using singleton weight update and postsynaptic models created ...
Definition: modelSpec.h:446
CustomUpdate * addCustomUpdate(const std::string &name, const std::string &updateGroupName, const typename CustomUpdateModel::ParamValues ¶mValues, const typename CustomUpdateModel::VarValues &varInitialisers, const typename CustomUpdateModel::VarReferences &varReferences, const typename CustomUpdateModel::EGPReferences &egpReferences={})
Definition: modelSpec.h:766
void setDefaultNarrowSparseIndEnabled(bool enabled)
Sets default for whether narrow i.e. less than 32-bit types are used for sparse matrix indices...
Definition: modelSpec.h:271
InitSparseConnectivitySnippet::Init uninitialisedConnectivity()
Mark a synapse group's sparse connectivity as uninitialised.
Definition: modelSpec.h:107
Definition: currentSource.h:20
SynapseGroup * 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)
Adds a synapse population to the model using singleton weight update and postsynaptic models created ...
Definition: modelSpec.h:477