hypothesis.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
32 #ifndef _HYPOTHESIS_H_
33 #define _HYPOTHESIS_H_
34 
35 #include <mtt/target.h>
36 
37 class Target;
39 typedef boost::shared_ptr<Target> TargetPtr;
40 
43 
51 {
52  public:
54  int _aux1;
56  int _cluster;
60  long _id;
62  int _status;
64  static long _euid;//extremely unique id
66  long _uid;
68  double _probability;
70  int _n_det;
72  int _n_occ;
74  int _n_del;
76  int _n_new;
78  int _n_fal;
80  double _prod;
81 
82  friend ostream& operator<<(ostream& o,Hypothesis& h);
83 
86 
88  vector<string> _attribute_names;
90  vector<string> _attribute_values;
91 
93  vector<TargetPtr> _targets;
94 
100  string nameUI();
101 
107  string name();
108 
115  void setAttribute(string name,string value);
116 
120  Hypothesis();
121 
129  Hypothesis(int iteration, int cluster, int status);
130 
134  ~Hypothesis();
135 };
136 
138 typedef boost::shared_ptr<Hypothesis> HypothesisPtr;
139 
140 
150 
160 
170 
171 #endif
friend ostream & operator<<(ostream &o, Hypothesis &h)
Definition: hypothesis.cpp:108
vector< string > _attribute_names
Attribute names used in the graphviz representation of this hypothesis.
Definition: hypothesis.h:88
vector< string > _attribute_values
Values for the corresponding attributes.
Definition: hypothesis.h:90
Definition: target.h:52
long _uid
Unique id for all currently existing hypotheses.
Definition: hypothesis.h:66
long iteration
Current iteration counter, used in the naming of tree nodes.
Definition: pmht.cpp:61
bool compareHypotheses(HypothesisPtr h1, HypothesisPtr h2)
Compare two hypotheses by uid.
Definition: hypothesis.cpp:128
int _iteration
Iteration for this hypothesis.
Definition: hypothesis.h:58
string name()
Create hypothesis name.
Definition: hypothesis.cpp:57
double _prod
Probability of current target to measurement assignment.
Definition: hypothesis.h:80
int _n_det
Number of detected targets.
Definition: hypothesis.h:70
bool compareHypothesesByProbability(HypothesisPtr h1, HypothesisPtr h2)
Compare two hypotheses by probability.
Definition: hypothesis.cpp:118
double _probability
Hypothesis probability.
Definition: hypothesis.h:68
boost::shared_ptr< Hypothesis > HypothesisPtr
Definition: cluster.h:44
hypotheses_status
Possible hypothesis status.
Definition: hypothesis.h:42
int _status
Current status.
Definition: hypothesis.h:62
int _n_fal
Number of failed targets.
Definition: hypothesis.h:78
vector< TargetPtr > _targets
List of hypothesis targets.
Definition: hypothesis.h:93
int _n_del
Number of deleted targets.
Definition: hypothesis.h:74
int _n_occ
Number of occluded targets.
Definition: hypothesis.h:72
void setAttribute(string name, string value)
Add a new attribute to the hypothesis, these attributes are only used in the graphviz plugin...
Definition: hypothesis.cpp:64
static long _euid
Static extremely unique id for all hypotheses (since program start)
Definition: hypothesis.h:64
long _id
Main id of the hypothesis.
Definition: hypothesis.h:60
long _parent_uid
Id of the parent hypothesis.
Definition: hypothesis.h:85
int _cluster
Id of the cluster this hypothesis belongs to.
Definition: hypothesis.h:56
string nameUI()
Create hypothesis name formated to the user interface.
Definition: hypothesis.cpp:50
bool compareHypothesesByProbabilityDescending(HypothesisPtr h1, HypothesisPtr h2)
Compare two hypotheses by probability, but descending.
Definition: hypothesis.cpp:123
Hypothesis()
Hypothesis constructor, variable initialization.
Definition: hypothesis.cpp:82
boost::shared_ptr< Target > TargetPtr
Shared pointer to the Target class.
Definition: hypothesis.h:37
Hypotheses tree nodes.
Definition: hypothesis.h:50
Target class declaration.
int _aux1
Auxiliary int variable, multi use, value not assured between calls.
Definition: hypothesis.h:54
~Hypothesis()
Class destructor.
Definition: hypothesis.cpp:44
boost::shared_ptr< Hypothesis > HypothesisPtr
Shared pointer to the Hypothesis class.
Definition: hypothesis.h:138
int _n_new
Number of new targets.
Definition: hypothesis.h:76


mtt
Author(s): Jorge Almeida
autogenerated on Mon Mar 2 2015 01:32:18