-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpleProbableBenchmark.cpp
More file actions
37 lines (29 loc) · 1.06 KB
/
Copy pathsimpleProbableBenchmark.cpp
File metadata and controls
37 lines (29 loc) · 1.06 KB
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
36
37
#include "DecisionTree.h"
#include <chrono>
using namespace std;
using namespace std::chrono;
int main() {
// make new gate and generate nodes of 4-layer depth
BoolTree covidGate;
covidGate.generate_nodes(4);
// insert decision to have covid
covidGate.insert_decision("1111");
covidGate.insert_decision("1100");
covidGate.insert_decision("1010");
// count the speed of the algorithm
auto start = high_resolution_clock::now();
covidGate.print_all();
auto end = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(end - start);
cout << endl << "microseconds it took to traverse all nodes : " << duration.count() << endl;
// simplify the gates
covidGate.simplify( covidGate.get_root() );
// count the speed of the algorithm (simplified)
auto start1 = high_resolution_clock::now();
cout << endl;
covidGate.print_all();
auto end1 = high_resolution_clock::now();
auto duration1 = duration_cast<microseconds>(end1 - start1);
cout << endl << "microseconds it took to traverse all nodes : " << duration1.count() << endl;
}
// 1110101010