-
Notifications
You must be signed in to change notification settings - Fork 0
/
future_net.cpp
53 lines (45 loc) · 1.32 KB
/
future_net.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "route.h"
#include "lib_io.h"
#include "lib_time.h"
#include "stdio.h"
int main(int argc, char *argv[])
{
print_time("Begin");
char *topo[MAX_EDGE_NUM];
int edge_num;
char *demand[MAX_DEMAND_NUM];
int demand_num;
#if defined(WIN32)
char *topo_file = "G:\\competition\\HUAWEI Code Craft\\semiFinals\\test-case\\caseProblem\\topo.csv";
#else
char *topo_file = argv[1];
#endif
edge_num = read_file(topo, MAX_EDGE_NUM, topo_file);
if (edge_num == 0)
{
printf("Please input valid topo file.\n");
return -1;
}
#if defined(WIN32)
char *demand_file = "G:\\competition\\HUAWEI Code Craft\\semiFinals\\test-case\\caseProblem\\demand.csv";
#else
char *demand_file = argv[2];
#endif
demand_num = read_file(demand, MAX_DEMAND_NUM, demand_file);
if (demand_num != MAX_DEMAND_NUM)
{
printf("Please input valid demand file.\n");
return -1;
}
search_route(topo, edge_num, demand, demand_num);
#if defined(WIN32)
char *result_file = "G:\\competition\\HUAWEI Code Craft\\semiFinals\\test-case\\caseProblem\\sample_result.csv";
#else
char *result_file = argv[3];
#endif
write_result(result_file);
release_buff(topo, edge_num);
release_buff(demand, demand_num);
print_time("End");
return 0;
}