Hello, i have this code:
using libglpk
using GLPK
using JuMP
using Gurobi
using DataFrames
using BlockDecomposition, Coluna;
I_list = [1, 2, 3]
T_list = [1, 2, 3, 4, 5, 6, 7]
K_list = [1, 2, 3]
alpha=0.01
M = 10000
Max = 6
I_list1 = DataFrame(I = I_list)
T_list1 = DataFrame(T = T_list)
K_list1 = DataFrame(K = K_list)
Demand_Dict = Dict(
(1, 1) => 2, (1, 2) => 1, (1, 3) => 0,
(2, 1) => 1, (2, 2) => 2, (2, 3) => 0,
(3, 1) => 1, (3, 2) => 1, (3, 3) => 1,
(4, 1) => 1, (4, 2) => 2, (4, 3) => 0,
(5, 1) => 2, (5, 2) => 0, (5, 3) => 1,
(6, 1) => 1, (6, 2) => 1, (6, 3) => 1,
(7, 1) => 0, (7, 2) => 3, (7, 3) => 0
)
# Create the model
model = Model(Gurobi.Optimizer)
# Decision variables
@variable(model, slack[t in T_list, s in K_list] >= 0)
@variable(model, motivation[i in I_list, t in T_list, s in K_list], Bin)
@variable(model, mood[i in I_list, t in T_list] >= 0)
@variable(model, x[i in I_list, t in T_list, s in K_list] >= 0)
# Objective function
@objective(model, Min, sum(slack[t, s] for t in T_list, s in K_list))
# Constraints for demand
for (t, s) in keys(Demand_Dict)
@constraint(model, slack[t, s] >= Demand_Dict[(t, s)] - sum(motivation[i, t, s] for i in I_list))
end
for i in I_list
for t in T_list
@constraint(model, mood[i, t] == 1 - alpha * sum(x[i, t, s] for s in K_list))
@constraint(model, sum(x[i, t, s] for s in K_list) <= 1)
for s in K_list
@constraint(model, mood[i, t] + M*(1-x[i, t, s]) >= motivation[i, t, s])
@constraint(model, motivation[i, t, s] >= mood[i, t] - M * (1 - x[i, t, s]))
@constraint(model, motivation[i, t, s] <= x[i, t, s])
end
end
for t in 1:(length(T_list) - Max)
@constraint(model, sum(x[i, u, s] for s in K_list for u in t:(t + Max)) <= Max)
end
end
# Solve the model
optimize!(model)
# Coluna
coluna = optimizer_with_attributes(
Coluna.Optimizer,
"params" => Coluna.Params(
solver = Coluna.Algorithm.TreeSearchAlgorithm() # default branch-cut-and-price
),
"default_optimizer" => GLPK.Optimizer # GLPK for the master & the subproblems
);
@axis(M_axis, I_list);
model = BlockModel(coluna; direct_model = true);
@dantzig_wolfe_decomposition(model, decomposition, M_axis)
master = getmaster(decomposition)
subproblems = getsubproblems(decomposition)
specify!.(subproblems, lower_multiplicity = 0, upper_multiplicity = 1)
getsubproblems(decomposition)
optimize!(model)
and i am currently running into this error:
LoadError: UndefVarError:
libglpk not defined
I did install libglpk correctly, but it doesnt seem to work. How can i fix this error?