-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
29 lines (27 loc) · 897 Bytes
/
main.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
#include "Interface.h"
#include <chrono>
using namespace std;
using namespace std::chrono;
using namespace std;
int main() {
File file("rc208");
file.read_file();
float totalProfit = 0;
totalProfit = calculate_profit();
cout << "Total profit is --> " << totalProfit << '\n';
for(int i = 0; i < 3; i++){
int N = file.get_N();
int V = file.get_V();
auto start = high_resolution_clock::now();
GA ga(N, V, 200,500,0.7);
ga.genetic_algorithm();
// ga.genetic_algorithm_time(60);
auto stop = high_resolution_clock::now();
auto duration = duration_cast<seconds>(stop - start);
cout << "**************************************************" << '\n';
cout << "Time taken: "
<< duration.count() << " seconds" << endl;
cout<<"Iteration "<<i<<" finished!"<<'\n';
}
return 0;
}