DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
decisiontree.h
Go to the documentation of this file.
1 #ifndef DECISIONTREE_H
2 #define DECISIONTREE_H
3 
4 #include <commons_global.h>
6 #include <list>
7 #include <memory>
8 
9 namespace dtree {
10 
11 class Node;
12 
13 class COMMONSSHARED_EXPORT DecisionTree : public std::enable_shared_from_this<DecisionTree>
14 {
15 public:
16  DecisionTree();
17 
18  void clear();
19 
20  std::shared_ptr<Node> root() const { return mRoot; }
21  std::shared_ptr<Node> createNode() ;
22 
23  void setRoot(std::shared_ptr<Node> root);
24  void connect (std::shared_ptr<Node> node, std::shared_ptr<Node> parent, int childId);
25 
26  bool isEmpty() const { return mRoot.get() == 0; }
27 
29  mType = t;
30  }
31  DecisionTreeManager::TreeType type() const { return mType; }
32 
33  void removeNodes(std::list<std::shared_ptr<Node> > nodes);
34 private:
35  std::shared_ptr<Node> mRoot;
36 
38 };
39 
40 }
41 
42 #endif // DECISIONTREE_H
std::shared_ptr< Node > root() const
Definition: decisiontree.h:20
Definition: decisiontree.h:13
Definition: Node.h:39
vector< Node * > nodes
Definition: main.cpp:270
bool isEmpty() const
Definition: decisiontree.h:26
DecisionTreeManager::TreeType type() const
Definition: decisiontree.h:31
Definition: commonstateevaluators.h:8
TreeType
An enumerated type to identify which tree to refer. They are internally used as index to various cont...
Definition: decisiontreemanager.h:38
void setType(DecisionTreeManager::TreeType t)
Definition: decisiontree.h:28
#define COMMONSSHARED_EXPORT
Definition: commons_global.h:23