8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
46 {
Std_TraceMsg(0,
"Caught Error in desctructor of BellGain\r\n",
"", -1,
false,
true);}
131 Gain::Copy(lpSource);
156 fltVal = pow((
float) (fltInput-
m_fltA), (
float) 2.0);
157 fltVal = exp(-
m_fltC * fltVal);
167 bool BellGain::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
172 if(strDataType ==
"A")
174 A((
float) atof(strValue.c_str()));
178 if(strDataType ==
"B")
180 B((
float) atof(strValue.c_str()));
184 if(strDataType ==
"C")
186 C((
float) atof(strValue.c_str()));
190 if(strDataType ==
"D")
192 D((
float) atof(strValue.c_str()));
198 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
207 aryProperties.Add(
new TypeProperty(
"A", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
208 aryProperties.Add(
new TypeProperty(
"B", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
209 aryProperties.Add(
new TypeProperty(
"C", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
210 aryProperties.Add(
new TypeProperty(
"D", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
213 void BellGain::Load(CStdXml &oXml)
219 A(oXml.GetChildFloat(
"A"));
220 B(oXml.GetChildFloat(
"B"));
221 C(oXml.GetChildFloat(
"C"));
222 D(oXml.GetChildFloat(
"D"));
Base class file for all Animat simulation objects.
virtual float CalculateGain(float fltInput)
Calculates the gain.
Root namespace for the base simulation library for AnimatLab.
Declares the bell gain class.
float B()
Gets B parameter of bell eqation: Out = B*e^(-C*(In-A)^2)+D.
float m_fltB
The B parameter of the gain.
float m_fltA
The A parameter of the gain.
Class that stores information about types for QueryProperty information.
float A()
Gets A parameter of bell eqation: Out = B*e^(-C*(In-A)^2)+D.
bool InLimits(float fltInput)
Tells whether the input value is within the defined limit ranges.
virtual ~BellGain()
Destructor.
float D()
Sets D parameter of bell eqation: Out = B*e^(-C*(In-A)^2)+D.
Declares the gain base class.
float m_fltD
The D parameter of the gain.
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.
float m_fltC
The C parameter of the gain.
float C()
Gets C parameter of bell eqation: Out = B*e^(-C*(In-A)^2)+D.
float CalculateLimitOutput(float fltInput)
Calculates the output when the input is outside of the limit ranges.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
BellGain()
Default constructor.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
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 void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.