I’ve been working to create an updated version of this repo, which uses JuMP, GLPK and Julia to perform a linear optimization. I think I’ve correctly updated the bulk of it (replacing @setObjective with objective type things), but I’ve hit a snag on defining a variable. I’m going to post a few key lines here, but my full colab notebook is posted here.
error is:
UndefVarError: i not defined
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/MutableArithmetics/0Y9ZS/src/rewrite.jl:279 [inlined]
[2] macro expansion
@ ~/.julia/packages/JuMP/klrjG/src/macros.jl:676 [inlined]
[3] one_lineup_Type_4(skaters::DataFrame, goalies::DataFrame, lineups::Matrix{Int64}, num_overlap::Int64, num_skaters::Int64, num_goalies::Int64, centers::Vector{Int64}, wingers::Vector{Int64}, defenders::Vector{Int64}, num_teams::Int64, skaters_teams::Matrix{Int64}, goalie_opponents::Matrix{Int64}, team_lines::Matrix{Int64}, num_lines::Int64, P1_info::Matrix{Int64})
@ Main ./In[102]:424
[4] create_lineups(num_lineups::Int64, num_overlap::Int64, path_skaters::String, path_goalies::String, formulation::typeof(one_lineup_Type_4), path_to_output::String)
@ Main ./In[102]:803
[5] top-level scope
@ In[102]:873
[6] eval
@ ./boot.jl:368 [inlined]
[7] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base ./loading.jl:1428
I’m new to debugging but that lead me to lines 424 and 803 respectively, which are
function one_lineup_Type_4(skaters, goalies, lineups, num_overlap, num_skaters, num_goalies, centers, wingers, defenders, num_teams, skaters_teams, goalie_opponents, team_lines, num_lines, P1_info)
m = Model(solver=GLPKSolverMIP())
and
create_lineups(num_lineups, num_overlap, path_skaters, path_goalies, formulation, path_to_output)
I’m at a bit of a loss on how to debug this; I’ve banged on this all day and made no progress, so any advice on how to debug this kind of thing would be very helpful. The maintainer of the repo doesn’t seem to have added anything and others have hit the same snag according to the issues page, so I half wonder if it’s something in those function blocks that’s now dated, but I can’t find it.