AnimatLab  2
Test
NonSpikingChemicalSynapse.cpp
Go to the documentation of this file.
1 
7 #include "stdafx.h"
8 #include "SynapseType.h"
10 
11 namespace IntegrateFireSim
12 {
13  namespace Synapses
14  {
15 
23 {
24  m_dEquil = 0;
25  m_dSynAmp = 0;
26  m_dThreshV = 0;
27  m_dSaturateV = 0;
28 }
29 
37 {
38 
39 }
40 
41 #pragma region Accessor-Mutators
42 
52 
62 
72 
82 
92 
102 
112 
122 
123 #pragma endregion
124 
125 #pragma region DataAccesMethods
126 
127 bool NonSpikingChemicalSynapse::SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError)
128 {
129  std::string strType = Std_CheckString(strDataType);
130 
131  if(AnimatBase::SetData(strDataType, strValue, false))
132  return true;
133 
134  if(strType == "EQUILIBRIUMPOTENTIAL")
135  {
136  EquilibriumPotential(atof(strValue.c_str()));
137  return true;
138  }
139 
140  if(strType == "MAXSYNAPTICCONDUCTANCE")
141  {
142  MaxSynapticConductance(atof(strValue.c_str()));
143  return true;
144  }
145 
146  if(strType == "PRESYNAPTICTHRESHOLD")
147  {
148  PreSynapticThreshold(atof(strValue.c_str()));
149  return true;
150  }
151 
152  if(strType == "PRESYNAPTICSATURATIONLEVEL")
153  {
154  PreSynapticSaturationLevel(atof(strValue.c_str()));
155  return true;
156  }
157 
158  //If it was not one of those above then we have a problem.
159  if(bThrowError)
160  THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType, "Data Type", strDataType);
161 
162  return false;
163 }
164 
165 void NonSpikingChemicalSynapse::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
166 {
167  AnimatBase::QueryProperties(aryProperties);
168 
169  aryProperties.Add(new TypeProperty("EquilibriumPotential", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
170  aryProperties.Add(new TypeProperty("MaxSynapticConductance", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
171  aryProperties.Add(new TypeProperty("PreSynapticThreshold", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
172  aryProperties.Add(new TypeProperty("PreSynapticSaturationLevel", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
173 }
174 
175 #pragma endregion
176 
177 void NonSpikingChemicalSynapse::Load(CStdXml &oXml)
178 {
179  AnimatBase::Load(oXml);
180 
181  oXml.IntoElem(); //Into SpikingChemSyn Element
182 
183  EquilibriumPotential(oXml.GetChildDouble("Equil"));
184  MaxSynapticConductance(oXml.GetChildDouble("SynAmp"));
185  PreSynapticThreshold(oXml.GetChildDouble("ThreshV"));
186  PreSynapticSaturationLevel(oXml.GetChildDouble("SaturateV"));
187 
188  oXml.OutOfElem(); //OutOf Neuron Element
189 }
190 
191  } //Synapses
192 } //IntegrateFireSim
double PreSynapticSaturationLevel()
Gets the pre-synaptic saturation level.
double MaxSynapticConductance()
Gets the maximum synaptic conductance.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
double EquilibriumPotential()
Gets the equilibrium potential.
double PreSynapticThreshold()
Gets the pre-synaptic threshold.
Synapse type base class.
Definition: SynapseType.h:22
Declares the synapse type class.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Contains all of the classes to implement a basic integrate and fire neural model. ...
Declares the non spiking chemical synapse class.