BioinstSim  2
 All Classes Functions Variables
featurevector.h
1 #ifndef FEATUREVECTOR_H_
2 #define FEATUREVECTOR_H_
3 
4 /******************************************************************************/
5 /******************************************************************************/
6 
7 class CTestExperiment;
8 
9 /******************************************************************************/
10 /******************************************************************************/
11 
12 #include "common.h"
13 #include "agent.h"
14 #include "simulator.h"
15 
16 //#include "testexperiment.h"
17 
18 #include <string>
19 
20 /******************************************************************************/
21 /******************************************************************************/
22 
23 // the agents with wc in fvs are divided into two (wc on 1 bit), or replicated in both the fvs
24 
25 //#define WILDCARDINFV 1.0
26 //#define WILDCARDINFV 0.5
27 
28 /******************************************************************************/
29 /******************************************************************************/
30 
32 {
33 public:
34  CFeatureVector(CAgent* pc_agent);
35  virtual ~CFeatureVector();
36 
37  static unsigned int NUMBER_OF_FEATURES;
38  static unsigned int NUMBER_OF_FEATURE_VECTORS;
39  static double FEATURE_RANGE;
40 
41  virtual unsigned int GetValue() const;
42  virtual unsigned int GetLength() const;
43 
44  void PrintFeatureDetails();
45 
46  virtual unsigned int SimulationStep();
47 
48  virtual std::string ToString();
49 
50 #ifdef WILDCARDINFV
51  int m_iWildCardBit; // set to -1 if no wildcard bit present in FV
52 #endif
53 
54 protected:
55  virtual void ComputeFeatureValues();
56 
57  CAgent* m_pcAgent;
58  unsigned int m_unValue;
59  unsigned int m_unLength;
60 
61  float* m_pfFeatureValues;
62  int* m_piLastOccuranceEvent;
63  int* m_piLastOccuranceNegEvent;
64 
65  int m_iEventSelectionTimeWindow;
66 
67  double m_fVelocityThreshold;
68  double m_fAccelerationThreshold;
69 
70  double m_tAngularVelocityThreshold;
71  double m_tAngularAccelerationThreshold;
72 
73  double m_fRelativeVelocityMagThreshold;
74  double m_fRelativeVelocityDirThreshold;
75 
76 
77 
78 
79  // keeping track of neighbors in last m_iEventSelectionTimeWindow time-steps
80  unsigned int m_unNbrsCurrQueueIndex;
81 
82  unsigned int m_unSumTimeStepsNbrsRange0to3;
83  unsigned int m_unSumTimeStepsNbrsRange3to6;
84 
85  unsigned int* m_punNbrsRange0to3AtTimeStep;
86  unsigned int* m_punNbrsRange3to6AtTimeStep;
87 
88 
89 
90  // keeping track of distance travelled by bot in last 100 time-steps
91  int m_iDistTravelledTimeWindow;
92 
93  unsigned int m_unCoordCurrQueueIndex;
94 
95  double m_fSquaredDistTravelled;
96  double m_fSquaredDistThreshold;
97 
98  TVector2d* m_pvecCoordAtTimeStep;
99 
100 
101 };
102 
103 /******************************************************************************/
104 /******************************************************************************/
105 
106 
107 #endif