Hi, I am trying to build a NHL DFS lineup optimizer using code found at https://github.com/dscotthunter/Fantasy-Hockey-IP-Code/blob/master/code_for_Github.jl which needs updated for the current version of JuMP. I’m very new to Julia and JuMP but I’ve had some success working on it until I got stuck at the following error:
[1] set_objective(::Model, ::MathOptInterface.OptimizationSense, ::Val{false}) at /home/greg/.julia/packages/JuMP/iGamg/src/objective.jl:101
[2] one_lineup_Type_4(::DataFrame, ::DataFrame, ::Array{Int64,2}, ::Int64, ::Int64, ::Int64, ::Array{Int64,1}, ::Array{Int64,1}, ::Array{Int64,1}, ::Int64, ::LinearAlgebra.Adjoint{Int64,Array{Int64,1}}, ::Array{Any,1}, ::Array{Int64,2}, ::Int64, ::Array{Int64,1}) at /home/greg/.julia/packages/JuMP/iGamg/src/macros.jl:979
[3] create_lineups(::Int64, ::Int64, ::String, ::String, ::typeof(one_lineup_Type_4), ::String) at /data/Projects/Sports/NHL/lineupoptimizer.jl:265
[4] top-level scope at /data/Projects/Sports/NHL/lineupoptimizer.jl:332
[5] include at ./boot.jl:328 [inlined]
[6] include_relative(::Module, ::String) at ./loading.jl:1094
[7] include(::Module, ::String) at ./Base.jl:31
[8] include(::String) at ./client.jl:431
[9] top-level scope at REPL[1]:1
in expression starting at /data/Projects/Sports/NHL/lineupoptimizer.jl:332
The objective function I’m using is:
@objective(m, Max, sum(skaters[i,:Projection]*skaters_lineup[i] for i=1:num_skaters) + sum(goalies[i,:Projection]*goalies_lineup[i] for i=1:num_goalies))
The full code is at https://github.com/TheNextMyth/Fantasy-Hockey-IP-Code/blob/master/lineupoptimizer.jl and also has the csv files I was using for testing.
I believe there is something wrong with the objective function formula I am passing in but am not sure. Any help is appreciated. Please let me know what other information I need to include or if I made some other posting mistake. Thank you.