AnimatLab  2
Test
AnimatSim::Simulator Class Referenceabstract

Simulates the entire environment. More...

#include <Simulator.h>

+ Inheritance diagram for AnimatSim::Simulator:
+ Collaboration diagram for AnimatSim::Simulator:

Public Member Functions

 Simulator ()
 Default constructor. More...
 
virtual ~Simulator ()
 Destructor. More...
 
virtual bool AddBodiesMode ()
 Gets the Adds bodies mode. More...
 
virtual void AddBodiesMode (bool bVal)
 Sets the AddBodies mode. More...
 
virtual void AddFoodSource (RigidBody *lpFood)
 
virtual bool AddItem (const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false)
 Adds a new object to this parent. More...
 
virtual std::string AddKeyFrame (std::string strType, long lStart, long lEnd)
 Adds a key frame. More...
 
virtual void AddNeuralModuleFactory (std::string strModuleName, NeuralModule *lpModule)
 
virtual void AddToExtractExtraData (BodyPart *lpPart)
 
virtual void AddToObjectList (AnimatBase *lpItem)
 Adds an object to the list of all simulation objects. More...
 
virtual float AlphaThreshold ()
 
virtual void AlphaThreshold (float fltValue)
 
virtual float AngularCompliance ()
 Gets the angular compliance of the simulation. More...
 
virtual void AngularCompliance (float fltVal, bool bUseScaling=true)
 Sets the angular compliance of the simulation. More...
 
virtual float AngularDamping ()
 Gets the angular damping of the simulation. More...
 
virtual void AngularDamping (float fltVal, bool bUseScaling=true)
 Sets the angular damping of the simulation. More...
 
virtual float AngularKineticLoss ()
 Gets the angular kinetic loss of teh simulation. More...
 
virtual void AngularKineticLoss (float fltVal, bool bUseScaling=true)
 Sets the angular kinetic loss of the simulation. More...
 
virtual void AttachSourceAdapter (Structure *lpStructure, Adapter *lpAdapter)
 
virtual void AttachTargetAdapter (Structure *lpStructure, Adapter *lpAdapter)
 
virtual bool AutoGenerateRandomSeed ()
 Gets whether to automatically generate a random seed. More...
 
virtual void AutoGenerateRandomSeed (bool bVal)
 Sets whether to automatically generate random seed. More...
 
virtual CStdColorBackgroundColor ()
 Gets the background color. More...
 
virtual void BackgroundColor (CStdColor &aryColor)
 Sets the background color. More...
 
virtual void BackgroundColor (float *aryColor)
 Sets the background color. More...
 
virtual void BackgroundColor (std::string strXml)
 Loads the background color from an XML data packet. More...
 
virtual void BlockSimulation ()
 Blocks the simulation from stepping. More...
 
virtual void ConvertV1MeshFile (std::string strOriginalMeshFile, std::string strNewMeshFile, std::string strTexture)=0
 
virtual CStdSerializeCreateObject (std::string strModule, std::string strClassName, std::string strType, bool bThrowError=true)
 Creates an object using a class factory. More...
 
virtual float DenominatorDistanceUnits ()
 Gets the denominator distance units. More...
 
virtual int DesiredFrameRate ()
 Gets the frame rate used for the simulation windows in cylces per second. More...
 
virtual void DesiredFrameRate (int iVal)
 Sets the frame rate in cycles per second. More...
 
virtual float DesiredFrameStep ()
 Gets the frame step time. More...
 
virtual void DisableCollision (RigidBody *lpBody)
 Disables collision between the past-in body and all rigid bodies of the simulator. More...
 
virtual void DisableCollisions (Structure *lpStruct, CStdPtrArray< CollisionPair > &m_aryCollisionList)
 
virtual void DisableVideoPlayback ()
 Disables the video playback. More...
 
virtual float DisplayMassUnits ()
 Gets the density mass units. More...
 
virtual void DistanceUnits (std::string strUnits)
 Sets the distance units. More...
 
virtual float DistanceUnits ()
 Gets the distance units used in the simulation. More...
 
virtual void EnableCollision (RigidBody *lpBody)
 Enables collision between the past-in body and all rigid bodies of the simulator. More...
 
virtual void EnableCollisions (Structure *lpStruct, CStdPtrArray< CollisionPair > &m_aryCollisionList)
 
virtual bool EnableSimRecording ()
 Tells whehter simulation recording is enabled. More...
 
virtual void EnableSimRecording (bool bVal)
 Sets whether simulation recording is Enabled. More...
 
virtual void EnableVideoPlayback (std::string strKeyFrameID)
 Enables the video playback. More...
 
virtual float EndSimTime ()
 Gets the time at which to automatically end the simulation. More...
 
virtual void EndSimTime (float fltVal)
 Sets the time at which to automatically end the simulation. More...
 
virtual long EndSimTimeSlice ()
 Gets the time slice at which to automatically end the simulation. More...
 
virtual void EndSimTimeSlice (long lVal)
 Sets the time slice at which to automatically end the simulation. More...
 
virtual std::string ExecutablePath ()
 Gets the directory path to the executable. More...
 
virtual void ExecutablePath (std::string strPath)
 Sets the Executable path. More...
 
virtual AnimatBaseFindByID (std::string strID, bool bThrowError=true)
 Searches for the object with the specified ID. More...
 
virtual void FindClosestFoodSources (CStdFPoint &oMouthPos, float fltMinRadius, CStdArray< RigidBody * > &arySources, CStdArray< float > &aryDistances)
 
virtual JointFindJoint (std::string strStructureID, std::string strJointID, bool bThrowError=true)
 Finds a joint with the specified ID in the specified structure. More...
 
virtual IStdClassFactoryFindNeuralModuleFactory (std::string strModuleName, bool bThrowError=false)
 Searches for the first neural module factory with the matching name. More...
 
virtual OdorTypeFindOdorType (std::string strOdorID, bool bThrowError=true)
 Searches for the first odor type with the specified ID. More...
 
virtual OrganismFindOrganism (std::string strOrganismID, bool bThrowError=true)
 Searches for the first organism with the specified ID. More...
 
virtual RigidBodyFindRigidBody (std::string strStructureID, std::string strBodyID, bool bThrowError=true)
 Finds a rigid body with the specified ID in the specified structure. More...
 
virtual StructureFindStructure (std::string strStructureID, bool bThrowError=true)
 Searches for the first structure with the specified ID. More...
 
virtual StructureFindStructureFromAll (std::string strStructureID, bool bThrowError=true)
 Searches for the first structure with the specified ID. More...
 
virtual bool ForceFastMoving ()
 Gets whether we have set the simulation to force fast moving calculations. More...
 
virtual void ForceFastMoving (bool bVal)
 Set simulation to Force fast moving caculations. More...
 
virtual bool ForceNoWindows ()
 
virtual void ForceNoWindows (bool bVal)
 
virtual void GenerateCollisionMeshFile (std::string strOriginalMeshFile, std::string strCollisionMeshFile, float fltScaleX, float fltScaleY, float fltScaleZ)=0
 
virtual DataChartMgrGetDataChartMgr ()
 Gets the data chart manager. More...
 
virtual float * GetDataPointer (const std::string &strDataType)
 Returns a float pointer to a data item of interest in this object. More...
 
virtual ExternalStimuliMgrGetExternalStimuliMgr ()
 Gets the external stimuli manager. More...
 
virtual LightManagerGetLightMgr ()
 Gets the light manager. More...
 
virtual int GetMaterialID (std::string strID)
 Gets a material identifier from the physics engine for the specified unique ID. More...
 
virtual MaterialsGetMaterialMgr ()
 Gets the material manager. More...
 
virtual void GetPositionAndRotationFromD3DMatrix (float(&aryTransform)[4][4], CStdFPoint &vPos, CStdFPoint &vRot)=0
 
virtual SimulationRecorderGetSimulationRecorder ()
 Gets the simulation recorder. More...
 
virtual unsigned long long GetTimerTick ()=0
 
virtual SimulationWindowMgrGetWindowMgr ()
 Gets the window manager. More...
 
virtual float Gravity ()
 Gets the gravity value. More...
 
virtual void Gravity (float fltVal, bool bUseScaling=true)
 Sets the Gravity value. More...
 
virtual void IncrementPhysicsBodyCount ()
 
virtual bool InDrag ()
 
virtual void InDrag (bool bVal)
 
virtual void Initialize (int argc, const char **argv)=0
 Initializes this object. More...
 
virtual void Initialize ()
 Initializes this object with no argc/argv params. More...
 
virtual bool Initialized ()
 Tells if the simulation has been initialized or not. More...
 
virtual void Initialized (bool bVal)
 Sets whether the simulation has been Initialized. More...
 
virtual bool InSimulation ()
 Used to determine if we are running in a simulation, or in a real control mode. More...
 
virtual float InverseDistanceUnits ()
 Gets the inverse distance units. More...
 
virtual float InverseMassUnits ()
 Gets the inverse mass units. More...
 
virtual bool IsPhysicsAdapter (Adapter *lpAdapter)
 
virtual bool IsPhysicsBeingUpdated ()
 Query if this object is physics being updated on this time slice. More...
 
virtual bool IsResetting ()
 Returns true if the simulation is in the process of resetting. False otherwise. More...
 
virtual float LinearCompliance ()
 Gets the linear compliance of the simulation. More...
 
virtual void LinearCompliance (float fltVal, bool bUseScaling=true)
 Sets the linear compliance of the simulation. More...
 
virtual float LinearDamping ()
 Gets the linear damping of the simulation. More...
 
virtual void LinearDamping (float fltVal, bool bUseScaling=true)
 Sets the linear damping of the simulation. More...
 
virtual float LinearKineticLoss ()
 Gets the linear kinetic loss of the simulation. More...
 
virtual void LinearKineticLoss (float fltVal, bool bUseScaling=true)
 Sets the linear kinetic loss of the simulation. More...
 
virtual void Load (std::string strFileName="")
 Loads the simulation from an xml configuration file. More...
 
virtual void Load (CStdXml &oXml)
 Loads the item using an XML data packet. More...
 
virtual void LoadKeyFrameSnapshot (byte *aryBytes, long &lIndex)
 Loads a key frame snapshot. More...
 
virtual int ManualRandomSeed ()
 Gets the manual random seed value. More...
 
virtual void ManualRandomSeed (int iSeed)
 Sets the manual random seed value. More...
 
virtual bool ManualStepSimulation ()
 Gets whether the simulation is being stepped manually by the user. More...
 
virtual void ManualStepSimulation (bool bVal)
 Sets whether the simulation is being stepped manually by the user. More...
 
virtual void MassUnits (std::string strUnits)
 Sets the mass units. More...
 
virtual float MassUnits ()
 Gets the mass units. More...
 
virtual void MicroSleep (unsigned int iMicroTime)=0
 
virtual void MicroWait (unsigned int iMicroTime)
 
virtual long Millisecond ()
 Gets the current simulation time in millisecond. More...
 
virtual long MillisecondToSlice (long lMillisecond)
 Calculates the number of time slices from a supplied number of milliseconds. More...
 
virtual float MinTimeStep ()
 
virtual float MouseSpringDamping ()
 Gets the mouse spring damping. More...
 
virtual void MouseSpringDamping (float fltVal, bool bUseScaling=true)
 Sets the mouse spring damping. More...
 
virtual float MouseSpringDampingForceMagnitude ()
 Gets the magnitude of the mouse spring damping force applied at each time step. More...
 
virtual void MouseSpringDampingForceMagnitude (float fltVal, bool bUseScaling=true)
 Sets the mouse spring damping force that was used in the current timestep. This is for reporting purposes only. More...
 
virtual float MouseSpringForceMagnitude ()
 Gets the magnitude of the mouse spring force applied at each time step. More...
 
virtual void MouseSpringForceMagnitude (float fltVal, bool bUseScaling=true)
 Sets the mouse spring force that was used in the current timestep. This is for reporting purposes only. More...
 
virtual float MouseSpringLengthMagnitude ()
 Gets the magnitude of the mouse spring length at each time step. More...
 
virtual void MouseSpringLengthMagnitude (float fltVal, bool bUseScaling=true)
 Sets the mouse spring length that was used in the current timestep. This is for reporting purposes only. More...
 
virtual float MouseSpringStiffness ()
 Gets the mouse spring stiffness. More...
 
virtual void MouseSpringStiffness (float fltVal, bool bUseScaling=true)
 Sets the mouse spring stiffness. More...
 
virtual std::string MoveKeyFrame (std::string strID, long lStart, long lEnd)
 Move key frame. More...
 
virtual void MoveSimulationToKeyFrame (std::string strKeyFrameID)
 Move simulation to key frame. More...
 
virtual void NotifyRigidBodyAdded (std::string strID)
 
virtual void NotifyRigidBodyRemoved (std::string strID)
 
virtual CStdMap< std::string, AnimatBase * > * ObjectList ()
 Gets the list of pointers to all objects in the simulation. More...
 
virtual bool Paused ()
 Gets whether the Simulation is paused. More...
 
virtual void Paused (bool bVal)
 Sets the Paused flag. More...
 
virtual bool PauseSimulation ()=0
 Pauses the simulation. More...
 
virtual long PhysicsSliceCount ()
 Gets the physics time slice count. More...
 
virtual void PhysicsSliceCount (long lVal)
 Sets the physics time slice count. More...
 
virtual long PhysicsStepCount ()
 Gets the physics step count. More...
 
virtual short PhysicsStepInterval ()
 Gets the physics step interval. More...
 
virtual void PhysicsStepInterval (short iVal)
 Sets the physics step interval. More...
 
virtual void PhysicsSubsteps (int iVal)
 This is used only for the bullet physics engine. It allows the user to specify how many substeps should be made for the physics time step specified. This allows you to keep the overall physics time step you wanted but subdivide it more finely if that is required. However, The larger this number the slower your simulation will run. More...
 
virtual int PhysicsSubsteps ()
 Gets the physics substeps. More...
 
virtual float PhysicsSubstepTime ()
 Gets the physics substep time. More...
 
virtual void PhysicsTimeStep (float fltVal)
 Sets the integration time step for the physics engine. More...
 
virtual float PhysicsTimeStep ()
 Gets the integration time step for the physics engine. More...
 
virtual int PlaybackControlMode ()
 Gets the playback control mode. More...
 
virtual void PlaybackControlMode (int iMode)
 Sets the playback control mode. More...
 
virtual float PresetPlaybackTimeStep ()
 Gets the preset playback time step. More...
 
virtual void PresetPlaybackTimeStep (float fltTimeStep)
 Sets the preset playback time step in milliseconds. More...
 
virtual std::string ProjectPath ()
 Gets the project path. More...
 
virtual void ProjectPath (std::string strPath)
 Sets the project path. More...
 
virtual void QueryProperties (CStdPtrArray< TypeProperty > &aryProperties)
 Queries this object for a list of properties that can be changed using SetData. More...
 
virtual float RealTime ()
 Returns the real time since the simulation was started. More...
 
virtual float RecFieldSelRadius ()
 
virtual void RecFieldSelRadius (float fltValue, bool bUseScaling=true, bool bUpdateAllBodies=true)
 
virtual void RemoveFoodSource (RigidBody *lpFood)
 
virtual void RemoveFromExtractExtraData (BodyPart *lpPart)
 
virtual void RemoveFromObjectList (AnimatBase *lpItem)
 Removes an object from the list of all simulation objects. More...
 
virtual bool RemoveItem (const std::string &strItemType, const std::string &strID, bool bThrowError=true)
 Removes a child item from this parent. More...
 
virtual void RemoveKeyFrame (std::string strID)
 Removes the key frame described by strID. More...
 
virtual void RemoveSourceAdapter (Structure *lpStructure, Adapter *lpAdapter)
 
virtual void RemoveTargetAdapter (Structure *lpStructure, Adapter *lpAdapter)
 
virtual void Reset ()
 Resets all objects of the simulation to their unloaded state. More...
 
virtual void ResetSimulation ()
 Resets the the simulation to its orginal settings at time 0. More...
 
virtual bool RobotAdpaterSynch ()
 Gets whether we need to synch the physics adapters in a simulation to the robot physics time step. More...
 
virtual void RobotAdpaterSynch (bool bVal)
 Sets whether we need to synch the physics adapters in a simulation to the robot physics time step. More...
 
virtual void RunSimulation ()
 Runs the simulation. More...
 
virtual void Save (std::string strFilename)
 Saves the simulation file. More...
 
virtual void SaveKeyFrameSnapshot (byte *aryBytes, long &lIndex)
 Saves a key frame snapshot. More...
 
virtual void SaveVideo (std::string strPath)
 Saves a video. More...
 
virtual void Script (ScriptProcessor *lpScript)
 
virtual ScriptProcessorScript ()
 
