forked from xgandibleux/metaSPPstu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.jl
executable file
·31 lines (23 loc) · 941 Bytes
/
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
# =========================================================================== #
# Compliant julia 1.x
# Using the following packages
using JuMP, GLPK
using LinearAlgebra
include("loadSPP.jl")
include("setSPP.jl")
include("getfname.jl")
# =========================================================================== #
# Setting the data
fname = "Desktop/solveSPP/Data/didactic.dat" # path for a standard config on macOS
cost, matrix = loadSPP(fname)
# Proceeding to the optimization
solverSelected = GLPK.Optimizer
ip, ip_x = setSPP(solverSelected, cost, matrix)
println("Solving..."); optimize!(ip)
# Displaying the results
println("z = ", objective_value(ip))
print("x = "); println(value.(ip_x))
# =========================================================================== #
# Collecting the names of instances to solve
target = "Desktop/solveSPP/Data" # path for a standard config on macOS
fnames = getfname(target)