-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainGRASP.cpp
31 lines (27 loc) · 1 KB
/
mainGRASP.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
#include "Interface.h"
#include <chrono>
using namespace std;
using namespace std::chrono;
int main(){
File file("3-pr13");
file.read_file();
float totalProfit = 0;
totalProfit = calculate_profit();
cout << "Total profit is --> " << totalProfit << '\n';
for(int i = 0; i < 2; i++){
TOP top(file.get_N(), file.get_V());
auto start = high_resolution_clock::now();
vector<int> firstSolution = top.grasp_solution_generator();
int rcl_len = file.get_N() / file.get_V();
GRASP grasp(file.get_N(), file.get_V(), rcl_len, 100,30, firstSolution);
// grasp.graspAlgorithm();
grasp.graspAlgorithmTime(180);
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;
}