8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
14 #include "IPhysicsMovableItem.h"
15 #include "IPhysicsBody.h"
17 #include "MovableItem.h"
81 {
Std_TraceMsg(0,
"Caught Error in desctructor of MuscleBase\r\n",
"", -1,
false,
true);}
106 THROW_PARAM_ERROR(Al_Err_lForceLessThanZero, Al_Err_strForceLessThanZero,
"MuscleID",
m_strName);
206 void MuscleBase::StimTension(std::string strXml)
224 void MuscleBase::LengthTension(std::string strXml)
251 #pragma region DataAccesMethods
257 LineBase::SetSystemPointers(lpSim, lpStructure, lpModule, lpNode, bVerify);
267 float *MuscleBase::GetDataPointer(
const std::string &strDataType)
271 float *lpData = NULL;
273 if(strType ==
"TENSION")
275 else if(strType ==
"TDOT")
277 else if(strType ==
"MEMBRANEVOLTAGE")
280 lpData = LineBase::GetDataPointer(strDataType);
285 bool MuscleBase::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
287 if(LineBase::SetData(strDataType, strValue,
false))
290 if(strDataType ==
"MAXTENSION")
296 if(strDataType ==
"STIMULUSTENSION")
298 StimTension(strValue);
302 if(strDataType ==
"LENGTHTENSION")
304 LengthTension(strValue);
310 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
315 void MuscleBase::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
317 LineBase::QueryProperties(aryProperties);
319 aryProperties.Add(
new TypeProperty(
"Tension", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
320 aryProperties.Add(
new TypeProperty(
"Tdot", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
321 aryProperties.Add(
new TypeProperty(
"MembraneVoltage", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
323 aryProperties.Add(
new TypeProperty(
"MaxTension", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
324 aryProperties.Add(
new TypeProperty(
"StimTension", AnimatPropertyType::Xml, AnimatPropertyDirection::Set));
325 aryProperties.Add(
new TypeProperty(
"LengthTension", AnimatPropertyType::Xml, AnimatPropertyDirection::Set));
330 void MuscleBase::Load(
CStdXml &oXml)
333 THROW_ERROR(Al_Err_lParentNotDefined, Al_Err_strParentNotDefined);
335 LineBase::Load(oXml);
virtual void Deserialize(std::string &strXml)
Deserializes a string into an xml document.
virtual ~MuscleBase()
Destructor.
float Tdot()
Gets the derivative of the tension.
Declares the external stimulus base class.
Base class file for all Animat simulation objects.
virtual void ResetSimulation()
Resets the simulation back to time 0.
Declares the simulation recorder class.
virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
Sets the system pointers.
Simulates the entire environment.
virtual bool FindChildElement(std::string strElementName, bool fThrowError=true)
Finds a child element by name.
Root namespace for the base simulation library for AnimatLab.
Length-Tension muscle gain.
Declares the sigmoid gain class.
Declares the body part class.
virtual void AddExternalNodeInput(int iTargetDataType, float fltInput)
Adds an external node input.
virtual void ResetSimulation()
Resets the simulation back to time 0.
virtual bool FindElement(std::string strElementName, bool fThrowError=true)
Finds an element with the specified name.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
Class that stores information about types for QueryProperty information.
Declares the key frame class.
Declares the muscle base class.
Declares the joint class.
Declares the organism class.
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
virtual bool Enabled()
Tells whether this node is enabled.
SigmoidGain m_gainStimTension
The stimulus-tension gain.
Declares the activated item class.
float Vm()
Gets the total stimulation applied to the muscle.
float Tension()
Gets the tension of the muscle.
Declares a light manager object.
Declares the bounding box class.
Declares the gain base class.
A standard xml manipulation class.
A "static" structure in the simulation.
float m_fltPrevTension
Tension of the muscle in the last time slice.
float m_fltMaxTension
The maximum tension that this muscle can ever generate. This is an upper limit to prevent unrealistic...
Declares the line base class.
MuscleBase()
Default constructor.
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.
virtual void VerifySystemPointers()
Verify that system pointers have been set correctly.
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
Base class for body parts and neural network nodes.
float m_fltTension
Tension of the muscle.
Declares an inverted quadratic gain class used to calculate length-tension relationship for muscle...
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
Declares the sensor class.
virtual bool Enabled()
Gets whether the muscle is enabled.
Declares the data chart manager class.
Declares the rigid body class.
virtual void VerifySystemPointers()
Verify that system pointers have been set correctly.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
float MaxTension()
Gets the maximum tension.
LengthTensionGain m_gainLengthTension
The length-tension gain.
Declares the structure class.
Declares the odor type class.
virtual void VerifySystemPointers()
Verify that system pointers have been set correctly.
Declares the simulator class.
Declares the activated item manager class.
Declares the external stimuli manager class.
float m_fltTdot
The derivative of tension at the current time step.
Declares the attachment class.
Declares the receptive field class.
std::string m_strName
The name for this object.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.
float PrevTension()
Gets the previous tension.