Topology.cpp
Go to the documentation of this file.
1 
19 
20 namespace SceneModel
21 {
22 
23 Topology::Topology(): mUsedInOptimization(false), mEvaluated(false), mCostValid(false)
24 { }
25 
27 
28 void Topology::setEvaluationResult(double pAverageRecognitionRuntime, double pFalsePositives, double pFalseNegatives)
29 {
30  mAverageRecognitionRuntime = pAverageRecognitionRuntime;
31  mFalsePositives = pFalsePositives;
32  mFalseNegatives = pFalseNegatives;
33  mEvaluated = true;
34 }
35 
37 {
38  if (!mEvaluated)
39  throw std::runtime_error("In Topology: trying to access average recogntition runtime without having evaluated the topology first.");
41 }
42 
44 {
45  if (!mEvaluated)
46  throw std::runtime_error("In Topology: trying to access number of false postives without having evaluated the topology first.");
47  return mFalsePositives;
48 }
49 
51 {
52  if (!mEvaluated)
53  throw std::runtime_error("In Topology: trying to access number of false negatives without having evaluated the topology first.");
54  return mFalseNegatives;
55 }
56 
58 {
59  return mEvaluated;
60 }
61 
62 void Topology::setCost(double pCost)
63 {
64  mCost = pCost;
65  mCostValid = true;
66 }
67 
68 double Topology::getCost() const
69 {
70  if (!mCostValid)
71  throw std::runtime_error("In Topology: trying to access cost without having calculated it first.");
72  return mCost;
73 }
74 
76 {
77  return mCostValid;
78 }
79 
81 {
82  mTree = pTree;
83 }
84 
86 {
87  if (!mTree)
88  throw std::runtime_error("In Topology: trying to access tree without having set it first.");
89 
90  // after rearrangement in learning, the pointer points to an inner node (through parent pointers, the whole tree is still intact)
91  while(mTree->mParent)
92  mTree = mTree->mParent;
93 
94  return mTree;
95 }
96 
98 {
99  if (!mTree) return false;
100  else return true;
101 }
102 
103 }
104 
double getAverageRecognitionRuntime() const
Definition: Topology.cpp:36
bool isTreeValid() const
Definition: Topology.cpp:97
void setCost(double pCost)
Definition: Topology.cpp:62
unsigned int mFalseNegatives
Definition: Topology.h:147
double mAverageRecognitionRuntime
Definition: Topology.h:142
double getFalseNegatives() const
Definition: Topology.cpp:50
boost::shared_ptr< TreeNode > getTree()
Definition: Topology.cpp:85
double getCost() const
Definition: Topology.cpp:68
void setTree(boost::shared_ptr< TreeNode > pTree)
Definition: Topology.cpp:80
unsigned int mFalsePositives
Definition: Topology.h:137
void setEvaluationResult(double pAverageRecognitionRuntime, double pFalsePositives, double pFalseNegatives)
Definition: Topology.cpp:28
boost::shared_ptr< TreeNode > mTree
Definition: Topology.h:163
bool isCostValid() const
Definition: Topology.cpp:75
bool isEvaluated() const
Definition: Topology.cpp:57
double getFalsePositives() const
Definition: Topology.cpp:43


asr_relation_graph_generator
Author(s): Meißner Pascal
autogenerated on Fri Nov 15 2019 03:39:19