virtual bool SetData (const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
 Set a variable based on a string data type name. More...
 
virtual bool SetEndSimTime ()
 Gets whether to use the set simulation end time. More...
 
virtual void SetEndSimTime (bool bVal)
 Sets whether to use the simulation end time. More...
 
virtual void ShutdownSimulation ()=0
 Shuts down the simulation. More...
 
virtual bool ShuttingDown ()
 Tells whether the simulation is shutting down or not. More...
 
virtual ISimGUICallbackSimCallback ()
 Calback object from the simulation. More...
 
virtual void SimCallBack (ISimGUICallback *lpCallback)
 Sets the calback object from the simulation. More...
 
virtual bool SimRunning ()
 Gets whether the simulation is running. More...
 
virtual void Simulate ()
 Simulates the system. More...
 
virtual bool SimulateHydrodynamics ()
 Gets whether the simulation uses hydrodynamics. More...
 
virtual void SimulateHydrodynamics (bool bVal)
 Sets whether the simulation uses hydrodynamics. More...
 
virtual bool SimulationBlockConfirm ()
 Confirms that the simulation has been blocked. More...
 
virtual std::string SimulationFile ()
 Gets the simulation filename. More...
 
virtual void SimulationFile (std::string strFile)
 Sets the simulation filename. More...
 
virtual long SliceToMillisecond (long lSlice)
 Calculates the number of milliseconds from a supplied number of time slices. More...
 
virtual long SnapshotByteSize ()
 Gets the snapshot byte size. More...
 
virtual float StabilityScale ()
 Sets the linear scaling factor that controls the simulation stability parameters. More...
 
virtual void StabilityScale (float fltVal)
 Sets the linear scaling factor that controls the simulation stability parameters. More...
 
virtual unsigned long long StartSimTick ()
 The time slice tick at which the simulation start. More...
 
virtual bool StartSimulation ()=0
 Starts the simulation. More...
 
virtual void StartVideoPlayback ()
 Starts a video playback. More...
 
virtual unsigned long long StepSimEndTick ()
 
virtual unsigned long long StepStartTick ()
 
virtual void StepVideoPlayback (int iFrameCount=1)
 Step video playback. More...
 
virtual bool Stopped ()
 Tells if the simulation has been stopped. More...
 
virtual void StopSimulation ()=0
 Stops the simulation and resets it. More...
 
virtual void StopVideoPlayback ()
 Stop video playback. More...
 
virtual float Time ()
 Gets the current simulation time in seconds. More...
 
virtual double TimerDiff_m (unsigned long long lStart, unsigned long long lEnd)=0
 
virtual double TimerDiff_s (unsigned long long lStart, unsigned long long lEnd)=0
 
virtual double TimerDiff_u (unsigned long long lStart, unsigned long long lEnd)=0
 
virtual long TimeSlice ()
 Gets the current time slice. More...
 
virtual void TimeSlice (long lVal)
 Sets the current time slice. More...
 
virtual float TimeStep ()
 Gets the smallest integration time step used within the simulation. More...
 
virtual void ToggleSimulation ()=0
 Toggles the simulation between running and paused. More...
 
virtual void UnblockSimulation ()
 Unblock simulation. More...
 
virtual int VideoLoops ()
 Gets the video loops. More...
 
virtual void VideoLoops (int iVal)
 Sets the video loops. More...
 
virtual KeyFrameVideoPlayback ()
 Gets the video playback frame. More...
 
virtual void VideoPlayback (KeyFrame *lpFrame)
 Sets the video playback frame. More...
 
virtual KeyFrameVideoRecorder ()
 Gets the video recorder. More...
 
virtual void VideoRecorder (KeyFrame *lpFrame)
 Sets the video recorder. More...
 
virtual long VideoSliceCount ()
 Gets the video slice count. More...
 
virtual void VideoSliceCount (long lVal)
 Sets the video slice count. More...
 
virtual int VisualSelectionMode ()
 Gets the visual selection mode. More...
 
virtual void VisualSelectionMode (int iVal)
 Sets the visual selection mode. More...
 
virtual bool WaitForSimulationBlock (long lTimeout=6000)
 Wait for simulation block. More...
 
virtual void WriteToConsole (std::string strMessage)=0
 
- Public Member Functions inherited from AnimatSim::AnimatBase
 AnimatBase ()
 Constructs an AnimatBase object. More...
 
virtual ~AnimatBase ()
 Destroys the AnimatBase object.. More...
 
virtual void AfterResetSimulation ()
 Called after a simulation reset for some objects. More...
 
virtual void Copy (CStdSerialize *lpSource)
 
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. More...
 
virtual bool Enabled ()
 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. More...
 
virtual NeuralModuleGetNeuralModule ()
 Gets the neural module. More...
 
virtual NodeGetNode ()
 Gets the node. More...
 
virtual SimulatorGetSimulator ()
 Gets the simulator pointer. More...
 
virtual StructureGetStructure ()
 Gets the structure for this node. More...
 
virtual bool HasProperty (const std::string &strName)
 Queries this object if it has a property with the given name. More...
 
virtual std::string ID ()
 Gets the unique GUID ID of this object. More...
 
virtual void ID (std::string strValue)
 Sets the unique GUID ID of the object. More...
 
virtual void Kill (bool bState=true)
 Kills. More...
 
virtual std::string Name ()
 Gets the name of this object. More...
 
virtual void Name (std::string strValue)
 Sets the name of the object. Blank is acceptable. More...
 
virtual AnimatPropertyType PropertyType (const std::string &strName)
 
virtual void ReInitialize ()
 Re-initialize this object. More...
 
virtual void RigidBodyAdded (std::string strID)
 
virtual void RigidBodyRemoved (std::string strID)
 
virtual bool Selected ()
 Tells if this items is selected or not. More...
 
virtual void Selected (bool bValue, bool bSelectMultiple)
 Selects this object. More...
 
virtual bool SetData (const std::string &strDataType, const float fltValue, bool bThrowError=true)
 Set a variable based on a string data type name. More...
 
virtual bool SetData (const std::string &strDataType, const long lValue, bool bThrowError=true)
 Set a variable based on a string data type name. More...
 
virtual void SetSystemPointers (Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
 Sets the system pointers. More...
 
virtual void TimeStepModified ()
 Notification method that the time step modified has been modified. Objects should recalculate any slice times as needed. More...
 
virtual std::string Type ()
 returns the string type name of this object. More...
 
virtual void Type (std::string strValue)
 Sets the class type for this object. More...
 
virtual void VerifySystemPointers ()
 Verify that system pointers have been set correctly. More...
 
virtual void VisualSelectionModeChanged (int iNewMode)
 Visual selection mode changed. More...
 

Static Public Member Functions

static SimulatorCastToDerived (AnimatBase *lpBase)
 
static SimulatorCreateAndInitializeSimulator (std::string strSimFile, bool bForceNoWindows=false)
 Creates a simulator from a specified file and initializes it. More...
 
static SimulatorCreateSimulator (std::string strAnimatModule, std::string strSimulationFile, bool bForceNoWindows=false)
 Creates a simulator from a simulator file. More...
 
static SimulatorCreateSimulator (std::string strSimFile, bool bForceNoWindows=false)
 Creates a simulator from a specified file. More...
 
static SimulatorCreateSimulator (std::string strAnimatModule, CStdXml &oXml)
 Creates a simulator from an xml packet. More...
 
static SimulatorCreateSimulator (std::string strAnimatModule, std::string strProjectPath, std::string strExecutablePath)
 Creates a simulator from passed in settings.. More...
 
static SimulatorCreateSimulator (int argc, const char **argv)
 Creates a simulator from the command line. More...
 
static IStdClassFactoryLoadClassFactory (std::string strModuleName, bool bThrowError=true)
 Loads the class factory specified in the DLL module name. More...
 

Protected Member Functions

virtual void AddOdorType (OdorType *lpOdorType)
 
virtual void AddOdorType (std::string strXml, bool bDoNotInit)
 
virtual void AddOrganism (Organism *lpOrganism)
 Adds a new organism to the list of structures for this simulation. More...
 
virtual void AddOrganism (std::string strXml)
 Adds an organism defined by an xml data packet. More...
 
virtual void AddScript (std::string strXml)
 Creates and adds a scripting object to this structure. More...
 
virtual void AddStructure (Structure *lpStructure)
 Adds a new "static" structure to the list of structures for this simulation. More...
 
virtual void AddStructure (std::string strXml)
 Adds an structure defined by an xml data packet. More...
 
virtual void AfterStepSimulation ()
 Method called for the base Simulator object to run code after the physics engine has been fully stepped. This is primarily being used to collect extra data if needed after the physics engine has been run. If you are building your own physics engine you will need to remember to call this after you have stepped it. More...
 
virtual double CalculateRemainingPlaybackTime ()
 
virtual long CalculateSnapshotByteSize ()
 Calculates the snapshot byte size. More...
 
virtual void CheckEndSimulationTime ()
 Checks the simulation end time. More...
 
virtual bool CheckSimulationBlock ()
 Checks whether or not a simulation block has been requested. More...
 
float ConvertDenominatorDistanceUnits (std::string strUnits)
 Convert the string ID of the distance units to a conversion factor for the denominator of the distance units. More...
 
float ConvertDisplayMassUnits (std::string strUnits)
 Convert the string ID of the display units to a conversion factor. More...
 
float ConvertDistanceUnits (std::string strUnits)
 Convert the string ID of the distance units to a conversion factor. More...
 
float ConvertMassUnits (std::string strUnits)
 Convert the string ID of the mass units to a conversion factor. More...
 
virtual SimulationRecorder * CreateSimulationRecorder ()=0
 Creates the simulation recorder. More...
 
virtual double CurrentRealTimeForStep_n ()
 
virtual double CurrentRealTimeForStep_s ()
 
virtual int FindAdapterListIndex (CStdArray< Adapter * > aryAdapters, std::string strID, bool bThrowError=true)
 
virtual int FindExtraDataIndex (BodyPart *lpPart)
 
virtual int FindFoodSourceIndex (RigidBody *lpFood)
 Searches for the index of the food source. More...
 
virtual void GenerateAutoSeed ()
 Generates an automatic seed value based on the current time. More...
 
virtual void HandleCriticalError (std::string strError)
 
virtual void HandleNonCriticalError (std::string strError)
 
virtual void InitializeRandomNumbers ()
 Initializes the random number generation system. More...
 
virtual void InitializeStructures ()
 Initializes all of the structures of this simulation. More...
 
virtual void LoadEnvironment (CStdXml &oXml)
 Loads all structures from from the configuration file for this simulation. More...
 
OdorTypeLoadOdorType (CStdXml &oXml)
 Loads an odor type. More...
 
OrganismLoadOrganism (CStdXml &oXml)
 Loads an organism. More...
 
virtual ScriptProcessorLoadScript (CStdXml &oXml)
 Loads the script. More...
 
StructureLoadStructure (CStdXml &oXml)
 Loads a structure. More...
 
virtual void NotifyTimeStepModified ()
 Notifies the objects that time step has been modified. More...
 
virtual void ProcessSimulationStep ()
 Process the an entire step of the simulation. This includes the simulation portion, video and calculating timing. More...
 
virtual void RecordAddedPlaybackTime ()
 
virtual void RecordSimulationStepTimer ()
 
virtual void RecordSimulationTotalStepTimer ()
 
virtual void RecordVideoFrame ()
 Record video frame. More...
 
virtual double RemainingVideoFrameTime ()
 
virtual void RemoveOdorType (std::string strID, bool bThrowError=true)
 
virtual void RemoveOrganism (std::string strID, bool bThrowError=true)
 Removes an organism by its ID. More...
 
virtual void RemoveScript (std::string strID, bool bThrowError=true)
 Removes the script based on ID. More...
 
virtual void RemoveStructure (std::string strID, bool bThrowError=true)
 Removes a structure by its ID. More...
 
virtual void ResetSimulationTimingParams ()
 Resets the variables that are used to keep track of the time that each component of the time step takes to execute. More...
 
virtual void SimPausing ()
 Simulation pausing event. More...
 
virtual void SimStarting ()
 Simulation starting event. More...
 
virtual void SimStopping ()
 Simulation stopping event. More...
 
virtual void SimulateBegin ()
 Called at the beginning of the Simulate method. More...
 
virtual void SimulateEnd ()
 Called at the end of the Simulate method. More...
 
virtual void SnapshotStopFrame ()=0
 Takes a snapshot of the current frame. More...
 
virtual void StartSimulationStepTimer ()
 
virtual void StartVideoFrameTimer ()
 
virtual void Step ()
 Steps the simulation forward by one time slice. More...
 
virtual void StepDataCharts ()
 
virtual void StepExternalStimuli ()
 
virtual void StepNeuralEngine ()
 Step the neural engine of each organism. More...
 
virtual void StepPhysicsEngine ()
 Calls StepPhysicsEngine of all structures. More...
 
virtual void StepPlaybackControl ()
 
virtual void StepSimRecorder ()
 
virtual void StepSimulation ()
 Steps the entire simulation forward by one physics integration time step. More...
 
virtual void StepVideoFrame ()
 
virtual double TimeBetweenVideoFrames ()
 
virtual void UpdateSimulationWindows ()=0
 

Static Protected Member Functions

static void LoadAnimatModuleName (std::string strFile, std::string &strAnimatModule)
 Loads an animat module name. More...
 
static void LoadAnimatModuleName (CStdXml &oXml, std::string &strAnimatModule)
 Loads an animat module name. More...
 

Protected Attributes

CStdMap< std::string, Structure * > m_aryAllStructures
 
CStdArray< BodyPart * > m_aryExtraDataParts
 
CStdArray< RigidBody * > m_aryFoodSources
 An Array of RigidBody parts that also act as food sources within the environment.
 
CStdMap< std::string, IStdClassFactory * > m_aryNeuralModuleFactories
 
CStdMap< std::string, AnimatBase * > m_aryObjectList
 A list of all animatbase objects in the simulation.
 
CStdPtrMap< std::string, OdorType > m_aryOdorTypes
 
CStdPtrMap< std::string, Organism > m_aryOrganisms
 
CStdArray< Adapter * > m_arySourcePhysicsAdapters
 Array of source physics adapters.
 
CStdPtrMap< std::string, Structure > m_aryStructures
 
CStdArray< Adapter * > m_aryTargetPhysicsAdapters
 Array of target physics adapters.
 
bool m_bAddBodiesMode
 true if the AddBodies mode is enabled within the GUI.
 
bool m_bAutoGenerateRandomSeed
 
bool m_bBlockSimulation
 true to block simulation. See WaitForBlock for more info.
 
bool m_bEnableSimRecording
 true to enable simulation recording
 
bool m_bForceFastMoving
 true if we need to set the physics system to force handling of fast moving objects.
 
bool m_bForceNoWindows
 If this is set to true then no graphical simulation windows will be created regardless of what the config files says.
 
bool m_bForceSimulationStop
 Set to true to stop the simulation. This is a more forceful way of stopping the sim.
 
bool m_bInDrag
 Tells if we are in the middle of a mouse drag operation to move or rotate a part.
 
bool m_bInitialized
 true if the simulation has been initialized.
 
bool m_bIsResetting
 True if we are in the process of resetting the simulation. False otherwise.
 
bool m_bManualStepSimulation
 If true then the user is manually stepping the simulation.
 
bool m_bPaused
 true if the simulation is paused.
 
bool m_bRecordVideo
 true to record video
 
bool m_bRobotAdpaterSynch
 
bool m_bSetEndSim
 true if we the user has manually set the simulation end time.
 
bool m_bShuttingDown
 True if the simulation is shutting down. This is used by other objects in their destructor to know whether to do certain operations or not.
 
bool m_bSimBlockConfirm
 true to confirm that a simulation block is in place.
 
bool m_bSimRunning
 true if the simulation is running
 
bool m_bSimulateHydrodynamics
 
bool m_bSteppingSim
 true if stepping of simulation has begun. This is set to true once the Simulate methods has been called.
 
bool m_bStopSimulation
 Set to true to stop the simulation.
 
double m_dblTime
 
double m_dblTimeStep
 
double m_dblTotalStepTime
 This is a temp variable for measuring sim time for a set period for each simulation.
 
float m_fltActualFrameRate
 The frame rate for the current frame.
 
float m_fltAlphaThreshold
 The threshold value to use when setting the AlphaFunc for the entire scene.
 
float m_fltAngularCompliance
 The angular compliance of the simulation environment.
 
float m_fltAngularDamping
 The angular damping of the simulation environment.
 
float m_fltAngularKineticLoss
 The angular kinetic loss of the simulation environment.
 
float m_fltDataChartStepTime
 time to process data charts for this step.
 
float m_fltDenominatorDistanceUnits
 
float m_fltDesiredFrameStep
 The desired time value duration of the video frame step.
 
float m_fltDisplayMassUnits
 Tells how many kilograms/m^3 each unit of density is worth within the simulation environment.
 
float m_fltDistanceUnits
 Tells how many meters each unit of distance is worth within the simulation environment.
 
float m_fltEndSimTime
 The time when the simulation should end.
 
float m_fltExternalStimuliStepTime
 Time to process external stimuli for this step.
 
float m_fltGravity
 The acceleration of gravity to use in the simulation.
 
float m_fltInverseDistanceUnits
 The inverse of the distance units.
 
float m_fltInverseMassUnits
 The inverse of the mass units.
 
float m_fltLinearCompliance
 The linear compliance of the simulation environment.
 
float m_fltLinearDamping
 The linear damping of the simulation environment.
 
float m_fltLinearKineticLoss
 The linear kinetic loss of the simulation environment.
 
float m_fltMassUnits
 Tells how many kilograms each unit of mass is worth within the simulation environment.
 
float m_fltMouseSpringDampingForceMagnitude
 The magnitude of the damping component of the force being applied by the mosue spring at each step.
 
float m_fltMouseSpringForceMagnitude
 The magnitude of the force being applied by the mosue spring at each step.
 
float m_fltMouseSpringLengthMagnitude
 The magnitude of the length of the mouse spring at each step.
 
float m_fltMouseSpringStiffness
 The stiffness of the user mouse spring.
 
float m_fltPhysicsStepTime
 This is the time pers step for the physics engine.
 
float m_fltPhysicsSubstepTime
 
float m_fltPhysicsTimeStep
 The time increment for each time slice of the physics simulation.
 
float m_fltPlaybackAdditionRealTimeToStep
 
float m_fltPresetPlaybackTimeStep
 
float m_fltPrevPhysicsStepTime
 
float m_fltPrevTotalRealTimeForStep
 Previous total time for the step. Used for exponential smoothing algorithm.
 
float m_fltRealTime
 This keeps track of the real time from the begginning of the simulation.
 
float m_fltRecFieldSelRadius
 
float m_fltRemainingStepTime
 
float m_fltSimRecorderStepTime
 Time to process simulation recorder for this step.
 
float m_fltSimulationRealTimeToStep
 
float m_fltStabilityScale
 A linear scaling factor for setting the simulation parameters.
 
float m_fltTime
 The current simulation time.
 
float m_fltTimeStep
 This is the minimum integration time step taken for all neural modules and the physics engine.
 
float m_fltTotalMicroSleepCount
 Total number of times we called microsleep during playback pause calculations.
 
float m_fltTotalMicroSleepTime
 Total time we were in microsleep during playback pause calculations;.
 
float m_fltTotalMicroWaitCount
 Total number of loop iterations for microwait during playback pause calculations.
 
float m_fltTotalMicroWaitTime
 Total time we were in microwait during playback pause calculations;.
 
float m_fltTotalNeuralStepTime
 Total time for processing of all neural items for this step.
 
float m_fltTotalRealTimeForStep
 This is the total time it takes to complete one physics time step.
 
float m_fltTotalRealTimeForStepSmooth
 Current value of the exponential smoothing algorith for real time step.
 
float m_fltVideoEndTime
 Time of the video end.
 
float m_fltVideoPlaybackFrameTime
 Time of the video playback frame.
 
float m_fltVideoRecordFrameTime
 Time of the video record frame.
 
float m_fltVideoStartTime
 Time of the video start.
 
float m_ftlMouseSpringDamping
 The damping of the user mouse spring.
 
int m_iDesiredFrameRate
 Desired frame rate of the simulation video.
 
int m_iExtraDataCount
 Number of parts that require extra data to be collected.
 
int m_iManualRandomSeed
 
int m_iPhysicsBodyCount
 
int m_iPhysicsStepCount
 
short m_iPhysicsStepInterval
 
int m_iPhysicsSubsteps
 
int m_iPlaybackControlMode
 Determines the mode used for playback control. See the accessor method for more details.
 
int m_iSelectionMode
 This is the currect visual selection mode used within the GUI.
 
int m_iTargetAdapterCount
 Number of target adapters.
 
int m_iVideoLoops
 Zero-based index of the video loops.
 
int m_iVideoStep
 Zero-based index of the video step.
 
int m_iVideoStepSize
 Size of the i video step.
 
float m_lEndSimTimeSlice
 The time slice when the simulation should end.
 
unsigned long long m_lLastTickTaken
 This is the last tick taken by a GetTickCount. It is used in debugging.
 
IStdClassFactorym_lpAnimatClassFactory
 
long m_lPhysicsSliceCount
 The number of slices that the physics engine has been updated.
 
ThreadProcessorm_lpIOThread
 The pointer to an i/o thread processor.
 
ThreadProcessorm_lpNeuralThread
 The pointer to a neural thread processor.
 
ThreadProcessorm_lpPhysicsThread
 The pointer to the physics thread processor.
 
ScriptProcessorm_lpScript
 
Organism * m_lpSelOrganism
 The pointer to a selected organism.
 
Structure * m_lpSelStructure
 The pointer to a selected structure.
 
ISimGUICallbackm_lpSimCallback
 
SimulationRecorder * m_lpSimRecorder
 The pointer to a simulation recorder.
 
KeyFrame * m_lpSimStopPoint
 The pointer to a simulation stop point.
 
KeyFrame * m_lpVideoPlayback
 The pointer to a video playback.
 
KeyFrame * m_lpVideoRecorder
 The pointer to a video recorder.
 
SimulationWindowMgrm_lpWinMgr
 Manager for SimulationWindows.
 
long m_lSnapshotByteSize
 Size of a memory snapshot in bytes.
 
unsigned long long m_lStartSimTick
 The tick count for when the simulation first begins running.
 
unsigned long long m_lStepSimEndTick
 The tick count for when the simulation procressing of the step ends.
 
unsigned long long m_lStepStartTick
 This is the tick count that is taken when a step is started.
 
long m_lStepTimeCount
 This is a temp variable for measuring sim time for a set period for each simulation.
 
long m_lTimeSlice
 The current time slice. This a long value.
 
long m_lVideoEndSlice
 The video end slice.
 
long m_lVideoFrame
 The video frame.
 
unsigned long long m_lVideoFrameStartTick
 The tick when a new video frame time starts.
 
long m_lVideoSliceCount
 Current video slice time slice.
 
long m_lVideoStartSlice
 The video start slice.
 
DataChartMgr m_oDataChartMgr
 Manager for data charts.
 
ExternalStimuliMgr m_oExternalStimuliMgr
 Manager for external stimuli.
 
LightManager m_oLightMgr
 Manager for the light objects.
 
Materials m_oMaterialMgr
 Manager for Materials.
 
CStdMap< std::string, Organism * >::iterator m_oOrganismIterator
 An organism iterator.
 
CStdMap< std::string, Structure * >::iterator m_oStructureIterator
 A structure iterator.
 
std::string m_strExecutablePath
 The directory path where the executable is located.
 
std::string m_strProjectPath
 The directory path where the simulation configuration files are located.
 
std::string m_strSimulationFile
 The name of the Animat Simulation (ASIM) file.
 
std::string m_strVideoFilename
 Filename of the video file.
 
CStdColor m_vBackgroundColor
 The background color to use when drawing the environment.
 
- Protected Attributes inherited from AnimatSim::AnimatBase
bool m_bEnabled
 Tells if this item is enabled or not. If it is not enabled then it is not run.
 
bool m_bSelected
 Tells whether the object is selected or not.
 
AnimatSim::Behavior::NeuralModulem_lpModule
 The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NULL.
 
Nodem_lpNode
 The pointer to this items parent Node. If this is not relevant for this object then this is NULL.
 
Simulatorm_lpSim
 The pointer to a Simulation.
 
AnimatSim::Environment::Structurem_lpStructure
 The pointer to this items parent Structure. If this is not relevant for this object then this is NULL.
 
std::string m_strID
 The unique Id for this object.
 
std::string m_strName
 The name for this object.
 
std::string m_strType
 The type for this object. Examples are Box, Plane, Neuron, etc..
 

Detailed Description

Simulates the entire environment.

This is the core simulation object of AnimatLab. It is responsible for managing all organisms/structures, the environment, etc.. Essentially, anything related to the simulation is controlled by this class, or the derived class that is specific for a physics engine.

Author
dcofer
Date
3/25/2011

Definition at line 31 of file Simulator.h.

Constructor & Destructor Documentation

AnimatSim::Simulator::Simulator ( )

Default constructor.

Author
dcofer
Date
3/28/2011

Definition at line 60 of file Simulator.cpp.

References m_bAddBodiesMode, m_bAutoGenerateRandomSeed, m_bBlockSimulation, m_bEnableSimRecording, m_bForceFastMoving, m_bForceNoWindows, m_bForceSimulationStop, m_bInDrag, m_bInitialized, m_bIsResetting, m_bManualStepSimulation, m_bPaused, m_bRecordVideo, m_bRobotAdpaterSynch, m_bShuttingDown, m_bSimBlockConfirm, m_bSimRunning, m_bSimulateHydrodynamics, m_bSteppingSim, m_bStopSimulation, m_dblTotalStepTime, m_fltActualFrameRate, m_fltAlphaThreshold, m_fltAngularCompliance, m_fltAngularDamping, m_fltAngularKineticLoss, m_fltDataChartStepTime, m_fltDenominatorDistanceUnits, m_fltDesiredFrameStep, m_fltDisplayMassUnits, m_fltDistanceUnits, m_fltEndSimTime, m_fltExternalStimuliStepTime, m_fltGravity, m_fltInverseDistanceUnits, m_fltInverseMassUnits, m_fltLinearCompliance, m_fltLinearDamping, m_fltLinearKineticLoss, m_fltMassUnits, m_fltMouseSpringDampingForceMagnitude, m_fltMouseSpringForceMagnitude, m_fltMouseSpringLengthMagnitude, m_fltMouseSpringStiffness, m_fltPhysicsStepTime, m_fltPhysicsSubstepTime, m_fltPhysicsTimeStep, m_fltPlaybackAdditionRealTimeToStep, m_fltPresetPlaybackTimeStep, m_fltPrevPhysicsStepTime, m_fltPrevTotalRealTimeForStep, m_fltRealTime, m_fltRecFieldSelRadius, m_fltRemainingStepTime, m_fltSimRecorderStepTime, m_fltSimulationRealTimeToStep, m_fltStabilityScale, m_fltTime, m_fltTimeStep, m_fltTotalMicroSleepCount, m_fltTotalMicroSleepTime, m_fltTotalMicroWaitCount, m_fltTotalMicroWaitTime, m_fltTotalNeuralStepTime, m_fltTotalRealTimeForStep, m_fltTotalRealTimeForStepSmooth, m_fltVideoEndTime, m_fltVideoPlaybackFrameTime, m_fltVideoRecordFrameTime, m_fltVideoStartTime, m_ftlMouseSpringDamping, m_iDesiredFrameRate, m_iManualRandomSeed, m_iPhysicsBodyCount, m_iPhysicsStepCount, m_iPhysicsStepInterval, m_iPhysicsSubsteps, m_iPlaybackControlMode, m_iSelectionMode, m_iVideoLoops, m_iVideoStepSize, m_lEndSimTimeSlice, m_lpAnimatClassFactory, m_lPhysicsSliceCount, m_lpIOThread, m_lpNeuralThread, m_lpPhysicsThread, m_lpSelOrganism, m_lpSelStructure, m_lpSimCallback, m_lpSimRecorder, m_lpSimStopPoint, m_lpVideoPlayback, m_lpVideoRecorder, m_lpWinMgr, m_lSnapshotByteSize, m_lStepTimeCount, m_lTimeSlice, m_lVideoEndSlice, m_lVideoFrame, m_lVideoSliceCount, m_lVideoStartSlice, m_oDataChartMgr, m_oExternalStimuliMgr, m_oLightMgr, m_oMaterialMgr, AnimatSim::AnimatBase::m_strID, AnimatSim::AnimatBase::m_strName, m_strVideoFilename, m_vBackgroundColor, StdUtils::CStdColor::Set(), and AnimatSim::AnimatBase::SetSystemPointers().

+ Here is the call graph for this function:

Member Function Documentation

bool AnimatSim::Simulator::AddBodiesMode ( )
virtual

Gets the Adds bodies mode.

Author
dcofer
Date
3/28/2011
Returns
true if GUI is in AddBody mode, false else.

Definition at line 499 of file Simulator.cpp.

References m_bAddBodiesMode.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::AddBodiesMode ( bool  bVal)
virtual

Sets the AddBodies mode.

Within the GUI the user can select the AddBodies mode. When they click on another part it will add a new part at that location. The simulation needs to know if it is in that mode in order to behave in the correct manner. This flag lets it know the state of that mode.

Author
dcofer
Date
3/28/2011
Parameters
bValnew value.

Definition at line 513 of file Simulator.cpp.

References m_bAddBodiesMode.

bool AnimatSim::Simulator::AddItem ( const std::string &  strItemType,
const std::string &  strXml,
bool  bThrowError = true,
bool  bDoNotInit = false 
)
virtual

Adds a new object to this parent.

Generic method to add a new child item to this parent by specifying a string item type descriptor and an xml packet that can be used to load in the new object. The GUI uses this method to create new items that were added with the user interface. The item type lets the method determine what type of item is being created, like synapse, neuron, body part, etc.. It then gets the modulename, classname, and type from the xml and calls CreateObject to create the appropriate type of object. Then it passes in the xml packet to the new objects load method and does any needed initialization and adds it to the parent.

Author
dcofer
Date
2/22/2011
Parameters
strItemTypeString descriptor of the type of item that is being created.
strXmlXML packet that is used to create and load the new item.
bThrowErrorIf true then throw an error if there is a problem, otherwise return false.
Returns
true if it succeeds, false if it fails.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 4870 of file Simulator.cpp.

References AnimatSim::Charting::DataChartMgr::AddDataChart(), AnimatSim::Environment::Materials::AddItem(), AnimatSim::Environment::LightManager::AddItem(), AnimatSim::AnimatBase::AddItem(), AddOrganism(), AddScript(), AnimatSim::ExternalStimuli::ExternalStimuliMgr::AddStimulus(), AddStructure(), m_lpWinMgr, m_oDataChartMgr, m_oExternalStimuliMgr, m_oLightMgr, m_oMaterialMgr, and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

std::string AnimatSim::Simulator::AddKeyFrame ( std::string  strType,
long  lStart,
long  lEnd 
)
virtual

Adds a key frame.

Author
dcofer
Date
3/28/2011
Parameters
strTypeType of the string.
lStartThe start time slice.
lEndThe end time slice.
Returns
.

Definition at line 5073 of file Simulator.cpp.

References AnimatSim::Recording::SimulationRecorder::Add(), AnimatSim::AnimatBase::ID(), and m_lpSimRecorder.

+ Here is the call graph for this function:

virtual void AnimatSim::Simulator::AddOrganism ( Organism *  lpOrganism)
protectedvirtual

Adds a new organism to the list of structures for this simulation.

This method gets a list of all organisms and a list of referneces to all structures in this simulation that are mapped to their ID value. This allows us to use the STL find funtions to find organisms. This is more efficeient that using a loop and recursion. This also allows us to ensure that each organism/structure that is being added has a unique ID value. If you attempt to add a organism that has a ID that is already in the list then an exception will be thrown. Note that this method is NOT creating the object itself, that is done elsewhere. It is simply adding it to the organism list and adding a reference to that created object to m_aryAllStructures list.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpOrganismPointer to an organism.

Referenced by AddItem(), and LoadOrganism().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::AddOrganism ( std::string  strXml)
protectedvirtual

Adds an organism defined by an xml data packet.

This is primarily used by the GUI to create a new organism within the simulation.

Author
dcofer
Date
3/28/2011
Parameters
strXmlThe xml packet to load.

Definition at line 4382 of file Simulator.cpp.

References StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), and LoadOrganism().

+ Here is the call graph for this function:

void AnimatSim::Simulator::AddScript ( std::string  strXml)
protectedvirtual

Creates and adds a scripting object to this structure.

This method is primarily used by the GUI to add a new script objects to the structure. It creates the ScriptProcessor from info in the XML packet and then uses the XML to load in the new script.

Author
dcofer
Date
5/23/2014
Parameters
strXmlThe xml configuration data packet.

Definition at line 4524 of file Simulator.cpp.

References StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), AnimatSim::AnimatBase::Initialize(), and LoadScript().

