-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
51 lines (39 loc) · 985 Bytes
/
main.cpp
File metadata and controls
51 lines (39 loc) · 985 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <conio.h>
#include <string>
#include "DataLoader.h"
#include "Solver.h"
#include "Exporter.h"
using namespace std;
int main(int argc, char* argv[]) {
string file_path;
if (argc != 2) {
cout << "This is a console application. You can use it from the command line or drag file and drop it on the application icon." << endl;
_getch();
return -1;
}
else
file_path = argv[1];
DataLoader data_loader(file_path);
if (!data_loader.loadData()) {
_getch();
return -1;
}
Solver solver(&data_loader);
if (!solver.setGlobalArrays()) {
_getch();
return -1;
}
data_loader.deleteSomeDataBeforeSolve();
if (!solver.solve()) {
_getch();
return -1;
}
Exporter exporter(&data_loader, &solver);
exporter.setExeFilePath(argv[0]);
exporter.generateJSFile("/webgl sources/solver.js");
exporter.genetateTxtFile("/result.txt");
cout << "Press a key to exit";
_getch();
return 0;
}