VAT  3.0
Video Analysis Tool
LearningConcept.h
1 #ifndef __LEARNING_CONCEPT_H__
2 #define __LEARNING_CONCEPT_H__
3 
4 #include <set>
5 #include <string>
6 #include "LearningAttributesSpecification.h"
7 #include "GaussianFunction.h"
8 
9 namespace miles {
10 
12 
13  public:
14  attribute_id id;
15  SpGaussianFunction distribution;
16  double p;
17  double RSum; //Accumulated sum of reliabilities
18 
19  /*Constructor for numerical value type*/
20  NumericalAttributeValuePair(attribute_id, double, double, double);
22 
23  void setId(attribute_id i_id);
24  attribute_id getId();
25  void modifyValue(double mean, double sigma);
26 
27  bool operator==(NumericalAttributeValuePair);
28 
29  double getMean();
30  double getSigma();
31  double getRSum();
32 
33  void setMean(double mean);
34  void setSigma(double sigma);
35  void setRSum(double i_RSum);
36 
37  double getP();
38  void setP(double);
39 
40  void print(SpLearningAttributes availableAttributes);
41 
42  };
43 
44  class SymbolicValue {
45  public:
46  double RSum;
47  double P;
48  int N;
49  SymbolicValue(double, double, int);
50  SymbolicValue();
51  ~SymbolicValue();
52  };
53 
54  typedef QSharedPointer<SymbolicValue> SpSymbolicValue;
55 
56 
58 
59  public:
60  attribute_id id;
61  double p;
62  double RSum; //Accumulated sum of reliabilities
63  std::map<std::string, SpSymbolicValue> values;
64 
65  /*Constructor for symbolic value type*/
66  SymbolicAttributeValuePair(attribute_id, double, std::map<std::string, SpSymbolicValue> *);
67  SymbolicAttributeValuePair(attribute_id, double, std::string, std::set<std::string> *);
69 
70  void setId(attribute_id i_id);
71  attribute_id getId();
72  SpSymbolicValue modifyValue(std::string value, double R);
73 
74  bool operator==(SymbolicAttributeValuePair);
75 
76  SpSymbolicValue getValueInfo(std::string);
77  double getValueRSum(std::string);
78  double getValueP(std::string);
79  int getValueN(std::string);
80 
81  double getRSum();
82  void setRSum(double i_RSum);
83 
84  double getP();
85  void setP(double);
86 
87  void print(SpLearningAttributes availableAttributes);
88 
89  };
90 
92  public:
93  long int id;
94  int N;
95  double P;
96  SpGaussianFunction timeStayingAtOutgoingState;
97  double minT, maxT;
98 
99  long int startingState;
100  long int arrivingState;
101 
102  double getMean();
103  double getSigma();
104 
105  LearningEventConcept(long int i_id, double mean, double sigma);
107 
108  void setMean(double mean);
109  void setSigma(double sigma);
110 
111  };
112 
114  public:
115  long int id;
116  std::map <attribute_id, SpNumericalAttributeValuePair> numericalAttributeList;
117  std::map <attribute_id, SpSymbolicAttributeValuePair> symbolicAttributeList;
118 
119  //Indexed by the id of the state of origin
120  std::map <long int, SpLearningEventConcept> incomingEvents;
121  //Indexed by the id of the arriving state
122  std::map <long int, SpLearningEventConcept> outgoingEvents;
123 
124  int N;
125  int NE;
126  double P;
127  double score; //category utility score
128  double diff; //attributes difference score
129  long int parent;
130  int level, depth, distance_to_leaf;
132  LearningStateConcept(double);
134 
135  SpNumericalAttributeValuePair insertNumericalPair(attribute_id, double, double, double);
136 
137  SpSymbolicAttributeValuePair insertSymbolicPair(attribute_id, double, std::map<std::string, SpSymbolicValue> *);
138  SpSymbolicAttributeValuePair insertSymbolicPair(attribute_id, double, std::string, std::set<std::string> *values);
139 
140  void removePair(attribute_id);
141 
142  void print(SpLearningAttributes availableAttributes);
143 
144  bool numericalIdExists(attribute_id);
145  bool symbolicIdExists(attribute_id);
146 
147  void removeNumericalPair(attribute_id);
148  void removeSymbolicPair(attribute_id);
149 
150  SpNumericalAttributeValuePair getNumericPair(attribute_id);
151  SpSymbolicAttributeValuePair getSymbolicPair(attribute_id);
152 
153  int numericalPairsListSize();
154  int symbolicPairsListSize();
155 
156  double getP();
157  void setP(double);
158 
159  int getN();
160  void setN(int);
161 
162  double getScore();
163  void setScore(double);
164 
165  double getDiff();
166  void setDiff(double);
167 
168  long int getID();
169  void setID(long int);
170 
171  int getParent();
172  void setParent(int);
173 
174  double getPositionP(attribute_id _x, attribute_id _y);
175 
176  void setAttributeConceptToArray(double *Ps, int w, int h, attribute_id _x, attribute_id _y, attribute_id _a, double maxA, double ignorePThreshold);
177  void setConceptToArray(double *Ps, int w, int h, attribute_id _x, attribute_id _y, double maxP, double ignorePThreshold);
178  void setConceptBorderToArray(double *Ps, int w, int h, attribute_id _x, attribute_id _y, double maxP, double ignorePThreshold);
179  void setFlatConceptToArray(double *Ps, int w, int h, attribute_id _x, attribute_id _y, double maxP, double ignorePThreshold);
180  };
181 
182 } // end namespace
183 
184 #endif
Definition: LearningConcept.h:113
Definition: LearningConcept.h:11
Definition: LearningConcept.h:57
Definition: LearningConcept.h:91
Definition: LearningConcept.h:44
Definition: HierarchyTree.cpp:12