VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
metricCollector.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <iostream>
5 #include <fstream>
6 
7 class DtCgf;
8 class DtScenario;
9 class DtLocalObject;
11 
12 // Class which collects metrics on particular objects.
14 {
15 public:
17 
18  virtual ~DtMetricCollector();
19 
20  // A tick callback is installed with the main VRF system to get called each
21  // simulation tick and check the metrics.
22  static void tickCallback(void* usr);
23  virtual void tick();
24 
25  // Callbacks to manage scenario start/end conditions.
26  // The metrics output file is restarted each time a scenario is started.
27  static void postLoadCallback(const DtScenario& scenario, void* usr);
28  virtual void processLoad(const DtScenario& scenario);
29  static void preCloseCallback(void* usr);
30  virtual void processClose();
31 
32  virtual void printLocationAndContacts(const DtLocalObject* entity);
33  virtual void printContact(const DtRwSensorContactInfo* contact);
34 
35 protected:
37  std::ofstream myOutputFile;
39 
40 
41 };
static void preCloseCallback(void *usr)
static void tickCallback(void *usr)
virtual ~DtMetricCollector()
Definition: scenario.h:52
virtual void printContact(const DtRwSensorContactInfo *contact)
DtMetricCollector(DtCgf *cgf)
This class represents the data gathered by a sensor about a particular single sensor contact...
Definition: rwSensorContactInfo.h:68
virtual void processClose()
Definition: metricCollector.h:13
static void postLoadCallback(const DtScenario &scenario, void *usr)
virtual void processLoad(const DtScenario &scenario)
DtCgf * myCgf
Definition: metricCollector.h:36
The top level class of a VR-Forces Simulation Engine, representing a Computer Generated Forces instan...
Definition: cgf.h:147
virtual void tick()
double myLastMetricTime
Definition: metricCollector.h:38
std::ofstream myOutputFile
Definition: metricCollector.h:37
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
virtual void printLocationAndContacts(const DtLocalObject *entity)

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)