-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.cpp
More file actions
35 lines (28 loc) · 930 Bytes
/
Copy pathsample.cpp
File metadata and controls
35 lines (28 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "DecisionTree.h"
int main() {
// simple program for testing
// the Decision tree reduction algorithm
// Bool Tree that will be used in the program
BoolTree compGate;
// assign a depth of 10
// this should have 2047 nodes
compGate.generate_nodes(10);
// assign the true values (random)
compGate.insert_decision("1101001011");
compGate.insert_decision("1101010011");
compGate.insert_decision("0101010010");
compGate.insert_decision("1101001011");
compGate.insert_decision("0101011011");
compGate.insert_decision("1100000011");
compGate.insert_decision("0111010011");
compGate.insert_decision("0101000011");
compGate.insert_decision("1101010011");
// confirm the number of nodes
cout << "Whole tree :" << endl;
compGate.print_all();
// simplify the tree
compGate.simplify( compGate.get_root() );
// print the simplified node
cout << endl << "Reduced tree : " << endl;
compGate.print_all();
}