-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.jl
60 lines (44 loc) · 1.57 KB
/
main.jl
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
push!(LOAD_PATH, "src/SD-CVRP")
push!(LOAD_PATH, "src/SD-CVRP/verifier/")
using PBP_Loggi
"""
main(ARGS)
**`Author:`** Vinicius Gabriel Angelozzi Verona de Resende
"""
main(ARGS) = begin
let args = ARGS, arguments = Argument(), debug=false
if (length(args) < 2)
displayHelp()
exit()
end
for i = 1 : length(args)
local argument = lowercase(args[i])
if (argument == "-s" || argument == "--seed")
arguments.seed = parse(Int64, args[i+1])
i += 1
elseif (argument == "-i" || argument == "--input")
arguments.input = args[i+1]
i += 1
elseif (argument == "-t" || argument == "--timer")
arguments.execution_time = parse(Int64, args[i+1])
i += 1
elseif (argument == "-k" || argument == "--k-near")
arguments.k_nearest = parse(Int64, args[i+1])
i += 1
elseif (argument == "--DEBUG")
debug = true
i += 1
elseif (argument == "--help" || argument == "-h")
displayHelp()
i += 1
end
end
if (arguments.input === "" || match(r".+\.json", arguments.input) === nothing)
throw("An input JSON file has not been passed as argument! See help using '-h' argument for more information")
end
cvrp(arguments; DEBUG=debug)
end
end
if (!isinteractive())
main(ARGS)
end