-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathTraceForEval.cpp
56 lines (47 loc) · 1.38 KB
/
TraceForEval.cpp
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "stdafx.h"
#include "Rule.hpp"
#include "RuleList.h"
#include "BucketTree.h"
#include "TraceGen.h"
using std::cout;
using std::endl;
using std::ofstream;
namespace logging = boost::log;
namespace src = boost::log::sources;
namespace sinks = boost::log::sinks;
namespace keywords = boost::log::keywords;
namespace fs = boost::filesystem;
void logging_init() {
fs::create_directory("./log");
logging::add_file_log
(
keywords::file_name = "./log/sample_%N.log",
keywords::rotation_size = 10 * 1024 * 1024,
keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0),
keywords::format = "[%TimeStamp%]: %Message%"
);
/*logging::core::get()->set_filter
(
logging::trivial::severity >= warning
);*/
}
int main() {
// init log, rule list, randomness
srand (time(NULL));
logging_init();
string rulefile = "../para_src/ruleset/8k_4";
rule_list rList(rulefile, false);
rList.print("../para_src/rList.dat");
// generate bucket tree
bucket_tree bTree(rList, 20, false);
// bTree.pre_alloc();
bTree.print_tree("../para_src/tree_pr.dat");
// trace generation
tracer tGen(&rList);
tGen.set_para("../para_src/trace_para.txt");
tGen.hotspot_prob_b(false);
for (int fr = 5; fr <= 50; fr += 5){
tGen.flow_rate = fr;
tGen.pFlow_pruning_gen(false);
}
}