-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrechetCompImpl.cpp
More file actions
65 lines (45 loc) · 1.5 KB
/
FrechetCompImpl.cpp
File metadata and controls
65 lines (45 loc) · 1.5 KB
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
57
58
59
60
61
62
63
64
65
// Entrypoint for the program, loads queryset and dataset and invokes main algorithm
// Also determines number of worker threads used by the algorithm
#include "FileIO.h"
#include "Algorithm.h"
#include "Query.h"
#include "CDFQueued.h"
#include "settings.h"
#include <stdio.h>
#include <thread>
int main(int argc, char *argv[])
{
char * datasetFilename;
char * querysetFilename;
if (argc == 3) {
datasetFilename = argv[1];
querysetFilename = argv[2];
}
else {
datasetFilename = "..\\dataset.txt";
querysetFilename = "..\\queries.txt";
}
long timeMS = std::chrono::system_clock::now().time_since_epoch() /
std::chrono::milliseconds(1);
std::cout << "Dataset: " << datasetFilename << " Queryset: " << querysetFilename << "\n";
BoundingBox *box = new BoundingBox();
AlgoData a;
a.queries = a.fio.parseQueryFile(querysetFilename);
std::cout << "Loaded queries\n";
a.trajectoryNames = a.fio.parseDatasetFile(datasetFilename);
a.numTrajectories = a.trajectoryNames->size();
std::cout << "Loaded trajectories\n";
a.numWorkers = std::thread::hardware_concurrency();// worker threads == number of logical cores
a.boundingBox = box;
#if !USE_MULTITHREAD
a.numWorkers = 1;
#endif
std::cout << "Loaded dataset and query files\n";
std::cout << "Num workers: " << a.numWorkers << "\n";
runAlgorithm(&a);
timeMS = std::chrono::system_clock::now().time_since_epoch() /
std::chrono::milliseconds(1) - timeMS;
std::cout << "Total time: " << timeMS << "\n";
std::cout << "Done\n";
return 0;
}