-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStatistics.h
More file actions
36 lines (27 loc) · 855 Bytes
/
Statistics.h
File metadata and controls
36 lines (27 loc) · 855 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
36
#pragma once
#include <string>
class Statistics {
public:
Statistics() : walk_length(0), sample_count(0), number_of_cycles(0) {}
std::string to_string(){
std::string str = "Statistics: \n";
str += "Max length of walk " + std::to_string(walk_length) + "\n";
str += "Number of samples: " + std::to_string(sample_count) + "\n";
str += "Number of cycles: " + std::to_string(number_of_cycles) + "\n";
str += "Number of 0s: " + std::to_string(sample_count - number_of_cycles) + "\n";
return str;
}
void set_sample_count(double p){
sample_count = p;
}
void set_walk_length(double z){
walk_length = z;
}
void incr_number_of_cycles(){
number_of_cycles++;
}
private:
unsigned walk_length;
unsigned sample_count;
int number_of_cycles;
};