-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.jl
executable file
·40 lines (30 loc) · 930 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
32
33
34
35
36
37
38
39
40
# =========================================================================== #
# Compliant julia 1.x
# Using the following packages
using JuMP, GLPK
using LinearAlgebra
include("loadSPP.jl")
include("setSPP.jl")
include("getfname.jl")
# =========================================================================== #
# Loading a SPP instance
println("\nLoading...")
fname = "Data/didactic.dat"
C, A = loadSPP(fname)
@show C
@show A
# Solving a SPP instance with GLPK
println("\nSolving...")
solverSelected = GLPK.Optimizer
spp = setSPP(C, A)
set_optimizer(spp, solverSelected)
optimize!(spp)
# Displaying the results
println("z = ", objective_value(spp))
print("x = "); println(value.(spp[:x]))
# =========================================================================== #
# Collecting the names of instances to solve
println("\nCollecting...")
target = "Data"
fnames = getfname(target)
println("\nThat's all folks !")