-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (39 loc) · 1.26 KB
/
Copy pathmain.cpp
File metadata and controls
41 lines (39 loc) · 1.26 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
#include <filesystem>
#include <map>
#include "graphGenerator.h"
#include "menu.h"
#include "independent.h"
#include "environment.h"
#include "restricted.h"
/**
* @brief main function; generates the graph; implements batch mode; calls menu
*
* @param argc number of arguments
* @param argv list of arguments
*/
int main(int argc, char *argv[]) {
if (argc==1) {
///Generate the graph using files in the project folder
Graph<int> graph=graphGenerator("Locations.csv", "Distances.csv");
///Display MENU
displayRouteFindingOptions(graph);
}
else {
///Generate the graph with the files whose names were passed as arguments in the terminal
Graph<int> graph=graphGenerator(argv[3],argv[4]);
///Store all user input from argv[1]
std::map<std::string,std::string> data=extractInputValues(argv[1]);
///argv[2] corresponds to the route finding option the user desires
std::string routeMode=argv[2];
if (routeMode=="Independent") {
mainIndependent(data, graph);
}
if (routeMode=="Restricted") {
mainRestricted(data, graph);
}
else if (routeMode == "Environmentally") {
mainEnvironment(data, graph);
}
}
return 0;
}