Referenced by AddItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void AnimatSim::Simulator::AddStructure ( Structure *  lpStructure)
protectedvirtual

Adds a new "static" structure to the list of structures for this simulation.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpStructurePointer to the structure to add.

Referenced by AddItem(), and LoadStructure().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::AddStructure ( std::string  strXml)
protectedvirtual

Adds an structure defined by an xml data packet.

This is primarily used by the GUI to create a new organism within the simulation.

Author
dcofer
Date
3/28/2011
Parameters
strXmlThe xml packet to load.

Definition at line 4437 of file Simulator.cpp.

References StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), and LoadStructure().

+ Here is the call graph for this function:

void AnimatSim::Simulator::AddToObjectList ( AnimatBase lpItem)
virtual

Adds an object to the list of all simulation objects.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpItemPointer to the item to add.

Definition at line 4068 of file Simulator.cpp.

References FindByID(), AnimatSim::AnimatBase::ID(), and m_aryObjectList.

Referenced by AnimatSim::AnimatBase::Load(), Load(), FiringRateSim::FiringRateModule::LoadNetworkXml(), and AnimatCarlSim::CsNeuralModule::LoadNetworkXml().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::AfterStepSimulation ( )
protectedvirtual

Method called for the base Simulator object to run code after the physics engine has been fully stepped. This is primarily being used to collect extra data if needed after the physics engine has been run. If you are building your own physics engine you will need to remember to call this after you have stepped it.

Author
Dcofer
Date
1/19/2014

Definition at line 2478 of file Simulator.cpp.

References m_aryExtraDataParts, and m_iExtraDataCount.

Referenced by VortexAnimatSim::VsSimulator::StepSimulation().

+ Here is the caller graph for this function:

float AnimatSim::Simulator::AngularCompliance ( )
virtual

Gets the angular compliance of the simulation.

Author
dcofer
Date
3/28/2011
Returns
Angular compliance of the simulation.

Definition at line 805 of file Simulator.cpp.

References m_fltAngularCompliance.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::AngularCompliance ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the angular compliance of the simulation.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 816 of file Simulator.cpp.

References m_fltAngularCompliance, m_fltDistanceUnits, m_fltMassUnits, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

float AnimatSim::Simulator::AngularDamping ( )
virtual

Gets the angular damping of the simulation.

Author
dcofer
Date
3/28/2011
Returns
Angular damping of the simulation.

Definition at line 863 of file Simulator.cpp.

References m_fltAngularDamping.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::AngularDamping ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the angular damping of the simulation.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 874 of file Simulator.cpp.

References DisplayMassUnits(), m_fltAngularDamping, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

float AnimatSim::Simulator::AngularKineticLoss ( )
virtual

Gets the angular kinetic loss of teh simulation.

Author
dcofer
Date
3/28/2011
Returns
angular kinetic loss.

Definition at line 920 of file Simulator.cpp.

References m_fltAngularKineticLoss.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::AngularKineticLoss ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the angular kinetic loss of the simulation.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 930 of file Simulator.cpp.

References DisplayMassUnits(), m_fltAngularKineticLoss, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

bool AnimatSim::Simulator::AutoGenerateRandomSeed ( )
virtual

Gets whether to automatically generate a random seed.

Author
dcofer
Date
3/28/2011
Returns
true if auto generating seed, false to if using currently set seed.

Definition at line 715 of file Simulator.cpp.

References m_bAutoGenerateRandomSeed.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::AutoGenerateRandomSeed ( bool  bVal)
virtual

Sets whether to automatically generate random seed.

Author
dcofer
Date
3/28/2011
Parameters
bValtrue to generate automatic seed.

Definition at line 725 of file Simulator.cpp.

References m_bAutoGenerateRandomSeed.

CStdColor * AnimatSim::Simulator::BackgroundColor ( )
virtual

Gets the background color.

Author
dcofer
Date
3/28/2011
Returns
Pointer to the background color.

Definition at line 1460 of file Simulator.cpp.

References m_vBackgroundColor.

Referenced by BackgroundColor(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::BackgroundColor ( CStdColor aryColor)
virtual

Sets the background color.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]aryColorThe color data.

Definition at line 1470 of file Simulator.cpp.

References m_lpWinMgr, m_vBackgroundColor, and AnimatSim::SimulationWindowMgr::UpdateBackgroundColor().

+ Here is the call graph for this function:

void AnimatSim::Simulator::BackgroundColor ( float *  aryColor)
virtual

Sets the background color.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]vColorPointer to the color.

Definition at line 1484 of file Simulator.cpp.

References BackgroundColor().

+ Here is the call graph for this function:

void AnimatSim::Simulator::BackgroundColor ( std::string  strXml)
virtual

Loads the background color from an XML data packet.

Author
dcofer
Date
3/2/2011
Parameters
strXmlThe color data in an xml data packet

Definition at line 1498 of file Simulator.cpp.

References BackgroundColor(), and StdUtils::CStdColor::Load().

+ Here is the call graph for this function:

void AnimatSim::Simulator::BlockSimulation ( )
virtual

Blocks the simulation from stepping.

The simulation and GUI are running in multi-threaded environment. When we make changes to the simulation from the GUI we need to block processing of the simulation thread while we make those changes to prevent memory corruption. This method initiates a block. We then call WaitForSimulationBlock to wait until the block takes effect before we make our changes.

Author
dcofer
Date
3/28/2011

Definition at line 2036 of file Simulator.cpp.

References m_bBlockSimulation.

long AnimatSim::Simulator::CalculateSnapshotByteSize ( )
protectedvirtual

Calculates the snapshot byte size.

Author
dcofer
Date
3/28/2011
Returns
The calculated snapshot byte size.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 5157 of file Simulator.cpp.

References AnimatSim::Environment::Structure::CalculateSnapshotByteSize(), and m_aryAllStructures.

Referenced by InitializeStructures().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::CheckEndSimulationTime ( )
protectedvirtual

Checks the simulation end time.

This checks whether the user has set the simulation to automatically end or not. If it has and the simulation time is greater than or equal to the end time then it stops the simulation. If we are running using the GUI then the m_lpSimCallback should be set. It pauses the simulation and then calls the NeedToStopSimulation event callback. This signals to the GUI that it needs to stop the simulation. If we are running standalone then the simulation is shutdown direclty.

Author
dcofer
Date
3/26/2011

Definition at line 2902 of file Simulator.cpp.

References m_bPaused, m_bSetEndSim, m_fltEndSimTime, m_lpSimCallback, AnimatSim::ISimGUICallback::NeedToStopSimulation(), PauseSimulation(), ShutdownSimulation(), and Time().

Referenced by ProcessSimulationStep().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Simulator::CheckSimulationBlock ( )
protectedvirtual

Checks whether or not a simulation block has been requested.

This is called within the StepSimulation code. It checks whether someone has requested a simulation block. If they have then it sets the m_bSimBlockConfirm flag to true. This blocks the simulation and lets the WaitForSimulationBlock code to proceed.

Author
dcofer
Date
3/28/2011
Returns
true if it blocks, false if it not.

Definition at line 2119 of file Simulator.cpp.

References m_bBlockSimulation, and m_bSimBlockConfirm.

Referenced by ProcessSimulationStep().

+ Here is the caller graph for this function:

float AnimatSim::Simulator::ConvertDenominatorDistanceUnits ( std::string  strUnits)
protected

Convert the string ID of the distance units to a conversion factor for the denominator of the distance units.

This determines the scaling factor that is used within the simulation to scale the arbitrary units to the denominator distance units chosen by the user.

Author
dcofer
Date
3/28/2011
Parameters
strUnitsThe string units.
Returns
.

Definition at line 5369 of file Simulator.cpp.

References StdUtils::Std_CheckString().

Referenced by DistanceUnits().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Simulator::ConvertDisplayMassUnits ( std::string  strUnits)
protected

Convert the string ID of the display units to a conversion factor.

Withing the GUI we sometimes have to use grams as the display unit. Then they can select Kg or mg, etc.. However, the standard units are usually 1 Kg, not 1 g. So we need to do a special conversion for these display units. So for example, Lets say the Mass units chosen is Kg, and they have a mass of 1 kg, then this would be 1000 grams/1000 = 1 Kg. However, if they set the units to be grams and had a 1 Kg mass then they would have 1000 grams/1 = 1 Kg.

Author
dcofer
Date
3/28/2011
Parameters
strUnitsThe string ID the display units.
Returns
conversion factor for the units chosen.

Definition at line 5457 of file Simulator.cpp.

References StdUtils::Std_CheckString().

Referenced by MassUnits().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Simulator::ConvertDistanceUnits ( std::string  strUnits)
protected

Convert the string ID of the distance units to a conversion factor.

This determines the scaling factor that is used within the simulation to scale the arbitrary units to the distance units chosen by the user.

Author
dcofer
Date
3/28/2011
Parameters
strUnitsThe string ID the distance units.
Returns
conversion factor for the units chosen.

Definition at line 5326 of file Simulator.cpp.

References StdUtils::Std_CheckString().

Referenced by DistanceUnits().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Simulator::ConvertMassUnits ( std::string  strUnits)
protected

Convert the string ID of the mass units to a conversion factor.

This determines the scaling factor that is used within the simulation to scale the arbitrary units to the mass units chosen by the user.

Author
dcofer
Date
3/28/2011
Parameters
strUnitsThe string ID the mass units.
Returns
conversion factor for the units chosen.

Definition at line 5412 of file Simulator.cpp.

References StdUtils::Std_CheckString().

Referenced by MassUnits().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Simulator * AnimatSim::Simulator::CreateAndInitializeSimulator ( std::string  strSimFile,
bool  bForceNoWindows = false 
)
static

Creates a simulator from a specified file and initializes it.

This method is primarily used when running the simulator in stand-alone mode.

Author
dcofer
Date
3/28/2011
Parameters
argcThe argc parameter from the command line.
argvThe argv parameter from the command line.
bForceNoWindowsIf this is true then it forces no graphics windows to be created regardless of what the config file says.
Returns
Pointer to the new simulator.

Definition at line 3568 of file Simulator.cpp.

References CreateSimulator(), Initialize(), and Load().

+ Here is the call graph for this function:

CStdSerialize * AnimatSim::Simulator::CreateObject ( std::string  strModule,
std::string  strClassName,
std::string  strType,
bool  bThrowError = true 
)
virtual

Creates an object using a class factory.

The method takes a dll module name, a class name, and a class type and creates an object. The dll is loaded using the specified dll module name. A StdClassFactory pointer is retrieved from the dll, and then we call the CreateObject method of the class factory to create the actual object we need. This allows us to create objects of any type in a modular manner by simply specifying the name of the dll and the class we want.

Author
dcofer
Date
3/28/2011
Parameters
strModuleThe dll module name.
strClassNameName of the class to create.
strTypeThe specific type of the class to create.
bThrowErrortrue to throw error if there is a problem.
Returns
Pointer to the created object.

Definition at line 3440 of file Simulator.cpp.

References StdUtils::IStdClassFactory::CreateObject(), FindNeuralModuleFactory(), LoadClassFactory(), m_lpAnimatClassFactory, m_strExecutablePath, and StdUtils::Std_CheckString().

