-
Notifications
You must be signed in to change notification settings - Fork 0
/
note.txt
55 lines (39 loc) · 1.68 KB
/
note.txt
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
//
// note.txt
// AuctionSimulationQL
//
// Created by Yann Kerzreho on 11/12/2023.
//
auto start = std::chrono::high_resolution_clock::now();
std::vector<std::vector<double>> conv = simulConvPar(alpha, beta, gamma, epsilon, opt, num_iterations, possible_bet, pricer, num_it_param, numConv);
auto stop = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(stop - start);
std::cout << "Elapsed time 1: " << duration.count() << " milliseconds" << std::endl;
std::vector<double> conv1 = findCol(conv, 0);
std::vector<double> conv2 = findCol(conv, 1);
std::vector<double> alphas = findCol(conv, 2);
std::vector<double> betas = findCol(conv, 3);
std::vector<double> gammas = findCol(conv, 4);
std::vector<double> pricers = findCol(conv, 8);
writeCSV("/Users/yannkerzreho/Documents/AC/sim_convergence.csv", conv1, conv2, alphas, betas, gammas, pricers);
std::vector<double> possible_bet;
double step = 0.05;
for (double value = 0.05; value < 1.0; value += step) {
possible_bet.push_back(value);
}
double alpha = 0.05;
double beta = 0.00002;
double gamma = 0.99;
double epsilon = 0.25;
double opt = 10;
double num_iterations = 1000000;
double pricer = 1;
int num_it_param = 1;
int numConv = 1000;
std::vector<std::vector<int>> actions = simulation(alpha,beta,gamma,epsilon,opt,num_iterations,possible_bet,pricer);
std::vector<int> action1 = findColint(actions, 0);
std::vector<int> action2 = findColint(actions, 1);
writeCSV("/Users/yannkerzreho/Documents/AC/sim_actions.csv", action1, action2);
std::vector<int> conv = findConvergence(actions, 10000);
std::cout << "1: " << convs[1] << " | 2: " << convs[2] << std::endl;
return 0;