$search
00001 00059 #ifndef HYPOTHESESTREE_H_ 00060 #define HYPOTHESESTREE_H_ 00061 00062 #include "wire/core/datatypes.h" 00063 #include <list> 00064 #include <map> 00065 00066 namespace mhf { 00067 00068 class Evidence; 00069 class SemanticObject; 00070 class Hypothesis; 00071 class AssignmentMatrix; 00072 class KnowledgeDatabase; 00073 class EvidenceSet; 00074 00075 class HypothesisTree { 00076 00077 public: 00078 00079 /* CONSTRUCTORS / DESTRUCTORS */ 00080 00081 // Constructor 00082 HypothesisTree(int num_max_hyps, double max_min_prob_ratio); 00083 00084 // Destructor 00085 virtual ~HypothesisTree(); 00086 00087 00088 /* GETTERS */ 00089 00090 const std::list<SemanticObject*>& getMAPObjects() const; 00091 00092 const std::list<SemanticObject*>& getAllObjects() const; 00093 00094 const std::list<Hypothesis*>& getHypotheses() const; 00095 00096 const Hypothesis& getMAPHypothesis() const; 00097 00098 int getHeight() const; 00099 00100 00101 /* SETTERS */ 00102 00103 void addEvidence(const EvidenceSet& ev_set); 00104 00105 00106 /* PRINT METHODS */ 00107 00108 void showStatistics(); 00109 00110 protected: 00111 00112 Hypothesis* root_; 00113 00114 std::list<Hypothesis*> leafs_; 00115 00116 Hypothesis* MAP_hypothesis_; 00117 00118 long n_updates_; 00119 00120 double t_last_update_; 00121 00122 int tree_height_; 00123 00124 unsigned int num_max_hyps_; 00125 00127 double max_min_prob_ratio_; 00128 00129 void applyAssignments(); 00130 00131 //void determineMAPHypothesis(); 00132 00133 void expandTree(const EvidenceSet &ev_set); 00134 00135 // Normalize the probabilities of all hypotheses in the tree 00136 void normalizeProbabilities(); 00137 00138 // Prune the tree 00139 void pruneTree(const Time& timestamp); 00140 00141 }; 00142 00143 } 00144 #endif /* HYPOTHESESTREE_H_ */