Referenced by AnimatSim::Recording::SimulationRecorder::Add(), AnimatSim::SimulationWindowMgr::AddSimulationWindow(), AnimatSim::Environment::Joint::LoadConstraintFriction(), AnimatSim::Environment::Joint::LoadConstraintRelaxation(), AnimatSim::Charting::DataChartMgr::LoadDataChart(), AnimatSim::Charting::DataChart::LoadDataColumn(), AnimatSim::ExternalStimuli::ExternalStimuliMgr::LoadExternalStimuli(), AnimatSim::Behavior::NeuralModule::LoadExternalSynapse(), AnimatSim::Gains::LoadGain(), AnimatSim::Robotics::RobotInterface::LoadIOControl(), AnimatSim::Environment::RigidBody::LoadJoint(), AnimatSim::Recording::SimulationRecorder::LoadKeyFrame(), AnimatSim::Environment::LightManager::LoadLight(), FiringRateSim::FiringRateModule::LoadNeuron(), AnimatCarlSim::CsNeuralModule::LoadNeuronGroup(), LoadOrganism(), AnimatSim::Robotics::RobotIOControl::LoadPartInterface(), AnimatSim::Robotics::RemoteControl::LoadRemoteControlLinkage(), AnimatSim::Environment::RigidBody::LoadRigidBody(), AnimatSim::Environment::Organism::LoadRobotInterface(), AnimatSim::Environment::Structure::LoadRoot(), AnimatSim::Environment::Structure::LoadScript(), LoadScript(), AnimatSim::SimulationWindowMgr::LoadSimulationWindow(), FiringRateSim::Synapses::Synapse::LoadSynapse(), AnimatCarlSim::CsNeuralModule::LoadSynapse(), FiringRateSim::Neurons::Neuron::LoadSynapse(), OsgAnimatSim::OsgSimulator::SnapshotStopFrame(), and VortexAnimatSim::VsSimulator::SnapshotStopFrame().

+ Here is the call graph for this function:

virtual SimulationRecorder* AnimatSim::Simulator::CreateSimulationRecorder ( )
protectedpure virtual

Creates the simulation recorder.

Author
dcofer
Date
3/28/2011
Returns
Pointer to the SimulationRecorder.

Implemented in VortexAnimatSim::VsSimulator, and RoboticsAnimatSim::RbSimulator.

Referenced by Load().

+ Here is the caller graph for this function:

Simulator * AnimatSim::Simulator::CreateSimulator ( std::string  strAnimatModule,
std::string  strSimulationFile,
bool  bForceNoWindows = false 
)
static

Creates a simulator from a simulator file.

Author
dcofer
Date
3/28/2011
Parameters
strSimulationFileThe string simulation file.
Returns
Pointer to the new simulator.

Definition at line 3604 of file Simulator.cpp.

References StdUtils::IStdClassFactory::CreateObject(), ExecutablePath(), LoadAnimatModuleName(), LoadClassFactory(), ProjectPath(), SimulationFile(), StdUtils::Std_ExecutablePath(), StdUtils::Std_FileExists(), StdUtils::Std_IsBlank(), StdUtils::Std_IsFullPath(), and StdUtils::Std_SplitPathAndFile().

Referenced by CreateAndInitializeSimulator(), and CreateSimulator().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Simulator * AnimatSim::Simulator::CreateSimulator ( std::string  strSimFile,
bool  bForceNoWindows = false 
)
static

Creates a simulator from a specified file.

This method is primarily used when running the simulator in stand-alone mode.

Author
dcofer
Date
3/28/2011
Parameters
argcThe argc parameter from the command line.
argvThe argv parameter from the command line.
bForceNoWindowsIf this is true then it forces no graphics windows to be created regardless of what the config file says.
Returns
Pointer to the new simulator.

Definition at line 3532 of file Simulator.cpp.

References CreateSimulator(), StdUtils::Std_DirectoryExists(), StdUtils::Std_ExecutablePath(), StdUtils::Std_IsBlank(), StdUtils::Std_SetLogFilePrefix(), and StdUtils::Std_SplitPathAndFile().

+ Here is the call graph for this function:

Simulator * AnimatSim::Simulator::CreateSimulator ( std::string  strAnimatModule,
CStdXml oXml 
)
static

Creates a simulator from an xml packet.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]oXmlThe xml to load.
Returns
Pointer to the new simulator.

Definition at line 3682 of file Simulator.cpp.

References StdUtils::IStdClassFactory::CreateObject(), ExecutablePath(), LoadAnimatModuleName(), LoadClassFactory(), ProjectPath(), StdUtils::Std_ExecutablePath(), StdUtils::Std_IsBlank(), and StdUtils::Std_SplitPathAndFile().

+ Here is the call graph for this function:

Simulator * AnimatSim::Simulator::CreateSimulator ( std::string  strAnimatModule,
std::string  strProjectPath,
std::string  strExecutablePath 
)
static

Creates a simulator from passed in settings..

Author
dcofer
Date
3/28/2011
Parameters
strAnimatModulename of the dll module to load for the class factory.
strProjectPathFull pathname of the string project file.
strExecutablePathFull pathname of the string executable file.
Returns
Pointer to the new simulator.

Definition at line 3746 of file Simulator.cpp.

References StdUtils::IStdClassFactory::CreateObject(), ExecutablePath(), LoadClassFactory(), and ProjectPath().

+ Here is the call graph for this function:

Simulator * AnimatSim::Simulator::CreateSimulator ( int  argc,
const char **  argv 
)
static

Creates a simulator from the command line.

This method is primarily used when running the simulator in stand-alone mode.

Author
dcofer
Date
3/28/2011
Parameters
argcThe argc parameter from the command line.
argvThe argv parameter from the command line.
Returns
Pointer to the new simulator.

Definition at line 3493 of file Simulator.cpp.

References CreateSimulator(), StdUtils::Std_DirectoryExists(), StdUtils::Std_ExecutablePath(), StdUtils::Std_IsBlank(), StdUtils::Std_SetLogFilePrefix(), and StdUtils::Std_SplitPathAndFile().

+ Here is the call graph for this function:

float AnimatSim::Simulator::DenominatorDistanceUnits ( )
virtual

Gets the denominator distance units.

For items that use distance unit measures in the denominator we may want to use a differnt scale that that used for the whole app. For example, if we are using a distance scale of decimeters we will want to use centimeters for the density instead. This allows us to do that.

Author
dcofer
Date
3/28/2011
Returns
Denominator distance units.

Definition at line 1756 of file Simulator.cpp.

References m_fltDenominatorDistanceUnits.

Referenced by AnimatSim::Environment::RigidBody::Density(), and AnimatSim::Environment::RigidBody::GetDensity().

+ Here is the caller graph for this function:

int AnimatSim::Simulator::DesiredFrameRate ( )
virtual

Gets the frame rate used for the simulation windows in cylces per second.

Author
dcofer
Date
3/28/2011
Returns
Frame rate in cylces per second.

Definition at line 1044 of file Simulator.cpp.

References m_iDesiredFrameRate.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::DesiredFrameRate ( int  iVal)
virtual

Sets the frame rate in cycles per second.

Author
dcofer
Date
3/28/2011
Parameters
iValThe new value.

Definition at line 1066 of file Simulator.cpp.

References m_fltDesiredFrameStep, m_iDesiredFrameRate, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

float AnimatSim::Simulator::DesiredFrameStep ( )
virtual

Gets the frame step time.

This is the time between simulation frames.

Author
dcofer
Date
3/28/2011
Returns
Frame duration.

Definition at line 1056 of file Simulator.cpp.

References m_fltDesiredFrameStep.

virtual void AnimatSim::Simulator::DisableCollision ( RigidBody *  lpBody)
virtual

Disables collision between the past-in body and all rigid bodies of the simulator.

Remarks
This method disables collision responses between the rigid body being past in and all rigid bodies in the simulator.
Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpBodyPointer to a body.
void AnimatSim::Simulator::DisableVideoPlayback ( )
virtual

Disables the video playback.

Author
dcofer
Date
3/28/2011

Definition at line 4988 of file Simulator.cpp.

References AnimatSim::Recording::KeyFrame::DisableVideoPlayback(), m_lpSimRecorder, and m_lpVideoPlayback.

+ Here is the call graph for this function:

void AnimatSim::Simulator::DistanceUnits ( std::string  strUnits)
virtual

Sets the distance units.

The physcis engine in AnimatLab uses an arbitrary unit for mass and distance. It is up to the user to decide what those units are. So for example, one distance unit can be a standard meter, or it could be a centimeter. However, internally all distance measurements must remain consistent and be scaled by the same amount. This method calculates the conversion factor used throughout the simulation to insure that all distance units are scaled by the same values.

Author
dcofer
Date
3/28/2011
Parameters
strUnitsThe string identifer of the distance units to use.

Definition at line 1717 of file Simulator.cpp.

References ConvertDenominatorDistanceUnits(), ConvertDistanceUnits(), m_fltDenominatorDistanceUnits, m_fltDistanceUnits, and m_fltInverseDistanceUnits.

Referenced by AnimatSim::Environment::MovableItem::AbsolutePosition(), AnimatSim::Environment::Bodies::LineBase::CalculateLength(), AnimatSim::Environment::OdorType::DiffusionConstant(), AnimatSim::Environment::RigidBody::GetVolume(), AnimatSim::Environment::MotorizedJoint::Initialize(), VortexAnimatSim::Visualization::ControlPoint::Position(), OsgAnimatSim::Visualization::ControlPoint::Position(), AnimatSim::Environment::MovableItem::Position(), AnimatSim::Environment::ContactSensor::ProcessContact(), AnimatSim::Environment::MotorizedJoint::ResetSimulation(), AnimatSim::Environment::MotorizedJoint::SetPosition(), and AnimatSim::Environment::MotorizedJoint::SetVelocity().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Simulator::DistanceUnits ( )
virtual

Gets the distance units used in the simulation.

Author
dcofer
Date
3/28/2011
Returns
Distance units used.

Definition at line 1732 of file Simulator.cpp.

References m_fltDistanceUnits.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

virtual void AnimatSim::Simulator::EnableCollision ( RigidBody *  lpBody)
virtual

Enables collision between the past-in body and all rigid bodies of the simulator.

Remarks
This method enables collision responses between the rigid body being past in and all rigid bodies in the simulator.
Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpBodyPointer to a body.
bool AnimatSim::Simulator::EnableSimRecording ( )
virtual

Tells whehter simulation recording is enabled.

Author
dcofer
Date
3/28/2011
Returns
true if recording is enabled, false else.

Definition at line 1871 of file Simulator.cpp.

References m_bEnableSimRecording.

void AnimatSim::Simulator::EnableSimRecording ( bool  bVal)
virtual

Sets whether simulation recording is Enabled.

Author
dcofer
Date
3/28/2011
Parameters
bValtrue to enable.

Definition at line 1881 of file Simulator.cpp.

References m_bEnableSimRecording.

void AnimatSim::Simulator::EnableVideoPlayback ( std::string  strKeyFrameID)
virtual

Enables the video playback.

Author
dcofer
Date
3/28/2011
Parameters
strKeyFrameIDGUID ID for the string key frame.

Definition at line 4970 of file Simulator.cpp.

References AnimatSim::Recording::KeyFrame::EnableVideoPlayback(), AnimatSim::ActivatedItemMgr::Find(), AnimatSim::AnimatBase::ID(), m_lpSimRecorder, and m_lpVideoPlayback.

+ Here is the call graph for this function:

float AnimatSim::Simulator::EndSimTime ( )
virtual

Gets the time at which to automatically end the simulation.

Author
dcofer
Date
3/28/2011
Returns
Simulation end time.

Definition at line 982 of file Simulator.cpp.

References m_fltEndSimTime.

