11 #include "CsNeuralModule.h"
52 {
Std_TraceMsg(0,
"Caught Error in desctructor of CsSynapseGroup\r\n",
"", -1,
false,
true);}
55 void CsSynapseGroup::InitWt(
float fltVal)
61 float CsSynapseGroup::InitWt() {
return m_fltInitWt;}
63 void CsSynapseGroup::MaxWt(
float fltVal)
69 float CsSynapseGroup::MaxWt() {
return m_fltMaxWt;}
71 void CsSynapseGroup::Pconnect(
float fltVal)
80 void CsSynapseGroup::MinDelay(
unsigned char iVal)
86 unsigned char CsSynapseGroup::MinDelay() {
return m_iMinDelay;}
88 void CsSynapseGroup::MaxDelay(
unsigned char iVal)
94 unsigned char CsSynapseGroup::MaxDelay() {
return m_iMaxDelay;}
96 void CsSynapseGroup::Plastic(
bool bVal)
101 bool CsSynapseGroup::Plastic() {
return m_bPlastic;}
105 std::string CsSynapseGroup::GeneratorKey()
117 void CsSynapseGroup::SetCARLSimulation()
127 THROW_PARAM_ERROR(Al_Err_lNodeNotFound, Al_Err_strNodeNotFound,
"ID: ",
m_strFromID);
131 THROW_PARAM_ERROR(Al_Err_lNodeNotFound, Al_Err_strNodeNotFound,
"ID: ",
m_strToID);
134 void CsSynapseGroup::SetSystemPointers(Simulator *m_lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode,
bool bVerify)
136 Link::SetSystemPointers(m_lpSim, lpStructure, lpModule, lpNode,
false);
145 AnimatBase::VerifySystemPointers();
148 THROW_PARAM_ERROR(Al_Err_lStructureNotDefined, Al_Err_strStructureNotDefined,
"Link: ",
m_strID);
151 THROW_PARAM_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType,
"Link: ",
m_strID);
154 THROW_PARAM_ERROR(Al_Err_lNeuralModuleNotDefined, Al_Err_strNeuralModuleNotDefined,
"Link: ",
m_strID);
157 THROW_PARAM_ERROR(Al_Err_lUnableToCastNeuralModuleToDesiredType, Al_Err_strUnableToCastNeuralModuleToDesiredType,
"ID: ",
m_lpCsModule->
ID());
160 #pragma region DataAccesMethods
166 if(Link::SetData(strDataType, strValue,
false))
169 if(strType ==
"INITWT")
171 InitWt(atof(strValue.c_str()));
175 if(strType ==
"MAXWT")
177 MaxWt(atof(strValue.c_str()));
181 if(strType ==
"PCONNECT")
183 Pconnect(atof(strValue.c_str()));
187 if(strType ==
"MINDELAY")
189 MinDelay((
unsigned char) atoi(strValue.c_str()));
193 if(strType ==
"MAXDELAY")
195 MaxDelay((
unsigned char) atoi(strValue.c_str()));
199 if(strType ==
"PLASTIC")
207 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
212 void CsSynapseGroup::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
214 Link::QueryProperties(aryProperties);
216 aryProperties.Add(
new TypeProperty(
"InitWt", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
217 aryProperties.Add(
new TypeProperty(
"MaxWt", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
218 aryProperties.Add(
new TypeProperty(
"Pconnect", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
219 aryProperties.Add(
new TypeProperty(
"MinDelay", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
220 aryProperties.Add(
new TypeProperty(
"MaxDelay", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
221 aryProperties.Add(
new TypeProperty(
"Plastic", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
226 void CsSynapseGroup::Load(CStdXml &oXml)
228 AnimatBase::Load(oXml);
234 THROW_TEXT_ERROR(Std_Err_lBlankAttrib, Std_Err_strBlankAttrib,
"Attribute: FromID");
238 THROW_TEXT_ERROR(Std_Err_lBlankAttrib, Std_Err_strBlankAttrib,
"Attribute: ToID");
241 MaxWt(oXml.GetChildFloat(
"MaxWt",
m_fltMaxWt));
243 MinDelay(oXml.GetChildInt(
"MinDelay",
m_iMinDelay));
244 MaxDelay(oXml.GetChildInt(
"MaxDelay",
m_iMaxDelay));
245 Plastic(oXml.GetChildBool(
"Plastic",
m_bPlastic));
Contains the classes for a firing rate neural model.
bool m_bPlastic
connection type, either SYN_FIXED or SYN_PLASTIC
float m_fltInitWt
initial weight strength (arbitrary units); should be negative for inhibitory connections ...
AnimatSim::Behavior::NeuralModule * m_lpModule
The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NU...
virtual void VerifySystemPointers()
Verify that system pointers have been set correctly.
Declares the CsNeuronGroup class.
CsNeuronGroup * m_lpFromNeuron
The pointer to pre-synaptic neuron.
unsigned char m_iMinDelay
the minimum delay allowed (ms)
Simulator * m_lpSim
The pointer to a Simulation.
virtual std::string ID()
Gets the unique GUID ID of this object.
std::string m_strToID
GUID ID of the pre-synaptic neruon.
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
AnimatSim::Environment::Structure * m_lpStructure
The pointer to this items parent Structure. If this is not relevant for this object then this is NULL...
std::string m_strID
The unique Id for this object.
std::string m_strFromID
GUID ID of the pre-synaptic neruon.
int m_iSynapsesCreated
The total number of synapses created.
Firing rate neural module.
virtual void Initialize()
Initializes this object.
Declares the synapse class.
Firing Rate Neuron model.
virtual AnimatBase * FindByID(std::string strID, bool bThrowError=true)
Searches for the object with the specified ID.
bool Std_ToBool(int iVal)
Converts a value toa bool.
bool Std_IsBelowMax(int iMaxVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is below a maximum value.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
CsNeuronGroup * m_lpToNeuron
The pointer to post-synaptic neuron.
float m_fltMaxWt
upper bound on weight strength (arbitrary units); should be negative for inhibitory connections ...
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
virtual ~CsSynapseGroup()
Destructor.
bool Std_IsBlank(std::string strVal)
Trims a string and tests if a string is blank.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
unsigned char m_iMaxDelay
the maximum delay allowed (ms)
CsNeuralModule * m_lpCsModule
Pointer to parent CsNeuralModule.
CsSynapseGroup()
Default constructor.
Organism * m_lpOrganism
The pointer to this link's organism.
float m_fltPconnect
connection probability