All I want is to be able to run an optimization which can use prod() or any custom function i can make.
I tried everything normal and NL objectives, constraints vs…
Ipopt optimizer does what i want but it does with float numbers, I need integer results.
using JuMP
using Printf
using SCIP
#optimizer = Juniper.Optimizer
#params = Dict{Symbol,Any}()
#params[:nl_solver] = with_optimizer(Ipopt.Optimizer,max_cpu_time=5.0,print_level=0)
#m = Model(with_optimizer(optimizer, params))
#m = Model(with_optimizer(Ipopt.Optimizer, max_cpu_time=160.0))
m = Model(with_optimizer(SCIP.Optimizer))
#m = Model(with_optimizer(AmplNLSolver, "Couenne"))
@variable(m, 0 <=groups[1:41]<=250, integer=true)
@constraint(m,[i in 1:41],sum(groups[i] for i in 1:41)==250)
@objective(m, Max,prod(groups[i] for i in 1:41))
optimize!(m)
for i in 1:41
@printf("%d info in %f\n ", i,value(groups[i]))
end
@printf("Object cost= %f\n", objective_value(m))