Referenced by Load(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::EndSimTime ( float  fltVal)
virtual

Sets the time at which to automatically end the simulation.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.

Definition at line 992 of file Simulator.cpp.

References m_fltEndSimTime, m_fltTimeStep, m_lEndSimTimeSlice, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

long AnimatSim::Simulator::EndSimTimeSlice ( )
virtual

Gets the time slice at which to automatically end the simulation.

Author
dcofer
Date
3/28/2011
Returns
Time slice to end simulation.

Definition at line 1008 of file Simulator.cpp.

References m_lEndSimTimeSlice.

void AnimatSim::Simulator::EndSimTimeSlice ( long  lVal)
virtual

Sets the time slice at which to automatically end the simulation.

Author
dcofer
Date
3/28/2011
Parameters
lValThe new time slice value.

Definition at line 1018 of file Simulator.cpp.

References m_fltEndSimTime, m_fltTimeStep, m_lEndSimTimeSlice, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

std::string AnimatSim::Simulator::ExecutablePath ( )
virtual

Gets the directory path to the executable.

Author
dcofer
Date
3/28/2011
Returns
Path to the executable.

Definition at line 307 of file Simulator.cpp.

References m_strExecutablePath.

Referenced by CreateSimulator().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::ExecutablePath ( std::string  strPath)
virtual

Sets the Executable path.

Author
dcofer
Date
3/28/2011
Parameters
strPathFull pathname to the executable file.

Definition at line 317 of file Simulator.cpp.

References m_strExecutablePath.

AnimatBase * AnimatSim::Simulator::FindByID ( std::string  strID,
bool  bThrowError = true 
)
virtual

Searches for the object with the specified ID.

This loops through the list of all objects (m_aryObjectList) in the simulation and tries to find one with a matching ID.

Author
dcofer
Date
3/28/2011
Parameters
strIDGUID ID for the object to find.
bThrowErrortrue to throw error nothing is found.
Returns
null if it fails, else the found by identifier.
Exceptions
IfbThrowError=True and no objects is found it throws an exception.

Definition at line 4008 of file Simulator.cpp.

References m_aryObjectList, and StdUtils::Std_CheckString().

Referenced by AddToObjectList(), AnimatSim::ExternalStimuli::EnablerStimulus::Initialize(), AnimatSim::Environment::ReceptiveFieldPair::Initialize(), AnimatSim::ExternalStimuli::ExternalInputStimulus::Initialize(), AnimatSim::ExternalStimuli::VoltageClamp::Initialize(), AnimatSim::Adapters::ContactAdapter::Initialize(), AnimatSim::ExternalStimuli::PropertyControlStimulus::Initialize(), AnimatSim::Adapters::PropertyControlAdapter::Initialize(), AnimatSim::ExternalStimuli::InverseMuscleCurrent::Initialize(), AnimatSim::Robotics::RobotPartInterface::Initialize(), AnimatSim::Charting::DataColumn::Initialize(), AnimatCarlSim::CsSynapseGroup::Initialize(), AnimatCarlSim::CsSpikingCurrentSynapse::Initialize(), FiringRateSim::Synapses::Synapse::Initialize(), AnimatSim::ExternalStimuli::CurrentStimulus::Initialize(), AnimatSim::Robotics::RemoteControlLinkage::Initialize(), VortexAnimatSim::Visualization::OsgLinearPath::Initialize(), OsgAnimatSim::Visualization::OsgLinearPath::Initialize(), AnimatSim::Adapters::Adapter::Initialize(), IntegrateFireSim::IntegrateFireNeuralModule::InitSynapse(), RemoveFromObjectList(), IntegrateFireSim::IntegrateFireNeuralModule::RemoveSynapseType(), AnimatSim::Environment::Bodies::OdorSensor::SetOdorTypePointer(), and AnimatSim::Environment::Bodies::Mouth::SetStomachPointer().

+ Here is the call graph for this function:

int AnimatSim::Simulator::FindFoodSourceIndex ( RigidBody lpFood)
protectedvirtual

Searches for the index of the food source.

Author
dcofer
Date
6/3/2012
Parameters
[in,out]lpFoodThe pointer to a food source.
Returns
The found food source index, or -1.

Definition at line 4319 of file Simulator.cpp.

References m_aryFoodSources.

Joint * AnimatSim::Simulator::FindJoint ( std::string  strStructureID,
std::string  strJointID,
bool  bThrowError = true 
)
virtual

Finds a joint with the specified ID in the specified structure.

Returns a pointer to the joint with the specified ID that is inside the specified structure if one is found. If either the structure or joint are not found then it will either throw an exception or return NULL depending on the value of bThrowError. This uses the FindStructureFromAll method to search both the "static" structures and the organisms for the specified StructureID.

Author
dcofer
Date
3/28/2011
Parameters
strStructureIDGUID ID for the structure.
strJointIDGUID ID for the joint.
bThrowErrortrue to throw error if no structure is found.
Returns
null if it fails, else the found structure.
Exceptions
IfbThrowError=True and no structure or joint is found it throws an exception.

Definition at line 3954 of file Simulator.cpp.

References AnimatSim::Environment::Structure::FindJoint(), and FindStructureFromAll().

Referenced by VortexAnimatSim::ExternalStimuli::VsMotorVelocityStimulus::Initialize(), and AnimatSim::ExternalStimuli::MotorStimulus::Initialize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

IStdClassFactory * AnimatSim::Simulator::FindNeuralModuleFactory ( std::string  strModuleName,
bool  bThrowError = false 
)
virtual

Searches for the first neural module factory with the matching name.

Author
dcofer
Date
3/28/2011
Parameters
strModuleNameName of the string module to find.
bThrowErrortrue to throw error if there is a problem.
Returns
null if it fails and bThrowError=false, else the found neural module factory.
Exceptions
IfbThrowError=True and no factory is found it throws an exception.

Definition at line 3807 of file Simulator.cpp.

References m_aryNeuralModuleFactories, and StdUtils::Std_CheckString().

Referenced by CreateObject().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

OdorType * AnimatSim::Simulator::FindOdorType ( std::string  strOdorID,
bool  bThrowError = true 
)
virtual

Searches for the first odor type with the specified ID.

Author
dcofer
Date
3/28/2011
Parameters
strOdorIDGUID ID for the odor type.
bThrowErrortrue to throw error if no odor type is found.
Returns
null if it fails, else the found odor type.
Exceptions
IfbThrowError=True and no odor type is found it throws an exception.

Definition at line 3891 of file Simulator.cpp.

References m_aryOdorTypes, and StdUtils::Std_CheckString().

Referenced by AnimatSim::Environment::Odor::SetOdorType().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Organism * AnimatSim::Simulator::FindOrganism ( std::string  strOrganismID,
bool  bThrowError = true 
)
virtual

Searches for the first organism with the specified ID.

This searches only the organisms. It does not include structures.

Author
dcofer
Date
3/28/2011
Parameters
strOrganismIDGUID ID for the organism.
bThrowErrortrue to throw error if no organism is found.
Returns
null if it fails, else the found organism.
Exceptions
IfbThrowError=True and no organism is found it throws an exception.

Definition at line 3835 of file Simulator.cpp.

References m_aryOrganisms, and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

RigidBody * AnimatSim::Simulator::FindRigidBody ( std::string  strStructureID,
std::string  strBodyID,
bool  bThrowError = true 
)
virtual

Finds a rigid body with the specified ID in the specified structure.

Returns a pointer to the body with the specified ID that is inside the specified structure if one is found. If either the structure or body are not found then it will either throw an exception or return NULL depending on the value of bThrowError. This uses the FindStructureFromAll method to search both the "static" structures and the organisms for the specified StructureID.

Author
dcofer
Date
3/28/2011
Parameters
strStructureIDGUID ID for the structure.
strBodyIDGUID ID for the bodu.
bThrowErrortrue to throw error if no structure is found.
Returns
null if it fails, else the found structure.
Exceptions
IfbThrowError=True and no structure or body is found it throws an exception.

Definition at line 3983 of file Simulator.cpp.

References AnimatSim::Environment::Structure::FindRigidBody(), and FindStructureFromAll().

+ Here is the call graph for this function:

Structure * AnimatSim::Simulator::FindStructure ( std::string  strStructureID,
bool  bThrowError = true 
)
virtual

Searches for the first structure with the specified ID.

This searches only the structures. It does not include organisms.

Author
dcofer
Date
3/28/2011
Parameters
strStructureIDGUID ID for the structure.
bThrowErrortrue to throw error if no structure is found.
Returns
null if it fails, else the found structure.
Exceptions
IfbThrowError=True and no structure is found it throws an exception.

Definition at line 3865 of file Simulator.cpp.

References m_aryStructures, and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

Structure * AnimatSim::Simulator::FindStructureFromAll ( std::string  strStructureID,
bool  bThrowError = true 
)
virtual

Searches for the first structure with the specified ID.

This searches both the structures and organisms.

Author
dcofer
Date
3/28/2011
Parameters
strStructureIDGUID ID for the structure.
bThrowErrortrue to throw error if no structure is found.
Returns
null if it fails, else the found structure.
Exceptions
IfbThrowError=True and no structure is found it throws an exception.

Definition at line 3920 of file Simulator.cpp.

References m_aryAllStructures, and StdUtils::Std_CheckString().

Referenced by FindJoint(), FindRigidBody(), AnimatSim::ExternalStimuli::ForceStimulus::Initialize(), VortexAnimatSim::Visualization::VsSimulationWindow::SetupTrackCamera(), and OsgAnimatSim::Visualization::OsgSimulationWindow::SetupTrackCamera().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Simulator::ForceFastMoving ( )
virtual

Gets whether we have set the simulation to force fast moving calculations.

Author
dcofer
Date
3/28/2011
Returns
true if it force, false else.

Definition at line 695 of file Simulator.cpp.

References m_bForceFastMoving.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::ForceFastMoving ( bool  bVal)
virtual

Set simulation to Force fast moving caculations.

Author
dcofer
Date
3/28/2011
Parameters
bValtrue to force.

Definition at line 705 of file Simulator.cpp.

References m_bForceFastMoving.

void AnimatSim::Simulator::GenerateAutoSeed ( )
protectedvirtual

Generates an automatic seed value based on the current time.

Author
dcofer
Date
3/28/2011

Definition at line 2876 of file Simulator.cpp.

References m_iManualRandomSeed, StdUtils::Std_IRand(), and StdUtils::Std_SRand().

Referenced by InitializeRandomNumbers().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DataChartMgr * AnimatSim::Simulator::GetDataChartMgr ( )
virtual

Gets the data chart manager.

Author
dcofer
Date
3/28/2011
Returns
Pointer to DataChartMgr.

Definition at line 400 of file Simulator.cpp.

References m_oDataChartMgr.

float * AnimatSim::Simulator::GetDataPointer ( const std::string &  strDataType)
virtual

Returns a float pointer to a data item of interest in this object.

This is a generic method used to get a pointer to data variable of interest. It is used by a variety of systems in the simulation. The most prominent are the data charting and stimulus classes. Within this method we associate a variable with a string name. By passing in the name of the data type we are interested in we can recieve back a float pointer to that data type. We can use that to read or set the data item in other classes. For example, the data charting system gets the pointer and then each time it needs to log a data point it reads the value into an array.

Author
dcofer
Date
2/22/2011
Parameters
strDataTypename of the data item for which we are looking.
Returns
float pointer of the data item. If not found then it throws an exception.
Exceptions
IfDataType is not found.

Reimplemented from AnimatSim::AnimatBase.

Reimplemented in VortexAnimatSim::VsSimulator, and OsgAnimatSim::OsgSimulator.

Definition at line 4581 of file Simulator.cpp.

References m_fltActualFrameRate, m_fltDataChartStepTime, m_fltExternalStimuliStepTime, m_fltMouseSpringDampingForceMagnitude, m_fltMouseSpringForceMagnitude, m_fltMouseSpringLengthMagnitude, m_fltPhysicsSubstepTime, m_fltPhysicsTimeStep, m_fltPlaybackAdditionRealTimeToStep, m_fltPrevPhysicsStepTime, m_fltRealTime, m_fltRemainingStepTime, m_fltSimRecorderStepTime, m_fltSimulationRealTimeToStep, m_fltTime, m_fltTotalMicroSleepCount, m_fltTotalMicroSleepTime, m_fltTotalMicroWaitCount, m_fltTotalMicroWaitTime, m_fltTotalNeuralStepTime, m_fltTotalRealTimeForStep, m_fltTotalRealTimeForStepSmooth, and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

ExternalStimuliMgr * AnimatSim::Simulator::GetExternalStimuliMgr ( )
virtual

Gets the external stimuli manager.

Author
dcofer
Date
3/28/2011
Returns
Pointer to ExternalStimuliMgr.

Definition at line 410 of file Simulator.cpp.

References m_oExternalStimuliMgr.

Referenced by AnimatSim::ExternalStimuli::ExternalStimulus::SetData().

+ Here is the caller graph for this function:

LightManager * AnimatSim::Simulator::GetLightMgr ( )
virtual

Gets the light manager.

Author
dcofer
Date
7/9/2011
Returns
Pointer to the light manager.

Definition at line 430 of file Simulator.cpp.

References m_oLightMgr.

int AnimatSim::Simulator::GetMaterialID ( std::string  strID)
virtual

Gets a material identifier from the physics engine for the specified unique ID.

This method must be implemented within the derived class for the physics engine.

Author
dcofer
Date
3/28/2011
Parameters
strIDIdentifier for the material.
Returns
The material identifier.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 1434 of file Simulator.cpp.

Materials * AnimatSim::Simulator::GetMaterialMgr ( )
virtual

Gets the material manager.

Author
dcofer
Date
3/28/2011
Returns
Pointer to Materials.

Definition at line 440 of file Simulator.cpp.

References m_oMaterialMgr.

SimulationRecorder * AnimatSim::Simulator::GetSimulationRecorder ( )
virtual

Gets the simulation recorder.

Author
dcofer
Date
3/28/2011
Returns
Pointer to SimulationRecorder.

Definition at line 420 of file Simulator.cpp.

References m_lpSimRecorder.

SimulationWindowMgr * AnimatSim::Simulator::GetWindowMgr ( )
virtual

Gets the window manager.

Author
dcofer
Date
3/28/2011
Returns
Pointer to SimulationWindowMgr.

Definition at line 450 of file Simulator.cpp.

References m_lpWinMgr.

Referenced by VortexAnimatSim::Visualization::VsSimulationWindow::Initialize(), and OsgAnimatSim::Visualization::OsgSimulationWindow::Initialize().

+ Here is the caller graph for this function:

float AnimatSim::Simulator::Gravity ( )
virtual

Gets the gravity value.

Author
dcofer
Date
3/28/2011
Returns
Gravity.

Definition at line 1225 of file Simulator.cpp.

References m_fltGravity.

Referenced by LoadEnvironment(), SetData(), and VortexAnimatSim::Environment::Bodies::VsFluidPlane::SetGravity().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::Gravity ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the Gravity value.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 1236 of file Simulator.cpp.

References m_fltDistanceUnits, and m_fltGravity.

virtual void AnimatSim::Simulator::Initialize ( int  argc,
const char **  argv 
)
pure virtual

Initializes this object.

Author
dcofer
Date
3/28/2011

This is a pure virtual method that must be implemented in the simulator application. It is where a lot of the nitty gritty details are done with initializing and setting up the physics engine so that it can run. It is also where we initialize each structure to tell them to create their parts and joints.

Parameters
argcThe argc parameter from the command line.
argvThe argv parameter from the command line.

Implemented in VortexAnimatSim::VsSimulator, OsgAnimatSim::OsgSimulator, and RoboticsAnimatSim::RbSimulator.

Referenced by CreateAndInitializeSimulator().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::Initialize ( )
virtual

Initializes this object with no argc/argv params.

Author
dcofer
Date
5/16/2014

This method initializes the simulation with no input params.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 5304 of file Simulator.cpp.

Referenced by RunSimulation().

+ Here is the caller graph for this function:

bool AnimatSim::Simulator::Initialized ( )
virtual

Tells if the simulation has been initialized or not.

Author
dcofer
Date
3/28/2011
Returns
true if Initialized, false else.

Definition at line 370 of file Simulator.cpp.

References m_bInitialized.

void AnimatSim::Simulator::Initialized ( bool  bVal)
virtual

Sets whether the simulation has been Initialized.

Author
dcofer
Date
3/28/2011
Parameters
bValtrue if initialized.

Definition at line 380 of file Simulator.cpp.

References m_bInitialized.

void AnimatSim::Simulator::InitializeRandomNumbers ( )
protectedvirtual

Initializes the random number generation system.

Author
dcofer
Date
1/27/2012

Definition at line 1907 of file Simulator.cpp.

References GenerateAutoSeed(), m_bAutoGenerateRandomSeed, m_iManualRandomSeed, and StdUtils::Std_SRand().

Referenced by InitializeStructures(), and ResetSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::InitializeStructures ( )
protectedvirtual

Initializes all of the structures of this simulation.

This method runs through all of the "static" structures and organisms and calls their Initialize method.

Author
dcofer
Date
3/28/2011

Definition at line 1928 of file Simulator.cpp.

References CalculateSnapshotByteSize(), AnimatSim::Environment::Materials::Initialize(), AnimatSim::AnimatBase::Initialize(), InitializeRandomNumbers(), m_aryAllStructures, m_bEnableSimRecording, m_bRecordVideo, m_fltPhysicsTimeStep, m_fltTimeStep, m_fltVideoEndTime, m_fltVideoRecordFrameTime, m_fltVideoStartTime, m_iVideoStep, m_iVideoStepSize, m_lSnapshotByteSize, m_lVideoEndSlice, m_lVideoStartSlice, m_oMaterialMgr, m_strProjectPath, m_strVideoFilename, and PhysicsTimeStep().

Referenced by RoboticsAnimatSim::RbSimulator::Initialize(), OsgAnimatSim::OsgSimulator::Initialize(), and VortexAnimatSim::VsSimulator::Initialize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Simulator::InSimulation ( )
virtual

Used to determine if we are running in a simulation, or in a real control mode.

The robotics simulation object will override this and return false to signify that it is in real-time control of physical hardware. Other simulator objects should leave this as true to signify that they are simulating the physical world. This are several places where we have to initialize things differently based on whether we are trying to run physical hardware or in simulation and this flag lets us know that.

Author
dcofer
Date
5/15/2014
Returns
True if running in simulation, false if running on real hardware.

Reimplemented in RoboticsAnimatSim::RbSimulator.

Definition at line 1673 of file Simulator.cpp.

Referenced by AnimatSim::Behavior::ThreadedModule::ExitPause(), AnimatSim::Robotics::RobotIOControl::ExitPause(), AnimatSim::Robotics::RobotIOControl::Initialize(), AnimatSim::Environment::MotorizedJoint::SetPosition(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataPWMOutput::SetupIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataDigitalInput::SetupIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataDigitalOutput::SetupIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataAnalogInput::SetupIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataHingeServo::SetupIO(), RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::SetupIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataDynamixelServo::SetupIO(), AnimatSim::Environment::MotorizedJoint::SetVelocity(), AnimatSim::Behavior::ThreadedModule::StartPause(), AnimatSim::Robotics::RobotIOControl::StartPause(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataDigitalOutput::StepIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataDigitalInput::StepIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataAnalogInput::StepIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataPWMOutput::StepIO(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataHingeServo::StepIO(), RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::StepIO(), AnimatSim::Adapters::Adapter::StepSimulation(), RoboticsAnimatSim::Robotics::RobotIOControls::Firmata::RbFirmataDynamixelServo::Stop(), and AnimatSim::Robotics::RobotInterface::SynchSim().

float AnimatSim::Simulator::InverseDistanceUnits ( )
virtual

Gets the inverse distance units.

Author
dcofer
Date
3/28/2011
Returns
Inverse distance units.

Definition at line 1742 of file Simulator.cpp.

References m_fltInverseDistanceUnits.

Referenced by AnimatSim::Environment::RigidBody::BuoyancyCenter(), BulletAnimatSim::Environment::BlConstraintRelaxation::CreateDefaultUnits(), VortexAnimatSim::Environment::VsMaterialType::CreateDefaultUnits(), VortexAnimatSim::Visualization::VsScriptedSimulationWindow::DefaultPosition(), OsgAnimatSim::Visualization::OsgScriptedSimulationWindow::DefaultPosition(), BulletAnimatSim::Environment::BlConstraintRelaxation::EqPos(), VortexAnimatSim::Environment::VsMaterialType::FrictionAngularNormalMax(), VortexAnimatSim::Environment::VsMaterialType::FrictionAngularPrimaryMax(), VortexAnimatSim::Environment::VsMaterialType::FrictionAngularSecondaryMax(), VortexAnimatSim::Environment::VsMaterialType::FrictionLinearPrimaryMax(), VortexAnimatSim::Environment::VsMaterialType::FrictionLinearSecondaryMax(), AnimatSim::Environment::Bodies::Cylinder::Height(), AnimatSim::Environment::Bodies::Cone::Height(), AnimatSim::Environment::Bodies::Box::Height(), AnimatSim::Environment::Bodies::Torus::InsideRadius(), AnimatSim::Environment::Bodies::Box::Length(), AnimatSim::Environment::ConstraintLimit::LimitPos(), AnimatSim::Environment::Bodies::Cone::LowerRadius(), AnimatSim::Environment::Bodies::Ellipsoid::MajorRadius(), VortexAnimatSim::Environment::VsMaterialType::MaxAdhesive(), AnimatSim::Environment::ConstraintFriction::MaxForce(), AnimatSim::Environment::MotorizedJoint::MaxForce(), AnimatSim::Environment::RigidBody::MaxHydroForce(), AnimatSim::Environment::RigidBody::MaxHydroTorque(), BulletAnimatSim::Environment::BlConstraintRelaxation::MaxLimit(), AnimatSim::Environment::MotorizedJoint::MaxVelocity(), AnimatSim::Environment::Bodies::Mouth::MinFoodRadius(), BulletAnimatSim::Environment::BlConstraintRelaxation::MinLimit(), AnimatSim::Environment::Bodies::Ellipsoid::MinorRadius(), MouseSpringDampingForceMagnitude(), MouseSpringForceMagnitude(), AnimatSim::Environment::Bodies::Spring::NaturalLength(), AnimatSim::Environment::Bodies::Torus::OutsideRadius(), OsgAnimatSim::Visualization::ControlPoint::Position(), VortexAnimatSim::Visualization::ControlPoint::Position(), AnimatSim::Environment::MovableItem::Position(), AnimatSim::Environment::Bodies::Sphere::Radius(), AnimatSim::Environment::Bodies::Cylinder::Radius(), AnimatSim::Environment::Bodies::Sensor::Radius(), AnimatSim::Environment::Light::Radius(), AnimatSim::Environment::Bodies::Mesh::SetBoundingBox(), AnimatSim::Environment::Bodies::Plane::Size(), AnimatSim::Environment::Joint::Size(), AnimatSim::Environment::Structure::Size(), VortexAnimatSim::Environment::VsMaterialType::SlideAngularNormal(), VortexAnimatSim::Environment::VsMaterialType::SlideAngularPrimary(), VortexAnimatSim::Environment::VsMaterialType::SlideAngularSecondary(), VortexAnimatSim::Environment::VsMaterialType::SlideLinearPrimary(), VortexAnimatSim::Environment::VsMaterialType::SlideLinearSecondary(), VortexAnimatSim::ExternalStimuli::VsMotorVelocityStimulus::StepSimulation(), AnimatSim::ExternalStimuli::MotorStimulus::StepSimulation(), AnimatSim::ExternalStimuli::ForceStimulus::StepSimulation(), AnimatSim::Environment::Bodies::Cone::UpperRadius(), AnimatSim::Environment::Bodies::FluidPlane::Velocity(), and AnimatSim::Environment::Bodies::Box::Width().

bool AnimatSim::Simulator::IsPhysicsBeingUpdated ( )
virtual

Query if this object is physics being updated on this time slice.

Author
dcofer
Date
3/28/2011
Returns
true if physics being updated, false if not.

Definition at line 1444 of file Simulator.cpp.

References m_iPhysicsStepCount, and m_iPhysicsStepInterval.

bool AnimatSim::Simulator::IsResetting ( )
virtual

Returns true if the simulation is in the process of resetting. False otherwise.

Author
David Cofer
Date
1/14/2014

Definition at line 545 of file Simulator.cpp.

References m_bIsResetting.

float AnimatSim::Simulator::LinearCompliance ( )
virtual

Gets the linear compliance of the simulation.

Author
dcofer
Date
3/28/2011
Returns
Linear compliance of the simulation.

Definition at line 776 of file Simulator.cpp.

References m_fltLinearCompliance.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::LinearCompliance ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the linear compliance of the simulation.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 787 of file Simulator.cpp.

References m_fltLinearCompliance, m_fltMassUnits, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

float AnimatSim::Simulator::LinearDamping ( )
virtual

Gets the linear damping of the simulation.

Author
dcofer
Date
3/28/2011
Returns
Linear damping of the simulation.

Definition at line 834 of file Simulator.cpp.

References m_fltLinearDamping.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::LinearDamping ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the linear damping of the simulation.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 845 of file Simulator.cpp.

References DisplayMassUnits(), m_fltLinearDamping, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

float AnimatSim::Simulator::LinearKineticLoss ( )
virtual

Gets the linear kinetic loss of the simulation.

Author
dcofer
Date
3/28/2011
Returns
Linear kinetic loss.

Definition at line 892 of file Simulator.cpp.

References m_fltLinearKineticLoss.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::LinearKineticLoss ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the linear kinetic loss of the simulation.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 902 of file Simulator.cpp.

References DisplayMassUnits(), m_fltLinearKineticLoss, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

void AnimatSim::Simulator::Load ( std::string  strFileName = "")
virtual

Loads the simulation from an xml configuration file.

Author
dcofer
Date
3/28/2011
Parameters
strFileNameThe std::string to load.

Definition at line 2933 of file Simulator.cpp.

References StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), StdUtils::CStdXml::Load(), m_strProjectPath, m_strSimulationFile, and StdUtils::Std_IsBlank().

Referenced by CreateAndInitializeSimulator(), and RunSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::Load ( CStdXml oXml)
virtual

Loads the item using an XML data packet.

This method is responsible for loading the structure from a XMl configuration file. You should call this method even in your overriden function becuase it loads all of the base properties for this object like ID and Name. It also includes this object in the simulators AddToObjectList so that the simulator knows about this object when you do a FindObject call. If you do not call this base method then it is up to you to add your item to the simulators list of objects.

Author
dcofer
Date
3/1/2011
Parameters
[in,out]oXmlThe CStdXml xml data packet to load.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 2968 of file Simulator.cpp.

References AddToObjectList(), CreateSimulationRecorder(), EndSimTime(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::GetChildBool(), StdUtils::CStdXml::GetChildFloat(), StdUtils::CStdXml::GetChildInt(), StdUtils::CStdXml::GetChildString(), LoadEnvironment(), m_bEnableSimRecording, m_bPaused, m_fltEndSimTime, m_fltPresetPlaybackTimeStep, m_iPlaybackControlMode, m_lpSimRecorder, m_lpWinMgr, m_oDataChartMgr, m_oExternalStimuliMgr, m_strProjectPath, PlaybackControlMode(), PresetPlaybackTimeStep(), Reset(), SetEndSimTime(), and StdUtils::Std_IsBlank().

+ Here is the call graph for this function:

void AnimatSim::Simulator::LoadAnimatModuleName ( std::string  strFile,
std::string &  strAnimatModule 
)
staticprotected

Loads an animat module name.

Author
dcofer
Date
3/28/2011
Parameters
strFileThe string file.
[in,out]strAnimatModuleThe string animat module.

Definition at line 3364 of file Simulator.cpp.

References StdUtils::Std_FileExists().

Referenced by CreateSimulator().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::LoadAnimatModuleName ( CStdXml oXml,
std::string &  strAnimatModule 
)
staticprotected

Loads an animat module name.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]oXmlThe xml.
[in,out]strAnimatModuleThe string animat module.

Definition at line 3410 of file Simulator.cpp.

References StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), and StdUtils::CStdXml::GetChildString().

+ Here is the call graph for this function:

IStdClassFactory * AnimatSim::Simulator::LoadClassFactory ( std::string  strModuleName,
bool  bThrowError = true 
)
static

Loads the class factory specified in the DLL module name.

Author
dcofer
Date
3/28/2011
Parameters
strModuleNameName of the dll module.
Returns
Pointer to the class factory.
Exceptions
Throwsan exception if there is an error creating the class factory.

Definition at line 3019 of file Simulator.cpp.

References StdUtils::Std_ToLower().

Referenced by CreateObject(), CreateSimulator(), and AnimatSim::Behavior::NervousSystem::LoadNeuralModule().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::LoadKeyFrameSnapshot ( byte *  aryBytes,
long &  lIndex 
)
virtual

Loads a key frame snapshot.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]aryBytesArray of bytes for the snapshot.
[in,out]lIndexIndex into the byte array.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 5200 of file Simulator.cpp.

References AnimatSim::Environment::Structure::LoadKeyFrameSnapshot(), and m_aryAllStructures.

+ Here is the call graph for this function:

OdorType * AnimatSim::Simulator::LoadOdorType ( CStdXml oXml)
protected

Loads an odor type.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]oXmlThe xml that defines the odor type to load.
Returns
Pointer to the odor type.
Exceptions
Throwsan exception if there is a problem creating or loading the odor type.

