8 #include "IonChannel.h"
17 #include "ClassFactory.h"
77 {
Std_TraceMsg(0,
"Caught Error in desctructor of IonChannel\r\n",
"", -1,
false,
true);}
81 #pragma region Accessor-Mutators
343 oXml.Deserialize(strXml);
344 oXml.FindElement(
"Root");
345 oXml.FindChildElement(
"Gain");
389 oXml.Deserialize(strXml);
390 oXml.FindElement(
"Root");
391 oXml.FindChildElement(
"Gain");
435 oXml.Deserialize(strXml);
436 oXml.FindElement(
"Root");
437 oXml.FindChildElement(
"Gain");
481 oXml.Deserialize(strXml);
482 oXml.FindElement(
"Root");
483 oXml.FindChildElement(
"Gain");
542 #pragma region DataAccesMethods
569 if(strType ==
"MINF")
572 if(strType ==
"HINF")
576 THROW_PARAM_ERROR(Rn_Err_lInvalidNeuronDataType, Rn_Err_strInvalidNeuronDataType,
"Ion Channel Data Type", strDataType);
585 if(AnimatBase::SetData(strDataType, strValue,
false))
588 if(strType ==
"ENABLED")
594 if(strType ==
"GMAX")
596 Gmax(atof(strValue.c_str()));
600 if(strType ==
"GINIT")
602 Ginit(atof(strValue.c_str()));
606 if(strType ==
"MINIT")
608 Minit(atof(strValue.c_str()));
612 if(strType ==
"HINIT")
614 Hinit(atof(strValue.c_str()));
618 if(strType ==
"MPOWER")
620 MPower(atof(strValue.c_str()));
624 if(strType ==
"HPOWER")
626 HPower(atof(strValue.c_str()));
630 if(strType ==
"EQUILIBRIUMPOTENTIAL")
638 Nm(atof(strValue.c_str()));
644 Nh(atof(strValue.c_str()));
648 if(strType ==
"MINF")
660 if(strType ==
"HINF")
674 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
679 void IonChannel::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
681 AnimatBase::QueryProperties(aryProperties);
683 aryProperties.Add(
new TypeProperty(
"G", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
684 aryProperties.Add(
new TypeProperty(
"M", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
685 aryProperties.Add(
new TypeProperty(
"H", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
686 aryProperties.Add(
new TypeProperty(
"I", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
687 aryProperties.Add(
new TypeProperty(
"Act", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
688 aryProperties.Add(
new TypeProperty(
"Tm", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
689 aryProperties.Add(
new TypeProperty(
"Th", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
690 aryProperties.Add(
new TypeProperty(
"Tinf", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
691 aryProperties.Add(
new TypeProperty(
"Hinf", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
693 aryProperties.Add(
new TypeProperty(
"Enabled", AnimatPropertyType::Boolean, AnimatPropertyDirection::Both));
694 aryProperties.Add(
new TypeProperty(
"Gmax", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
695 aryProperties.Add(
new TypeProperty(
"Ginit", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
696 aryProperties.Add(
new TypeProperty(
"Minit", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
697 aryProperties.Add(
new TypeProperty(
"Hinit", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
698 aryProperties.Add(
new TypeProperty(
"MPower", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
699 aryProperties.Add(
new TypeProperty(
"HPower", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
700 aryProperties.Add(
new TypeProperty(
"EquilibriumPotential", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
701 aryProperties.Add(
new TypeProperty(
"Nm", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
702 aryProperties.Add(
new TypeProperty(
"Nh", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
703 aryProperties.Add(
new TypeProperty(
"Minf", AnimatPropertyType::Xml, AnimatPropertyDirection::Set));
704 aryProperties.Add(
new TypeProperty(
"Tm", AnimatPropertyType::Xml, AnimatPropertyDirection::Set));
705 aryProperties.Add(
new TypeProperty(
"Hinf", AnimatPropertyType::Xml, AnimatPropertyDirection::Set));
706 aryProperties.Add(
new TypeProperty(
"Th", AnimatPropertyType::Xml, AnimatPropertyDirection::Set));
712 void IonChannel::Load(CStdXml &oXml)
714 AnimatBase::Load(oXml);
720 Gmax(oXml.GetChildFloat(
"Gmax"));
721 MPower(oXml.GetChildFloat(
"MPower"));
722 HPower(oXml.GetChildFloat(
"HPower"));
725 Minit(oXml.GetChildFloat(
"Minit"));
726 Nm(oXml.GetChildFloat(
"Nm"));
729 oXml.IntoChildElement(
"Minf");
730 std::string strModuleName = oXml.GetChildString(
"ModuleName",
"");
731 std::string strType = oXml.GetChildString(
"Type");
736 THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType,
"Gain");
742 oXml.IntoChildElement(
"Tm");
743 strModuleName = oXml.GetChildString(
"ModuleName",
"");
744 strType = oXml.GetChildString(
"Type");
749 THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType,
"Gain");
754 Hinit(oXml.GetChildFloat(
"Hinit"));
755 Nh(oXml.GetChildFloat(
"Nh"));
758 oXml.IntoChildElement(
"Hinf");
759 strModuleName = oXml.GetChildString(
"ModuleName",
"");
760 strType = oXml.GetChildString(
"Type");
765 THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType,
"Gain");
771 oXml.IntoChildElement(
"Th");
772 strModuleName = oXml.GetChildString(
"ModuleName",
"");
773 strType = oXml.GetChildString(
"Type");
778 THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType,
"Gain");
float m_fltGmax
The maximum conductance.
float m_fltGInit
The initial conductance.
float Ginit()
Sets initial conductance.
float m_fltM
The current activation level.
Declares the integrate fire module class.
virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
Sets the system pointers.
float m_fltH
The current inactivation level.
AnimatSim::Behavior::NeuralModule * m_lpModule
The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NU...
virtual bool Enabled()
Gets whether this channel is enabled.
AnimatSim::Gains::Gain * Hinf()
Gets the Hinf.
AnimatSim::Gains::Gain * m_lpTm
The Tm gain function.
Declares the connexion class.
Simulator * m_lpSim
The pointer to a Simulation.
AnimatSim::Gains::Gain * Minf()
Gets the minf.
float m_fltEquilibriumPotential
The equilibrium potential.
virtual void ResetSimulation()
Resets the simulation back to time 0.
AnimatSim::Gains::Gain * Th()
Gets the Th.
float m_fltMPower
The activation exponent in the equation.
AnimatSim::Gains::Gain * m_lpHinf
The Hinf gain function.
Declares the spiking chemical synapse class.
AnimatSim::Environment::Structure * m_lpStructure
The pointer to this items parent Structure. If this is not relevant for this object then this is NULL...
IonChannel()
Default constructor.
AnimatSim::Gains::Gain * m_lpTh
The Th gain function.
virtual CStdSerialize * CreateObject(std::string strModule, std::string strClassName, std::string strType, bool bThrowError=true)
Creates an object using a class factory.
Declares the ca activation class.
float HPower()
Gets HPower.
float MPower()
Gets MPower.
float m_fltTm
The Tm value.
float m_fltMinf
The Minf value.
virtual ~IonChannel()
Destructor.
float m_fltHPower
The inactivation exponent in the equation.
bool Std_ToBool(int iVal)
Converts a value toa bool.
float m_fltMInit
The initial activation.
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.
AnimatSim::Gains::Gain * Tm()
Gets the Tm.
Declares the synapse type class.
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
float Gmax()
Gets maximum conductance.
Declares the electrical synapse class.
AnimatSim::Gains::Gain * m_lpMinf
The Minf gain function.
float m_fltHinf
The Hinf value.
virtual float CalculateGain(float fltInput)=0
Calculates the gain.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
float m_fltHInit
The initial inactivation.
float m_fltG
The active conductance.
virtual float CalculateCurrent(float fltStep, float fltVm)
Calculates the current.
float EquilibriumPotential()
Gets the equilibrium potential.
float m_fltTh
The Th value.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
float m_fltTotalAct
The total activation level.
Contains all of the classes to implement a basic integrate and fire neural model. ...
Gain * LoadGain(Simulator *lpSim, std::string strName, CStdXml &oXml)
Loads a gain object.
Declares the non spiking chemical synapse class.
Declares the neuron class.