8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
15 #include "IPhysicsMovableItem.h"
16 #include "IPhysicsBody.h"
18 #include "MovableItem.h"
81 {
Std_TraceMsg(0,
"Caught Error in desctructor of Organism\r\n",
"", -1,
false,
true);}
163 void Organism::MinTimeStep(
float &fltMin)
168 #pragma region DataAccesMethods
170 bool Organism::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
185 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
226 THROW_PARAM_ERROR(Al_Err_lRobotInterfaceIDNotFound, Al_Err_strRobotInterfaceIDNotFound,
"ID", strID);
232 bool Organism::AddItem(
const std::string &strItemType,
const std::string &strXml,
bool bThrowError,
bool bDoNotInit)
239 if(strType ==
"NEURALMODULE")
253 if(strType ==
"ROBOTINTERFACE")
261 THROW_PARAM_ERROR(Al_Err_lInvalidItemType, Al_Err_strInvalidItemType,
"Item Type", strItemType);
273 if(strType ==
"NEURALMODULE")
287 if(strType ==
"ROBOTINTERFACE")
295 THROW_PARAM_ERROR(Al_Err_lInvalidItemType, Al_Err_strInvalidItemType,
"Item Type", strItemType);
351 std::string strModuleName = oXml.
GetChildString(
"ModuleName",
"");
357 THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType,
"RobotInterface");
359 lpInterface->Load(oXml);
374 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
379 void Organism::Load(
CStdXml &oXml)
381 Structure::Load(oXml);
NervousSystem * m_lpNervousSystem
The pointer to the nervous system.
virtual void Deserialize(std::string &strXml)
Deserializes a string into an xml document.
Base class file for all Animat simulation objects.
Nervous system for an organism.
Declares the nervous system class.
Declares the simulation recorder class.
virtual bool AddItem(const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false)
Adds a new object to this parent.
virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
Sets the system pointers.
virtual bool FindChildElement(std::string strElementName, bool fThrowError=true)
Finds a child element by name.
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 StepNeuralEngine()
Step neural engine.
virtual void ResetSimulation()
Resets the simulation back to time 0.
virtual void SaveKeyFrameSnapshot(byte *aryBytes, long &lIndex)
Saves a key frame snapshot.
Declares the body part class.
virtual RobotInterface * LoadRobotInterface(CStdXml &oXml)
Loads a robot interface Control.
virtual bool FindElement(std::string strElementName, bool fThrowError=true)
Finds an element with the specified name.
Simulator * m_lpSim
The pointer to a Simulation.
Information about the standard error.
virtual std::string ID()
Gets the unique GUID ID of this object.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
virtual void Initialize()
Initializes this object.
virtual void RemoveNeuralModule(std::string strID)
Removes the neural module based on its ID.
Declares the link base class.
Declares the key frame class.
virtual void Initialize()
Initializes this object.
virtual RobotInterface * AddRobotInterface(std::string strXml)
Creates and adds a robot interface control.
RigidBody * m_lpBody
The root rigid body object of this structure.
Declares the joint class.
Declares the organism class.
virtual void SaveKeyFrameSnapshot(byte *aryBytes, long &lIndex)
Saves a key frame snapshot.
virtual bool RemoveItem(const std::string &strItemType, const std::string &strID, bool bThrowError=true)
Removes a child item from this parent.
virtual void Enabled(bool bVal)
Tells whether this item is enabled or not. This is not actually used for all objects, only specific ones. I am putting it in the base class though to prevent numerous duplications.
RobotInterface * m_lpRobot
Pointer to a robot interface node to allow the organism to be hooked to a robot.
Declares the activated item class.
virtual CStdSerialize * CreateObject(std::string strModule, std::string strClassName, std::string strType, bool bThrowError=true)
Creates an object using a class factory.
virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
Sets the system pointers.
Declares a light manager object.
void AddNeuralModule(NeuralModule *lpModule)
Adds a neural module to the nervous system.
Declares the bounding box class.
virtual void StepSimulation()
Step the simulation for this object.
Declares the gain base class.
virtual void ResetSimulation()
Resets the simulation back to time 0.
virtual bool AddItem(const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false)
Adds a new object to this parent.
A standard xml manipulation class.
virtual long CalculateSnapshotByteSize()
Calculates the snapshot byte size.
virtual void StepPhysicsEngine()
Allows the organism and its parts to update at each time slice.
virtual std::string GetChildString(std::string strElementName)
Gets a string value from the element with the specified name.
virtual void LoadKeyFrameSnapshot(byte *aryBytes, long &lIndex)
Loads a key frame snapshot.
bool m_bDead
Tells if the organism is dead or not.
virtual void StepPhysicsEngine()
Allows the organism and its parts to update at each time slice.
virtual long CalculateSnapshotByteSize()
Calculates the snapshot byte size.
virtual void Kill(bool bState=true)
Kills.
virtual void ResetSimulation()
Resets the simulation back to time 0.
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 LoadKeyFrameSnapshot(byte *aryBytes, long &lIndex)
Loads a key frame snapshot.
virtual void Kill(bool bState=true)
Kills.
ScriptProcessor * m_lpScript
Script processor for running python or other scripting systems related to this structure.
virtual ~Organism()
Destructor.
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 bool OutOfElem()
Goes out of the element where the cursor is located.
virtual void Initialize()
Initializes this object.
virtual bool IsDead()
Query if this object is dead.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
Declares the sensor class.
virtual void ResetSimulation()
Resets the simulation back to time 0.
Declares the data chart manager class.
virtual void Initialize()
Initializes this object.
Declares the rigid body class.
virtual bool IntoChildElement(std::string strElementName, bool bThrowError=true)
Goes into the child element with the specified name.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Declares the structure class.
virtual void RemoveRobotInterface(std::string strID, bool bThrowError=true)
Removes the robot interface with the specified ID.
Declares the odor type class.
virtual void Kill(bool bState=true)
Kills.
Declares the simulator class.
Declares the neural module class.
Declares the activated item manager class.
Declares the external stimuli manager class.
Declares the attachment class.
virtual bool RemoveItem(const std::string &strItemType, const std::string &strID, bool bThrowError=true)
Removes a child item from this parent.
Declares the receptive field class.
virtual void Kill(bool bState=true)
Kills.
virtual void StepSimulation()
Step the simulation for this object.
The Robotics interface configures a simulation to run on a microcontroller board. ...