Definition at line 3278 of file Simulator.cpp.

References AnimatSim::AnimatBase::SetSystemPointers().

Referenced by LoadEnvironment().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Organism * AnimatSim::Simulator::LoadOrganism ( CStdXml oXml)
protected

Loads an organism.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]oXmlThe xml that defines the organism to load.
Returns
Pointer to the organism.
Exceptions
Throwsan exception if there is a problem creating or loading the organism.

Definition at line 3229 of file Simulator.cpp.

References AddOrganism(), CreateObject(), StdUtils::CStdXml::GetChildString(), StdUtils::CStdXml::IntoElem(), and StdUtils::CStdXml::OutOfElem().

Referenced by AddOrganism(), and LoadEnvironment().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ScriptProcessor * AnimatSim::Simulator::LoadScript ( CStdXml oXml)
protectedvirtual

Loads the script.

Author
dcofer
Date
5/23/2014
Parameters
[in,out]oXmlThe xml data packet to load.
Returns
The script.

Definition at line 3316 of file Simulator.cpp.

References CreateObject(), StdUtils::CStdXml::GetChildString(), StdUtils::CStdXml::IntoElem(), AnimatSim::AnimatBase::Load(), StdUtils::CStdXml::OutOfElem(), and AnimatSim::AnimatBase::SetSystemPointers().

Referenced by AddScript(), and LoadEnvironment().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Structure * AnimatSim::Simulator::LoadStructure ( CStdXml oXml)
protected

Loads a structure.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]oXmlThe xml that defines the structure to load.
Returns
Pointer to the structure.
Exceptions
Throwsan exception if there is a problem creating or loading the structure.

Definition at line 3191 of file Simulator.cpp.

References AddStructure(), StdUtils::IStdClassFactory::CreateObject(), and m_lpAnimatClassFactory.

Referenced by AddStructure(), and LoadEnvironment().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int AnimatSim::Simulator::ManualRandomSeed ( )
virtual

Gets the manual random seed value.

Author
dcofer
Date
3/28/2011
Returns
seed value.

Definition at line 735 of file Simulator.cpp.

References m_iManualRandomSeed.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::ManualRandomSeed ( int  iSeed)
virtual

Sets the manual random seed value.

Author
dcofer
Date
3/28/2011
Parameters
iSeedThe seed.

Definition at line 745 of file Simulator.cpp.

References m_iManualRandomSeed.

bool AnimatSim::Simulator::ManualStepSimulation ( )
virtual

Gets whether the simulation is being stepped manually by the user.

Author
dcofer
Date
3/28/2011
Returns
true if manual stepping, false else.

Definition at line 653 of file Simulator.cpp.

References m_bManualStepSimulation.

void AnimatSim::Simulator::ManualStepSimulation ( bool  bVal)
virtual

Sets whether the simulation is being stepped manually by the user.

Author
dcofer
Date
3/28/2011
Parameters
bValtrue to step manually.

Definition at line 663 of file Simulator.cpp.

References m_bManualStepSimulation.

void AnimatSim::Simulator::MassUnits ( std::string  strUnits)
virtual

Sets the mass units.

The physcis engine in AnimatLab uses an arbitrary unit for mass and distance. It is up to the user to decide what those units are. So for example, one mass unit can be a standard kilogram, or it could be a gram. However, internally all mass measurements must remain consistent and be scaled by the same amount. This method calculates the conversion factor used throughout the simulation to insure that all distance units are scaled by the same values.

Author
dcofer
Date
3/28/2011
Parameters
strUnitsThe std::string identifer of the mass units to use.

Definition at line 1772 of file Simulator.cpp.

References ConvertDisplayMassUnits(), ConvertMassUnits(), m_fltDisplayMassUnits, m_fltInverseMassUnits, and m_fltMassUnits.

Referenced by VortexAnimatSim::Environment::VsMaterialType::Compliance(), VortexAnimatSim::Environment::VsConstraintRelaxation::CreateDefaultUnits(), AnimatSim::Environment::ConstraintFriction::CreateDefaultUnits(), VortexAnimatSim::Environment::VsMaterialType::CreateDefaultUnits(), VortexAnimatSim::Environment::VsConstraintRelaxation::Loss(), AnimatSim::Environment::ConstraintFriction::Loss(), VortexAnimatSim::Environment::VsMaterialType::SlipAngularNormal(), VortexAnimatSim::Environment::VsMaterialType::SlipAngularPrimary(), VortexAnimatSim::Environment::VsMaterialType::SlipAngularSecondary(), VortexAnimatSim::Environment::VsMaterialType::SlipLinearPrimary(), and VortexAnimatSim::Environment::VsMaterialType::SlipLinearSecondary().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Simulator::MassUnits ( )
virtual

Gets the mass units.

Author
dcofer
Date
3/28/2011
Returns
Mass units.

Definition at line 1787 of file Simulator.cpp.

References m_fltMassUnits.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

long AnimatSim::Simulator::Millisecond ( )
virtual

Gets the current simulation time in millisecond.

Author
dcofer
Date
3/28/2011
Returns
Simulation time.

Definition at line 569 of file Simulator.cpp.

References Time().

+ Here is the call graph for this function:

long AnimatSim::Simulator::MillisecondToSlice ( long  lMillisecond)
virtual

Calculates the number of time slices from a supplied number of milliseconds.

Author
dcofer
Date
3/28/2011
Parameters
lMillisecondThe millisecond to convert.
Returns
Number of time slices.

Definition at line 581 of file Simulator.cpp.

References m_fltTimeStep.

float AnimatSim::Simulator::MouseSpringDamping ( )
virtual

Gets the mouse spring damping.

The user can grab onto objects using a mouse spring. This sets the damping of that spring.

Author
dcofer
Date
3/28/2011
Returns
damping.

Definition at line 1286 of file Simulator.cpp.

References m_ftlMouseSpringDamping.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::MouseSpringDamping ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the mouse spring damping.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Definition at line 1297 of file Simulator.cpp.

References DisplayMassUnits(), m_ftlMouseSpringDamping, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

float AnimatSim::Simulator::MouseSpringDampingForceMagnitude ( )
virtual

Gets the magnitude of the mouse spring damping force applied at each time step.

Author
dcofer
Date
5/4/2014
Returns
Force.

Definition at line 1342 of file Simulator.cpp.

References m_fltMouseSpringDampingForceMagnitude.

void AnimatSim::Simulator::MouseSpringDampingForceMagnitude ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the mouse spring damping force that was used in the current timestep. This is for reporting purposes only.

Author
dcofer
Date
5/4/2014
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Definition at line 1353 of file Simulator.cpp.

References InverseDistanceUnits(), InverseMassUnits(), and m_fltMouseSpringDampingForceMagnitude.

+ Here is the call graph for this function:

float AnimatSim::Simulator::MouseSpringForceMagnitude ( )
virtual

Gets the magnitude of the mouse spring force applied at each time step.

Author
dcofer
Date
5/4/2014
Returns
Force.

Definition at line 1314 of file Simulator.cpp.

References m_fltMouseSpringForceMagnitude.

void AnimatSim::Simulator::MouseSpringForceMagnitude ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the mouse spring force that was used in the current timestep. This is for reporting purposes only.

Author
dcofer
Date
5/4/2014
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Definition at line 1325 of file Simulator.cpp.

References InverseDistanceUnits(), InverseMassUnits(), and m_fltMouseSpringForceMagnitude.

+ Here is the call graph for this function:

float AnimatSim::Simulator::MouseSpringLengthMagnitude ( )
virtual

Gets the magnitude of the mouse spring length at each time step.

Author
dcofer
Date
5/4/2014
Returns
Force.

Definition at line 1370 of file Simulator.cpp.

References m_fltMouseSpringLengthMagnitude.

void AnimatSim::Simulator::MouseSpringLengthMagnitude ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the mouse spring length that was used in the current timestep. This is for reporting purposes only.

Author
dcofer
Date
5/4/2014
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Definition at line 1381 of file Simulator.cpp.

References m_fltDistanceUnits, and m_fltMouseSpringLengthMagnitude.

float AnimatSim::Simulator::MouseSpringStiffness ( )
virtual

Gets the mouse spring stiffness.

The user can grab onto objects using a mouse spring. This sets the stiffness of that spring.

Author
dcofer
Date
3/28/2011
Returns
Stiffness of the mouse spring.

Definition at line 1255 of file Simulator.cpp.

References m_fltMouseSpringStiffness.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::MouseSpringStiffness ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the mouse spring stiffness.

Author
dcofer
Date
3/28/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Definition at line 1266 of file Simulator.cpp.

References InverseMassUnits(), m_fltMouseSpringStiffness, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

std::string AnimatSim::Simulator::MoveKeyFrame ( std::string  strID,
long  lStart,
long  lEnd 
)
virtual

Move key frame.

Author
dcofer
Date
3/28/2011
Parameters
strIDGUID ID for the key frame.
lStartThe start time slice.
lEndThe end time slice.
Returns
.

Definition at line 5110 of file Simulator.cpp.

References AnimatSim::Recording::SimulationRecorder::Add(), AnimatSim::ActivatedItem::EndSlice(), AnimatSim::ActivatedItemMgr::Find(), AnimatSim::AnimatBase::ID(), m_lpSimRecorder, AnimatSim::ActivatedItemMgr::Remove(), AnimatSim::ActivatedItem::StartSlice(), and AnimatSim::AnimatBase::Type().

+ Here is the call graph for this function:

void AnimatSim::Simulator::MoveSimulationToKeyFrame ( std::string  strKeyFrameID)
virtual

Move simulation to key frame.

Author
dcofer
Date
3/28/2011
Parameters
strKeyFrameIDGUID ID for the key frame.

Definition at line 5135 of file Simulator.cpp.

References AnimatSim::ActivatedItemMgr::Find(), m_lpSimRecorder, m_lpSimStopPoint, AnimatSim::Recording::KeyFrame::MakeCurrentFrame(), and StdUtils::Std_IsBlank().

+ Here is the call graph for this function:

void AnimatSim::Simulator::NotifyTimeStepModified ( )
protectedvirtual

Notifies the objects that time step has been modified.

Author
dcofer
Date
1/28/2012

Definition at line 1987 of file Simulator.cpp.

References m_aryObjectList, and AnimatSim::AnimatBase::TimeStepModified().

Referenced by SetData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CStdMap< std::string, AnimatBase * > * AnimatSim::Simulator::ObjectList ( )
virtual

Gets the list of pointers to all objects in the simulation.

Author
dcofer
Date
3/28/2011
Returns
Pointer to list of objects.

Definition at line 390 of file Simulator.cpp.

References m_aryObjectList.

void AnimatSim::Simulator::Paused ( bool  bVal)
virtual

Sets the Paused flag.

This mutator should not called to pause the simulation. If you want to pause the simulation you need to call the PauseSimulation method.

Author
dcofer
Date
3/28/2011
Parameters
bValtrue to value.

Definition at line 360 of file Simulator.cpp.

References m_bPaused.

virtual bool AnimatSim::Simulator::PauseSimulation ( )
pure virtual

Pauses the simulation.

Author
dcofer
Date
3/28/2011
Returns
true if it succeeds, false if it fails.

Implemented in VortexAnimatSim::VsSimulator, OsgAnimatSim::OsgSimulator, and RoboticsAnimatSim::RbSimulator.

Referenced by CheckEndSimulationTime().

+ Here is the caller graph for this function:

long AnimatSim::Simulator::PhysicsSliceCount ( )
virtual

Gets the physics time slice count.

Author
dcofer
Date
3/28/2011
Returns
Physics time slice count.

Definition at line 633 of file Simulator.cpp.

References m_lPhysicsSliceCount.

void AnimatSim::Simulator::PhysicsSliceCount ( long  lVal)
virtual

Sets the physics time slice count.

Author
dcofer
Date
3/28/2011
Parameters
lValThe new value.

Definition at line 643 of file Simulator.cpp.

References m_lPhysicsSliceCount.

long AnimatSim::Simulator::PhysicsStepCount ( )
virtual

Gets the physics step count.

This is a counter that keeps track of how many time slices have occured since the StepSimulation method started. We use this to know how many more slices to go until the physics engine steps.

Author
dcofer
Date
3/28/2011
Returns
Physisc step count variable.

Definition at line 1176 of file Simulator.cpp.

References m_iPhysicsStepCount.

Referenced by VortexAnimatSim::ExternalStimuli::VsMotorVelocityStimulus::StepSimulation(), AnimatSim::ExternalStimuli::MotorStimulus::StepSimulation(), AnimatSim::ExternalStimuli::PropertyControlStimulus::StepSimulation(), and AnimatSim::ExternalStimuli::ForceStimulus::StepSimulation().

+ Here is the caller graph for this function:

short AnimatSim::Simulator::PhysicsStepInterval ( )
virtual

Gets the physics step interval.

This is the physics time step divided by the m_fltTimeStep. m_fltTimeStep is the smallest integration time step in the system. So this is how many total time slices occur between each iteration of the physics engine.

Author
dcofer
Date
3/28/2011
Returns
Physics step interval.

Definition at line 1097 of file Simulator.cpp.

References m_iPhysicsStepInterval.

Referenced by PhysicsTimeStep(), VortexAnimatSim::ExternalStimuli::VsMotorVelocityStimulus::StepSimulation(), AnimatSim::ExternalStimuli::MotorStimulus::StepSimulation(), AnimatSim::ExternalStimuli::PropertyControlStimulus::StepSimulation(), and AnimatSim::ExternalStimuli::ForceStimulus::StepSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::PhysicsStepInterval ( short  iVal)
virtual

Sets the physics step interval.

This is the physics time step divided by the m_fltTimeStep. m_fltTimeStep is the smallest integration time step in the system. So this is how many total time slices occur between each iteration of the physics engine.

Author
dcofer
Date
3/28/2011
Parameters
iValThe new value.

Definition at line 1111 of file Simulator.cpp.

References m_iPhysicsStepInterval, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

void AnimatSim::Simulator::PhysicsSubsteps ( int  iVal)
virtual

This is used only for the bullet physics engine. It allows the user to specify how many substeps should be made for the physics time step specified. This allows you to keep the overall physics time step you wanted but subdivide it more finely if that is required. However, The larger this number the slower your simulation will run.

Author
David Cofer
Date
1/9/2014
Parameters
iValNew substeps greater than 0.

Definition at line 1189 of file Simulator.cpp.

References m_fltPhysicsSubstepTime, m_fltPhysicsTimeStep, m_iPhysicsSubsteps, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

int AnimatSim::Simulator::PhysicsSubsteps ( )
virtual

Gets the physics substeps.

Author
David Cofer
Date
1/9/2014
Returns
physics substep count.

Definition at line 1205 of file Simulator.cpp.

References m_iPhysicsSubsteps.

Referenced by SetData().

+ Here is the caller graph for this function:

float AnimatSim::Simulator::PhysicsSubstepTime ( )
virtual

Gets the physics substep time.

Author
David Cofer
Date
1/9/2014
Returns
gets the time size of the substep: TimeStep/iPhysicsSubteps.

Definition at line 1215 of file Simulator.cpp.

References m_fltPhysicsSubstepTime.

float AnimatSim::Simulator::PhysicsTimeStep ( )
virtual

Gets the integration time step for the physics engine.

Author
dcofer
Date
3/28/2011
Returns
Physics time step.

Definition at line 1163 of file Simulator.cpp.

References m_fltPhysicsTimeStep.

Referenced by InitializeStructures(), and SetData().

+ Here is the caller graph for this function:

int AnimatSim::Simulator::PlaybackControlMode ( )
virtual

Gets the playback control mode.

The follow playback control modes are supported.

  1. Fastest possible: In this mode no time delay is added to the playback at all. The physics and neural engines are stepped as fast as they possibly can. However, this can lead to simulations that go too fast to see easily, and as parts of the simulation because more complex with a larger number of collisions the playback rate will slow down and then speed up again.
  2. Match Physics time step: In this mode the physics and neural engines will be stepped to the next physics time step, and then any remaining real time left over will be used to delay the simulation to match that value. This mode attempts to playback the simulation in real time. If there is no time left over then it does not add any time to the playback.
  3. Use Preset Value: This mode is the same as the physics time step, except it attempts to match a preset playback time step.
Author
dcofer
Date
3/2/2011

Definition at line 1559 of file Simulator.cpp.

References m_iPlaybackControlMode.

