Closed hakank closed 3 years ago
The output code should be:
for sol in 1:num_sols
println("solution #$sol")
xx = convert.(Integer,JuMP.value.(x; result=sol))
println("objective: ", JuMP.objective_value(model; result=sol))
println("x:$xx\n")
end
you forgot the result = sol
part.
I tested the TableConstraint model from the documentation ( https://wikunia.github.io/ConstraintSolver.jl/stable/how_to/#How-to-define-a-set-of-possibilities-for-more-than-one-variable?-1 ) and added the output of all solutions. However, the 5 solutions are all the same, the last entry in the table (
[4 5 5 3 4]
).Here's the result:
I tested it with another model (implementing the modulo constraint) and got the same problem: the correct number of solutions are shown, but all solutions are identical.