-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
71 lines (49 loc) · 1.66 KB
/
main.cpp
File metadata and controls
71 lines (49 loc) · 1.66 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
66
67
68
69
70
71
///****************************AUTHOR**************************///
//Student Name: Omey Mohan Manyar
//USC Email ID: manyar@usc.edu
///***********************************************************//
/////Standard C++ Header Files/////////////
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <iostream>
////Headers for Standard DataStructures/////
#include <unordered_map>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
///////////////Custom Headers///////////////
#include "file_rw_utilities.hpp"
#include "file_container_utils.hpp"
#include "search_data_structure.hpp"
#include "Vec3i.hpp"
#include "search_algorithms.hpp"
#include <chrono>
#include <ctime>
int main() {
std::cout << "Starting Search" << std::endl;
std::chrono::time_point<std::chrono::system_clock> start, end;
//Defining the input container
input_container search_input;
start = std::chrono::system_clock::now();
//Parsing the input container to be defined using input.txt file
file_rw::read_txt(search_input);
end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;
std::cout<< "elapsed time: " << elapsed_seconds.count() << "s\n";
start = std::chrono::system_clock::now();
if (search_input.Search_Algo == "A*") {
search_algo::execute_A_star(search_input);
}
else if (search_input.Search_Algo == "UCS") {
search_algo::execute_UCS(search_input);
}
else if (search_input.Search_Algo == "BFS") {
search_algo::execute_BFS(search_input);
}
end = std::chrono::system_clock::now();
elapsed_seconds = end - start;
std::cout << "elapsed time: " << elapsed_seconds.count() << "s\n";
return 0;
}