Referenced by Load(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::PlaybackControlMode ( int  iMode)
virtual

Sets the playback control mode.

The follow playback control modes are supported.

  1. Fastest possible: In this mode no time delay is added to the playback at all. The physics and neural engines are stepped as fast as they possibly can. However, this can lead to simulations that go too fast to see easily, and as parts of the simulation because more complex with a larger number of collisions the playback rate will slow down and then speed up again.
  2. Match Physics time step: In this mode the physics and neural engines will be stepped to the next physics time step, and then any remaining real time left over will be used to delay the simulation to match that value. This mode attempts to playback the simulation in real time. If there is no time left over then it does not add any time to the playback.
  3. Use Preset Value: This mode is the same as the physics time step, except it attempts to match a preset playback time step.
Author
dcofer
Date
3/2/2011
Parameters
iModeThe playback mode to use.

Definition at line 1585 of file Simulator.cpp.

References m_iPlaybackControlMode.

float AnimatSim::Simulator::PresetPlaybackTimeStep ( )
virtual

Gets the preset playback time step.

If the playback control mode is set to use a preset value for the playback time step then this is the time step used.

Author
dcofer
Date
3/2/2011

Definition at line 1603 of file Simulator.cpp.

References m_fltPresetPlaybackTimeStep.

Referenced by Load(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::PresetPlaybackTimeStep ( float  fltTimeStep)
virtual

Sets the preset playback time step in milliseconds.

If the playback control mode is set to use a preset value for the playback time step then this is the time step used.

Author
dcofer
Date
3/2/2011
Parameters
lTimeStepThe time step to use.

Definition at line 1617 of file Simulator.cpp.

References m_fltPresetPlaybackTimeStep.

void AnimatSim::Simulator::ProcessSimulationStep ( )
protectedvirtual

Process the an entire step of the simulation. This includes the simulation portion, video and calculating timing.

Author
dcofer
Date
7/5/2011

Definition at line 2652 of file Simulator.cpp.

References CheckEndSimulationTime(), CheckSimulationBlock(), StdUtils::CStdErrorInfo::m_strError, and StepSimulation().

Referenced by Simulate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string AnimatSim::Simulator::ProjectPath ( )
virtual

Gets the project path.

Author
dcofer
Date
3/28/2011
Returns
Project path.

Definition at line 287 of file Simulator.cpp.

References m_strProjectPath.

Referenced by CreateSimulator(), VortexAnimatSim::VsSimulator::GenerateCollisionMeshFile(), and AnimatSim::Charting::DataChartMgr::LoadDataChart().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::ProjectPath ( std::string  strPath)
virtual

Sets the project path.

Author
dcofer
Date
3/28/2011
Parameters
strPathFull pathname of the project file.

Definition at line 297 of file Simulator.cpp.

References m_strProjectPath.

void AnimatSim::Simulator::QueryProperties ( CStdPtrArray< TypeProperty > &  aryProperties)
virtual

Queries this object for a list of properties that can be changed using SetData.

The method provides a list of the properties that can be set using the SetData method. It gives the property name and the type of data that should be passed to it. Valid date types are Boolean, Float, Integer, and Xml.

Author
dcofer
Date
2/22/2011
Parameters
aryNamesArray list of the property names.
strTypesArray list of the type that is associated with the cooresponding name in the list.
Returns
Nothing.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 4817 of file Simulator.cpp.

References AnimatSim::AnimatBase::QueryProperties().

+ Here is the call graph for this function:

float AnimatSim::Simulator::RealTime ( )
virtual

Returns the real time since the simulation was started.

Author
dcofer
Date
3/28/2011

Definition at line 1082 of file Simulator.cpp.

References m_fltRealTime.

void AnimatSim::Simulator::RecordVideoFrame ( )
protectedvirtual

Record video frame.

Author
dcofer
Date
3/28/2011

Definition at line 5217 of file Simulator.cpp.

Referenced by StepPhysicsEngine().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::RemoveFromObjectList ( AnimatBase lpItem)
virtual

Removes an object from the list of all simulation objects.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpItemPointer to the item to remove.

Definition at line 4084 of file Simulator.cpp.

References FindByID(), AnimatSim::AnimatBase::ID(), and m_aryObjectList.

Referenced by AnimatSim::AnimatBase::~AnimatBase().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Simulator::RemoveItem ( const std::string &  strItemType,
const std::string &  strID,
bool  bThrowError = true 
)
virtual

Removes a child item from this parent.

This is a generic method that is used to delete a child object from this parent. The GUI uses this method to remove objects from the simulation that have been deleted in the UI. The item type lets the method determine what type of item is being deleted, like synapse, neuron, body part, etc.. The ID is then used to delete that specific item.

Author
dcofer
Date
2/22/2011
Parameters
strItemTypeString descriptor of the type of item that is being created.
strIDUnique ID of the item that will be removed.
bThrowErrorIf true then throw an error if there is a problem, otherwise return false.
Returns
true if it succeeds, false if it fails.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 4916 of file Simulator.cpp.

References m_oDataChartMgr, m_oExternalStimuliMgr, m_oLightMgr, m_oMaterialMgr, AnimatSim::Charting::DataChartMgr::RemoveDataChart(), AnimatSim::Environment::Materials::RemoveItem(), AnimatSim::Environment::LightManager::RemoveItem(), RemoveOrganism(), RemoveScript(), AnimatSim::ExternalStimuli::ExternalStimuliMgr::RemoveStimulus(), RemoveStructure(), and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

void AnimatSim::Simulator::RemoveKeyFrame ( std::string  strID)
virtual

Removes the key frame described by strID.

Author
dcofer
Date
3/28/2011
Parameters
strIDGUID ID for the key frame.

Definition at line 5090 of file Simulator.cpp.

References m_lpSimRecorder, and AnimatSim::ActivatedItemMgr::Remove().

+ Here is the call graph for this function:

void AnimatSim::Simulator::RemoveOrganism ( std::string  strID,
bool  bThrowError = true 
)
protectedvirtual

Removes an organism by its ID.

This is primarily used by the GUI to remove an organism from the simulation.

Author
dcofer
Date
3/28/2011
Parameters
strIDGUID ID of the organism to remove.
bThrowErrortrue to throw error if the organism is not found.

Definition at line 4404 of file Simulator.cpp.

References m_aryAllStructures, and m_aryOrganisms.

Referenced by RemoveItem().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::RemoveScript ( std::string  strID,
bool  bThrowError = true 
)
protectedvirtual

Removes the script based on ID.

This is primarily used by the GUI to remove the script from the structure when the user does this in the GUI.

Author
dcofer
Date
5/23/2014
Parameters
strIDGUI ID of the script to remove
bThrowErrorIf true then throw an error if there is a problem, otherwise return false
Returns
true if it succeeds, false if it fails.

Definition at line 4566 of file Simulator.cpp.

References AnimatSim::AnimatBase::ID().

Referenced by RemoveItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::RemoveStructure ( std::string  strID,
bool  bThrowError = true 
)
protectedvirtual

Removes a structure by its ID.

This is primarily used by the GUI to remove a structure from the simulation.

Author
dcofer
Date
3/28/2011
Parameters
strIDIdentifier for the structure.
bThrowErrortrue to throw error if the structure is not found.

Definition at line 4460 of file Simulator.cpp.

References m_aryAllStructures, and m_aryStructures.

Referenced by RemoveItem().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::Reset ( )
virtual

Resets all objects of the simulation to their unloaded state.

Use this function to completely reset a simulation to its initial default settings. This will destroy all organisms and strcutres defined within the simulation

Author
dcofer
Date
3/28/2011

Reimplemented from AnimatSim::AnimatBase.

Reimplemented in VortexAnimatSim::VsSimulator, OsgAnimatSim::OsgSimulator, and RoboticsAnimatSim::RbSimulator.

Definition at line 2141 of file Simulator.cpp.

References AnimatSim::SimulationWindowMgr::Close(), m_aryAllStructures, m_aryExtraDataParts, m_aryFoodSources, m_aryNeuralModuleFactories, m_aryOdorTypes, m_aryOrganisms, m_arySourcePhysicsAdapters, m_aryStructures, m_aryTargetPhysicsAdapters, m_bEnableSimRecording, m_bForceFastMoving, m_bInitialized, m_bPaused, m_bRecordVideo, m_bRobotAdpaterSynch, m_bShuttingDown, m_bSimRunning, m_bSimulateHydrodynamics, m_bSteppingSim, m_fltActualFrameRate, m_fltAngularCompliance, m_fltAngularDamping, m_fltAngularKineticLoss, m_fltDataChartStepTime, m_fltDenominatorDistanceUnits, m_fltDesiredFrameStep, m_fltDisplayMassUnits, m_fltDistanceUnits, m_fltEndSimTime, m_fltExternalStimuliStepTime, m_fltGravity, m_fltInverseDistanceUnits, m_fltInverseMassUnits, m_fltLinearCompliance, m_fltLinearDamping, m_fltLinearKineticLoss, m_fltMassUnits, m_fltMouseSpringDampingForceMagnitude, m_fltMouseSpringForceMagnitude, m_fltMouseSpringLengthMagnitude, m_fltMouseSpringStiffness, m_fltPhysicsStepTime, m_fltPhysicsSubstepTime, m_fltPhysicsTimeStep, m_fltPlaybackAdditionRealTimeToStep, m_fltPresetPlaybackTimeStep, m_fltPrevPhysicsStepTime, m_fltPrevTotalRealTimeForStep, m_fltRealTime, m_fltRemainingStepTime, m_fltSimRecorderStepTime, m_fltSimulationRealTimeToStep, m_fltStabilityScale, m_fltTime, m_fltTimeStep, m_fltTotalMicroSleepCount, m_fltTotalMicroSleepTime, m_fltTotalMicroWaitCount, m_fltTotalMicroWaitTime, m_fltTotalNeuralStepTime, m_fltTotalRealTimeForStep, m_fltTotalRealTimeForStepSmooth, m_fltVideoEndTime, m_fltVideoPlaybackFrameTime, m_fltVideoRecordFrameTime, m_fltVideoStartTime, m_ftlMouseSpringDamping, m_iDesiredFrameRate, m_iExtraDataCount, m_iPhysicsBodyCount, m_iPhysicsStepCount, m_iPhysicsStepInterval, m_iPhysicsSubsteps, m_iPlaybackControlMode, m_iTargetAdapterCount, m_iVideoLoops, m_iVideoStepSize, m_lpAnimatClassFactory, m_lPhysicsSliceCount, m_lpSelOrganism, m_lpSelStructure, m_lpSimCallback, m_lpSimRecorder, m_lpSimStopPoint, m_lpVideoPlayback, m_lpVideoRecorder, m_lpWinMgr, m_lSnapshotByteSize, m_lTimeSlice, m_lVideoEndSlice, m_lVideoFrame, m_lVideoSliceCount, m_lVideoStartSlice, m_oDataChartMgr, m_oExternalStimuliMgr, m_oLightMgr, m_oMaterialMgr, m_strVideoFilename, AnimatSim::Environment::Materials::Reset(), AnimatSim::ActivatedItemMgr::Reset(), and AnimatSim::AnimatBase::Reset().

Referenced by Load().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::ResetSimulationTimingParams ( )
protectedvirtual

Resets the variables that are used to keep track of the time that each component of the time step takes to execute.

Author
dcofer

Definition at line 2582 of file Simulator.cpp.

References m_fltDataChartStepTime, m_fltExternalStimuliStepTime, m_fltPhysicsStepTime, m_fltPrevPhysicsStepTime, m_fltRemainingStepTime, m_fltSimRecorderStepTime, and m_fltTotalNeuralStepTime.

Referenced by StepSimulation().

+ Here is the caller graph for this function:

bool AnimatSim::Simulator::RobotAdpaterSynch ( )
virtual

Gets whether we need to synch the physics adapters in a simulation to the robot physics time step.

Author
dcofer
Date
5/13/2014
Returns
Whether we need to synch or not.

Definition at line 1645 of file Simulator.cpp.

References m_bRobotAdpaterSynch.

Referenced by AnimatSim::Adapters::Adapter::StepSimulation(), and AnimatSim::Robotics::RobotInterface::SynchSim().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::RobotAdpaterSynch ( bool  bVal)
virtual

Sets whether we need to synch the physics adapters in a simulation to the robot physics time step.

Author
dcofer
Date
5/13/2014
Parameters
bValnew value.

Definition at line 1655 of file Simulator.cpp.

References m_bRobotAdpaterSynch.

void AnimatSim::Simulator::RunSimulation ( )
virtual

Runs the simulation.

This is different from the Simulate method. This is used when the AnimatSimulator is running standalone. It Loads the simulation from the specified file, initailizes it, and the calls Simulate.

Author
dcofer
Date
3/28/2011

This is primarily used when running the simulation in stand-alone mode. It loads the project file, initializes the simulation, and the calls Simulate.

Author
dcofer
Date
3/28/2011

Definition at line 2702 of file Simulator.cpp.

References Initialize(), Load(), Simulate(), and SimulationFile().

+ Here is the call graph for this function:

void AnimatSim::Simulator::Save ( std::string  strFilename)
virtual

Saves the simulation file.

Author
dcofer
Date
3/28/2011
Parameters
strFilenameThe std::string to save.

Reimplemented in VortexAnimatSim::VsSimulator, and OsgAnimatSim::OsgSimulator.

Definition at line 2965 of file Simulator.cpp.

void AnimatSim::Simulator::SaveKeyFrameSnapshot ( byte *  aryBytes,
long &  lIndex 
)
virtual

Saves a key frame snapshot.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]aryBytesArray of bytes for the snapshot.
[in,out]lIndexIndex into the byte array.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 5180 of file Simulator.cpp.

References m_aryAllStructures, and AnimatSim::Environment::Structure::SaveKeyFrameSnapshot().

+ Here is the call graph for this function:

void AnimatSim::Simulator::SaveVideo ( std::string  strPath)
virtual

Saves a video.

Author
dcofer
Date
3/28/2011
Parameters
strPathFull pathname of the string file.

Definition at line 5052 of file Simulator.cpp.

References m_lpSimRecorder, m_lpVideoPlayback, and AnimatSim::Recording::KeyFrame::SaveVideo().

+ Here is the call graph for this function:

bool AnimatSim::Simulator::SetData ( const std::string &  strDataType,
const std::string &  strValue,
bool  bThrowError = true 
)
virtual

Set a variable based on a string data type name.

This is a generic method that can be used to set any variable in an AnimatBase object by specifying the name of the variable and a string representation of that data. The GUI uses this method to set data into variables in the simulation when the user changes them in the UI. The value string can be as simple as a float or int, or as complex as an xml packet. It is the developers responsibilty to know what type of data is needed and to process it accordingly.

Author
dcofer
Date
2/22/2011
Parameters
strDataTypestring name of the data type to set.
strValueThe string value of the data. It is up to the developer to determine what this should be. For example, in most cases it is simply a float and you just have to convert it to a float and make the appropriate mutator method call. However, it can be any type of string, including an entire xml packet. It is the developers responsibility to know how to set and process the data as required.
bThrowErrortrue to throw error if there is a problem. If false then it will not return an error, just return false.
Returns
true if it succeeds, false if it fails.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 4636 of file Simulator.cpp.

References StdUtils::CStdColor::a(), AddBodiesMode(), AngularCompliance(), AngularDamping(), AngularKineticLoss(), AutoGenerateRandomSeed(), StdUtils::CStdColor::b(), BackgroundColor(), DesiredFrameRate(), DistanceUnits(), EndSimTime(), ForceFastMoving(), StdUtils::CStdColor::g(), Gravity(), LinearCompliance(), LinearDamping(), LinearKineticLoss(), m_vBackgroundColor, ManualRandomSeed(), MassUnits(), MouseSpringDamping(), MouseSpringStiffness(), NotifyTimeStepModified(), PhysicsSubsteps(), PhysicsTimeStep(), PlaybackControlMode(), PresetPlaybackTimeStep(), StdUtils::CStdColor::r(), SetEndSimTime(), SimulateHydrodynamics(), StabilityScale(), StdUtils::Std_CheckString(), StdUtils::Std_ToBool(), and VisualSelectionMode().

bool AnimatSim::Simulator::SetEndSimTime ( )
virtual

Gets whether to use the set simulation end time.

Author
dcofer
Date
3/28/2011
Returns
true to use the sim end time, false else.

Definition at line 962 of file Simulator.cpp.

References m_bSetEndSim.

Referenced by Load(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::SetEndSimTime ( bool  bVal)
virtual

Sets whether to use the simulation end time.

Author
dcofer
Date
3/28/2011
Parameters
bValtrue to use simulation end time.

Definition at line 972 of file Simulator.cpp.

References m_bSetEndSim.

virtual void AnimatSim::Simulator::ShutdownSimulation ( )
pure virtual

Shuts down the simulation.

Author
dcofer
Date
3/28/2011

Implemented in VortexAnimatSim::VsSimulator, OsgAnimatSim::OsgSimulator, and RoboticsAnimatSim::RbSimulator.

Referenced by CheckEndSimulationTime().

+ Here is the caller graph for this function:

bool AnimatSim::Simulator::ShuttingDown ( )
virtual

Tells whether the simulation is shutting down or not.

This is used by other objects in their destructor to determine whether to make certain calls or not.

Author
dcofer
Date
9/25/2011
Returns
true if it shutting down, false otherwise.

Definition at line 685 of file Simulator.cpp.

References m_bShuttingDown.

Referenced by AnimatSim::Environment::RigidBody::~RigidBody().

+ Here is the caller graph for this function:

ISimGUICallback * AnimatSim::Simulator::SimCallback ( )
virtual

Calback object from the simulation.

This class allows the simulation to make callbacks to the GUI.

Author
dcofer
Date
3/28/2011
Returns
NULL if running standalone simulation, else a pointer to the callback object.

Definition at line 525 of file Simulator.cpp.

References m_lpSimCallback.

void AnimatSim::Simulator::SimCallBack ( ISimGUICallback lpCallback)
virtual

Sets the calback object from the simulation.

This class allows the simulation to make callbacks to the GUI.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpCallbackPointer to a callback.

Definition at line 537 of file Simulator.cpp.

References m_lpSimCallback.

void AnimatSim::Simulator::SimPausing ( )
protectedvirtual

Simulation pausing event.

This method is called on all objects when the simulation begins pausing. It is to let the objects know about this event so they can do any pre-processing required before the simulation pauses.

Author
dcofer
Date
3/28/2011

Reimplemented from AnimatSim::AnimatBase.

Definition at line 2739 of file Simulator.cpp.

References m_aryObjectList, and AnimatSim::AnimatBase::SimPausing().

Referenced by RoboticsAnimatSim::RbSimulator::PauseSimulation(), OsgAnimatSim::OsgSimulator::PauseSimulation(), VortexAnimatSim::VsSimulator::PauseSimulation(), RoboticsAnimatSim::RbSimulator::ToggleSimulation(), OsgAnimatSim::OsgSimulator::ToggleSimulation(), and VortexAnimatSim::VsSimulator::ToggleSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::SimStarting ( )
protectedvirtual

Simulation starting event.

This method is called on all objects when the simulation begins starting. It is to let the objects know about this event so they can do any pre-processing required before the simulation starts.

Author
dcofer
Date
3/28/2011

Reimplemented from AnimatSim::AnimatBase.

Definition at line 2718 of file Simulator.cpp.

References m_aryObjectList, and AnimatSim::AnimatBase::SimStarting().

Referenced by RoboticsAnimatSim::RbSimulator::StartSimulation(), OsgAnimatSim::OsgSimulator::StartSimulation(), VortexAnimatSim::VsSimulator::StartSimulation(), RoboticsAnimatSim::RbSimulator::ToggleSimulation(), OsgAnimatSim::OsgSimulator::ToggleSimulation(), and VortexAnimatSim::VsSimulator::ToggleSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::SimStopping ( )
protectedvirtual

Simulation stopping event.

This method is called on all objects when the simulation begins stopping. It is to let the objects know about this event so they can do any pre-processing required before the simulation stops.

Author
dcofer
Date
3/28/2011

Reimplemented from AnimatSim::AnimatBase.

Definition at line 2760 of file Simulator.cpp.

References m_aryObjectList, m_fltTime, and AnimatSim::AnimatBase::SimStopping().

Referenced by RoboticsAnimatSim::RbSimulator::ShutdownSimulation(), OsgAnimatSim::OsgSimulator::ShutdownSimulation(), VortexAnimatSim::VsSimulator::ShutdownSimulation(), RoboticsAnimatSim::RbSimulator::StopSimulation(), OsgAnimatSim::OsgSimulator::StopSimulation(), and VortexAnimatSim::VsSimulator::StopSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::Simulate ( )
virtual

Simulates the system.

This starts the simulation running. This method does not return until the simulation has been stopped. It is a blocking call. It loops through and calls the Step method repeatedly.

Author
dcofer
Date
3/28/2011

Definition at line 2680 of file Simulator.cpp.

References m_bForceSimulationStop, m_bStopSimulation, ProcessSimulationStep(), SimulateBegin(), and SimulateEnd().

Referenced by RunSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::SimulateBegin ( )
protectedvirtual

Called at the beginning of the Simulate method.

Author
dcofer
Date
7/5/2011

Definition at line 2622 of file Simulator.cpp.

References m_bSteppingSim, m_lLastTickTaken, m_lStartSimTick, m_lStepSimEndTick, m_lStepStartTick, and m_lVideoFrameStartTick.

Referenced by Simulate().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::SimulateEnd ( )
protectedvirtual

Called at the end of the Simulate method.

Author
dcofer
Date
7/5/2011

Reimplemented in VortexAnimatSim::VsSimulator, and RoboticsAnimatSim::RbSimulator.

Definition at line 2642 of file Simulator.cpp.

Referenced by Simulate().

+ Here is the caller graph for this function:

bool AnimatSim::Simulator::SimulateHydrodynamics ( )
virtual

Gets whether the simulation uses hydrodynamics.

Tells whether or not we will be doing hydrodynamic simulations. If you are not doing stuff underwater then be sure this is set to false. The hydrodynamics adds extra overhead that can slow the simulation down slightly.

Author
dcofer
Date
3/28/2011
Returns
true if it uses hydrodynamics, false else.

Definition at line 1402 of file Simulator.cpp.

References m_bSimulateHydrodynamics.

Referenced by LoadEnvironment(), SetData(), and AnimatSim::Environment::RigidBody::StepSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::SimulateHydrodynamics ( bool  bVal)
virtual

Sets whether the simulation uses hydrodynamics.

Tells whether or not we will be doing hydrodynamic simulations. If you are not doing stuff underwater then be sure this is set to false. The hydrodynamics adds extra overhead that can slow the simulation down slightly.

Author
dcofer
Date
3/28/2011
Parameters
bValtrue use hydrodynamics.

Definition at line 1417 of file Simulator.cpp.

References m_bSimulateHydrodynamics.

bool AnimatSim::Simulator::SimulationBlockConfirm ( )
virtual

Confirms that the simulation has been blocked.

The simulation and GUI are running in multi-threaded environment. When we make changes to the simulation from the GUI we need to block processing of the simulation thread while we make those changes to prevent memory corruption. This method tells whether the simulation has been blocked.

Author
dcofer
Date
3/28/2011
Returns
true if it is blocked, false else.

Definition at line 2062 of file Simulator.cpp.

References m_bSimBlockConfirm.

std::string AnimatSim::Simulator::SimulationFile ( )
virtual

Gets the simulation filename.

Author
dcofer
Date
3/28/2011
Returns
Simulation filename.

Definition at line 327 of file Simulator.cpp.

References m_strSimulationFile.

Referenced by CreateSimulator(), and RunSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::SimulationFile ( std::string  strFile)
virtual

Sets the simulation filename.

Author
dcofer
Date
3/28/2011
Parameters
strFileThe simulation filename.

Definition at line 337 of file Simulator.cpp.

References m_strSimulationFile.

long AnimatSim::Simulator::SliceToMillisecond ( long  lSlice)
virtual

Calculates the number of milliseconds from a supplied number of time slices.

Author
dcofer
Date
3/28/2011
Parameters
lSliceThe time slices to convert.
Returns
Number of milliseconds.

Definition at line 593 of file Simulator.cpp.

References m_fltTimeStep.

long AnimatSim::Simulator::SnapshotByteSize ( )
virtual

Gets the snapshot byte size.

Author
dcofer
Date
3/28/2011
Returns
snapshot byte size.

Definition at line 1891 of file Simulator.cpp.

References m_lSnapshotByteSize.

virtual void AnimatSim::Simulator::SnapshotStopFrame ( )
protectedpure virtual

Takes a snapshot of the current frame.

Author
dcofer
Date
3/28/2011

Implemented in VortexAnimatSim::VsSimulator, OsgAnimatSim::OsgSimulator, and RoboticsAnimatSim::RbSimulator.

float AnimatSim::Simulator::StabilityScale ( )
virtual

Sets the linear scaling factor that controls the simulation stability parameters.

Author
dcofer
Date
1/2/2012
Returns
scale factor.

Definition at line 755 of file Simulator.cpp.

References m_fltStabilityScale.

Referenced by LoadEnvironment(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::StabilityScale ( float  fltVal)
virtual

Sets the linear scaling factor that controls the simulation stability parameters.

Author
dcofer
Date
1/2/2012
Parameters
fltValScale factor.

Reimplemented in VortexAnimatSim::VsSimulator.

Definition at line 765 of file Simulator.cpp.

References m_fltStabilityScale.

unsigned long long AnimatSim::Simulator::StartSimTick ( )
virtual

The time slice tick at which the simulation start.

Author
dcofer
Date
3/28/2011
Returns
tick when the simulation begins.

Definition at line 603 of file Simulator.cpp.

References m_lStartSimTick.

virtual bool AnimatSim::Simulator::StartSimulation ( )
pure virtual

Starts the simulation.

Author
dcofer
Date
3/28/2011
Returns
true if it succeeds, false if it fails.

Implemented in VortexAnimatSim::VsSimulator, OsgAnimatSim::OsgSimulator, and RoboticsAnimatSim::RbSimulator.

void AnimatSim::Simulator::StartVideoPlayback ( )
virtual

Starts a video playback.

Author
dcofer
Date
3/28/2011

Definition at line 5003 of file Simulator.cpp.

References m_lpSimRecorder, m_lpVideoPlayback, and AnimatSim::Recording::KeyFrame::StartVideoPlayback().

+ Here is the call graph for this function:

void AnimatSim::Simulator::Step ( )
protectedvirtual

Steps the simulation forward by one time slice.

Author
dcofer
Date
3/28/2011

Definition at line 2557 of file Simulator.cpp.

References m_fltTime, m_fltTimeStep, m_iPhysicsStepCount, m_iPhysicsStepInterval, m_lpSimRecorder, m_lTimeSlice, StepNeuralEngine(), and StepPhysicsEngine().

Referenced by StepSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::StepNeuralEngine ( )
protectedvirtual

Step the neural engine of each organism.

Author
dcofer
Date
3/28/2011

Definition at line 2449 of file Simulator.cpp.

References m_aryOrganisms, m_fltTotalNeuralStepTime, m_lpSelOrganism, m_oOrganismIterator, and AnimatSim::Environment::Organism::StepNeuralEngine().

Referenced by Step().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::StepPhysicsEngine ( )
protectedvirtual

Calls StepPhysicsEngine of all structures.

Author
dcofer
Date
3/28/2011

Definition at line 2498 of file Simulator.cpp.

References m_aryAllStructures, m_aryTargetPhysicsAdapters, m_bRecordVideo, m_fltPhysicsStepTime, m_iTargetAdapterCount, m_lPhysicsSliceCount, m_lpSelStructure, m_oStructureIterator, RecordVideoFrame(), AnimatSim::Environment::Structure::StepPhysicsEngine(), and StepSimulation().

Referenced by Step().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::StepSimulation ( )
protectedvirtual

Steps the entire simulation forward by one physics integration time step.

This method steps the entire simulation forward by one physics time step. Remember that there are typically multiple neural steps for a given physcis step, so this will step the simulation as a whole several times for a given physics time step. It goes through and calls StepSimulation for every structure/organism object, which in turn calls StepSimulation for each rigid body and joint of each of those objects. So you need to be VERY careful to keep all code within the StepSimulation methods short, sweet, and very fast. They are in the main processing loop and even a small increase in the amount of processing time that occurrs within this loop will lead to major impacts on the ultimate performance of the system.

Author
dcofer
Date
3/28/2011

Reimplemented from AnimatSim::AnimatBase.

Reimplemented in VortexAnimatSim::VsSimulator, and RoboticsAnimatSim::RbSimulator.

Definition at line 2609 of file Simulator.cpp.

References m_iPhysicsStepCount, m_iPhysicsStepInterval, ResetSimulationTimingParams(), and Step().

Referenced by ProcessSimulationStep(), and StepPhysicsEngine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Simulator::StepVideoPlayback ( int  iFrameCount = 1)
virtual

Step video playback.

Author
dcofer
Date
3/28/2011
Parameters
iFrameCountNumber of frames.

Definition at line 5035 of file Simulator.cpp.

References m_lpSimRecorder, m_lpVideoPlayback, and AnimatSim::Recording::KeyFrame::StepVideoPlayback().

+ Here is the call graph for this function:

bool AnimatSim::Simulator::Stopped ( )
virtual

Tells if the simulation has been stopped.

Author
dcofer
Date
3/28/2011
Returns
true if it is stopped, false else.

Definition at line 1034 of file Simulator.cpp.

References m_bForceSimulationStop, and m_bStopSimulation.

virtual void AnimatSim::Simulator::StopSimulation ( )
pure virtual

Stops the simulation and resets it.

Author
dcofer
Date
3/28/2011

Implemented in VortexAnimatSim::VsSimulator, OsgAnimatSim::OsgSimulator, and RoboticsAnimatSim::RbSimulator.

void AnimatSim::Simulator::StopVideoPlayback ( )
virtual

Stop video playback.

Author
dcofer
Date
3/28/2011

Definition at line 5018 of file Simulator.cpp.

References m_lpSimRecorder, m_lpVideoPlayback, and AnimatSim::Recording::KeyFrame::StopVideoPlayback().

+ Here is the call graph for this function:

void AnimatSim::Simulator::TimeSlice ( long  lVal)
virtual

Sets the current time slice.

Author
dcofer
Date
3/28/2011
Parameters
lValThe new value.

Definition at line 623 of file Simulator.cpp.

References m_lTimeSlice.

virtual void AnimatSim::Simulator::ToggleSimulation ( )
pure virtual

Toggles the simulation between running and paused.

Author
dcofer
Date
3/28/2011

Implemented in VortexAnimatSim::VsSimulator, OsgAnimatSim::OsgSimulator, and RoboticsAnimatSim::RbSimulator.

void AnimatSim::Simulator::UnblockSimulation ( )
virtual

Unblock simulation.

The simulation and GUI are running in multi-threaded environment. When we make changes to the simulation from the GUI we need to block processing of the simulation thread while we make those changes to prevent memory corruption. This method unblocks the simulation to allow processing to resume.

Author
dcofer
Date
3/28/2011

Definition at line 2048 of file Simulator.cpp.

References m_bBlockSimulation, and m_bSimBlockConfirm.

int AnimatSim::Simulator::VideoLoops ( )
virtual

Gets the video loops.

Author
dcofer
Date
3/28/2011
Returns
video loops.

Definition at line 1844 of file Simulator.cpp.

References m_iVideoLoops.

void AnimatSim::Simulator::VideoLoops ( int  iVal)
virtual

Sets the video loops.

Author
dcofer
Date
3/28/2011
Parameters
iValThe new value.

Definition at line 1854 of file Simulator.cpp.

References m_iVideoLoops.

KeyFrame * AnimatSim::Simulator::VideoPlayback ( )
virtual

Gets the video playback frame.

Author
dcofer
Date
3/28/2011
Returns
Pointer to the video playback frame.

Definition at line 1860 of file Simulator.cpp.

References m_lpVideoPlayback.

virtual void AnimatSim::Simulator::VideoPlayback ( KeyFrame *  lpFrame)
virtual

Sets the video playback frame.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpFramePointer to the video playback frame.
KeyFrame * AnimatSim::Simulator::VideoRecorder ( )
virtual

Gets the video recorder.

Author
dcofer
Date
3/28/2011
Returns
Pointer to the video recorder.

Definition at line 1857 of file Simulator.cpp.

References m_lpVideoRecorder.

virtual void AnimatSim::Simulator::VideoRecorder ( KeyFrame *  lpFrame)
virtual

Sets the video recorder.

Author
dcofer
Date
3/28/2011
Parameters
[in,out]lpFramePointer to a frame.
long AnimatSim::Simulator::VideoSliceCount ( )
virtual

Gets the video slice count.

Author
dcofer
Date
3/28/2011
Returns
video slice count.

Definition at line 1824 of file Simulator.cpp.

References m_lVideoSliceCount.

void AnimatSim::Simulator::VideoSliceCount ( long  lVal)
virtual

Sets the video slice count.

Author
dcofer
Date
3/28/2011
Parameters
lValThe new value.

Definition at line 1834 of file Simulator.cpp.

References m_lVideoSliceCount.

int AnimatSim::Simulator::VisualSelectionMode ( )
virtual

Gets the visual selection mode.

Author
dcofer
Date
3/28/2011
Returns
Visual selection mode.

Definition at line 460 of file Simulator.cpp.

References m_iSelectionMode.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Simulator::VisualSelectionMode ( int  iVal)
virtual

Sets the visual selection mode.

This loops through all ojects in the simulation and calls VisualSelectionModeChanged to let it know when the selection mode has changed in the GUI.

Author
dcofer
Date
3/28/2011
Parameters
iValThe new value.

Definition at line 473 of file Simulator.cpp.

References m_aryObjectList, m_iSelectionMode, and AnimatSim::AnimatBase::VisualSelectionModeChanged().

+ Here is the call graph for this function:

bool AnimatSim::Simulator::WaitForSimulationBlock ( long  lTimeout = 6000)
virtual

Wait for simulation block.

The simulation and GUI are running in multi-threaded environment. When we make changes to the simulation from the GUI we need to block processing of the simulation thread while we make those changes to prevent memory corruption. This method sets the block simulation variable to true, and then waits until the simulation block is confirmed or a timeout occurs.

Author
dcofer
Date
3/28/2011
Parameters
lTimeoutThe timeout period in time slices.
Returns
true if it succeeds in getting the simulation block, false if it fails.

Definition at line 2079 of file Simulator.cpp.

References m_bBlockSimulation, m_bSimBlockConfirm, and m_bSteppingSim.

Member Data Documentation

CStdMap<std::string, Structure *> AnimatSim::Simulator::m_aryAllStructures
protected

A list of all structures, both regular structures and organisms. This is a reference list.

Definition at line 59 of file Simulator.h.

Referenced by CalculateSnapshotByteSize(), FindStructureFromAll(), InitializeStructures(), LoadKeyFrameSnapshot(), RemoveOrganism(), RemoveStructure(), Reset(), ResetSimulation(), SaveKeyFrameSnapshot(), StepPhysicsEngine(), and ~Simulator().

CStdArray<BodyPart *> AnimatSim::Simulator::m_aryExtraDataParts
protected

Array of parts that need extra data collected from them. Each part will have its UpdateExtraData method called after all parts have been stepped.

Definition at line 91 of file Simulator.h.

Referenced by AfterStepSimulation(), Reset(), and ~Simulator().

CStdMap<std::string, IStdClassFactory *> AnimatSim::Simulator::m_aryNeuralModuleFactories
protected

A list of class factories for neural modules that have been loaded by any organisms in the environment. Each factory is only added to the list once even if the the same module is loaded seperately for each organism.

Definition at line 71 of file Simulator.h.

Referenced by FindNeuralModuleFactory(), Reset(), and ~Simulator().

CStdPtrMap<std::string, OdorType> AnimatSim::Simulator::m_aryOdorTypes
protected

A list of all odors in this simulation. This is not a reference list It is an actual list that destroys its objects when the list is destroyed.

Definition at line 63 of file Simulator.h.

Referenced by FindOdorType(), LoadEnvironment(), Reset(), and ~Simulator().

CStdPtrMap<std::string, Organism> AnimatSim::Simulator::m_aryOrganisms
protected

A list of all Organisms in this simulation. This is not a reference list It is an actual list that destroys its objects when the list is destroyed.

Definition at line 50 of file Simulator.h.

Referenced by FindOrganism(), LoadEnvironment(), RemoveOrganism(), Reset(), StepNeuralEngine(), and ~Simulator().

CStdPtrMap<std::string, Structure> AnimatSim::Simulator::m_aryStructures
protected

A list of structures in this simulation that are not organisms. This is not a reference list. It is an actual list that destroys its objects when the list is destroyed.

Definition at line 55 of file Simulator.h.

Referenced by FindStructure(), LoadEnvironment(), RemoveStructure(), Reset(), and ~Simulator().

bool AnimatSim::Simulator::m_bAutoGenerateRandomSeed
protected

Determines whether a random seed is automatically generated when the simulation is initialized, or if a manual seed is used.

Definition at line 287 of file Simulator.h.

Referenced by AutoGenerateRandomSeed(), InitializeRandomNumbers(), LoadEnvironment(), and Simulator().

bool AnimatSim::Simulator::m_bRobotAdpaterSynch
protected

If this has been set to true then we have are in a simulation of a robot and we should only update the physics adapters with the same frequency as would happen in the real robot.

Definition at line 325 of file Simulator.h.

Referenced by Reset(), RobotAdpaterSynch(), and Simulator().

bool AnimatSim::Simulator::m_bSimulateHydrodynamics
protected

Tells whether or not we will be doing hydrodynamic simulations. If you are not doing stuff underwater then be sure this is set to false. The hydrodynamics adds extra overhead that can slow the simulation down slightly.

Definition at line 234 of file Simulator.h.

Referenced by LoadEnvironment(), Reset(), SimulateHydrodynamics(), and Simulator().

float AnimatSim::Simulator::m_fltDenominatorDistanceUnits
protected

For items that use distance unit measures in the denominator we may want to use a differnt scale that that used for the whole app. For example, if we are using a distance scale of decimeters we will want to use centimeters for the density instead. This allows us to do that.

Definition at line 191 of file Simulator.h.

Referenced by DenominatorDistanceUnits(), DistanceUnits(), Reset(), and Simulator().

float AnimatSim::Simulator::m_fltPhysicsSubstepTime
protected

This keeps track of the substep time to use based on the number of substeps specified. This is PhysicsTimeStep/iPhysicsSubteps

Definition at line 248 of file Simulator.h.

Referenced by GetDataPointer(), PhysicsSubsteps(), PhysicsSubstepTime(), PhysicsTimeStep(), Reset(), and Simulator().

float AnimatSim::Simulator::m_fltPlaybackAdditionRealTimeToStep
protected

This is the total number of milliseconds that is added by the playback control to match the desired playback rate. This is a float so that it can easily be reported.

Definition at line 363 of file Simulator.h.

Referenced by GetDataPointer(), Reset(), and Simulator().

float AnimatSim::Simulator::m_fltPresetPlaybackTimeStep
protected

The time step you want to use for playback if the playback control mode is set to a preset value. This value is in milliseconds.

Definition at line 336 of file Simulator.h.

Referenced by Load(), PresetPlaybackTimeStep(), Reset(), and Simulator().

float AnimatSim::Simulator::m_fltPrevPhysicsStepTime
protected

This is the previous time pers step for the physics engine. This time is a weird one. It really gets calculated after we have updated the data in the chart, so we need to use the value from the previous time step to get the real value correctly.

Definition at line 386 of file Simulator.h.

Referenced by GetDataPointer(), Reset(), ResetSimulationTimingParams(), and Simulator().

float AnimatSim::Simulator::m_fltRecFieldSelRadius
protected

The radius of the sphere shown for a receptive field. This is used in the selection code so we can show the selected vertex. It adds a sphere to the part at that vertex coordinate and uses this radius when drawing the sphere.

Definition at line 317 of file Simulator.h.

Referenced by LoadEnvironment(), and Simulator().

float AnimatSim::Simulator::m_fltRemainingStepTime
protected

This is the time left over from subtracting all the calculated times form the total time for the step. This is primarily used for debuggin purposes to make sure that I have not missed anything.

Definition at line 402 of file Simulator.h.

Referenced by GetDataPointer(), Reset(), ResetSimulationTimingParams(), and Simulator().

float AnimatSim::Simulator::m_fltSimulationRealTimeToStep
protected

This is the total number of milliseconds for the simulation processing time. This is a float so that it can easily be reported.

Definition at line 346 of file Simulator.h.

Referenced by GetDataPointer(), Reset(), and Simulator().

int AnimatSim::Simulator::m_iManualRandomSeed
protected

If the AutoGenerateRandomSeed variable is false then this manual seed is used for the random number generator.

Definition at line 291 of file Simulator.h.

Referenced by GenerateAutoSeed(), InitializeRandomNumbers(), LoadEnvironment(), ManualRandomSeed(), and Simulator().

int AnimatSim::Simulator::m_iPhysicsBodyCount
protected

This is the number of physics bodies within the simulation. This is used to setup the presets for the simulation.

Definition at line 321 of file Simulator.h.

Referenced by Reset(), and Simulator().

int AnimatSim::Simulator::m_iPhysicsStepCount
protected

This keeps track of the number of steps since the physics system was last updated. By using this we do not have to do a bunch of divisions at each time step to determine if it is time to update the physics engine.

Definition at line 283 of file Simulator.h.

Referenced by IsPhysicsBeingUpdated(), PhysicsStepCount(), Reset(), ResetSimulation(), Simulator(), Step(), and StepSimulation().

short AnimatSim::Simulator::m_iPhysicsStepInterval
protected

This tells how many time slices occur between each interval where the body physics is updated. There could be multiple neural updates in between one physics update.

Definition at line 275 of file Simulator.h.

Referenced by IsPhysicsBeingUpdated(), PhysicsStepInterval(), PhysicsTimeStep(), Reset(), Simulator(), Step(), and StepSimulation().

int AnimatSim::Simulator::m_iPhysicsSubsteps
protected

This is used only for the bullet physics engine. It allows the user to specify how many substeps should be made for the physics time step specified. This allows you to keep the overall physics time step you wanted but subdivide it more finely if that is required. However, The larger this number the slower your simulation will run.

Definition at line 244 of file Simulator.h.

Referenced by LoadEnvironment(), PhysicsSubsteps(), PhysicsTimeStep(), Reset(), and Simulator().

IStdClassFactory* AnimatSim::Simulator::m_lpAnimatClassFactory
protected

This is a copy of the class factory associated with the animat module. This is the default class factory that is used if no specific module name is specified. If a specific name is given then it looks through the list of modules that were loaded for neural modules. All class factories should have have NO state.

Definition at line 78 of file Simulator.h.

Referenced by CreateObject(), LoadEnvironment(), LoadStructure(), RoboticsAnimatSim::RbSimulator::Reset(), VortexAnimatSim::VsSimulator::Reset(), Reset(), Simulator(), and ~Simulator().

ISimGUICallback* AnimatSim::Simulator::m_lpSimCallback
protected

Pointer to a simulation callback class. This is only set if we are using the GUI. This is set by the managed wrapper to allow us to post callback notifications to the GUI.

Definition at line 131 of file Simulator.h.

Referenced by CheckEndSimulationTime(), Reset(), SimCallback(), SimCallBack(), Simulator(), and ~Simulator().


The documentation for this class was generated from the following files: