You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the JuMP docs for MiniZinc, we find a toy problem to be solved:
using JuMP
import MiniZinc
model = Model(() -> MiniZinc.Optimizer{Float64}("highs"))
@variable(model, 1 <= x[1:3] <= 3, Int)
@constraint(model, x in MOI.AllDifferent(3))
@objective(model, Max, sum(i * x[i] for i in 1:3))
optimize!(model)
@show value.(x)
However this returns no solution:
ERROR: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model.
Also not sure if it helps but the previous example (not using JuMP) works:
Thanks for finding this. I've transferred this issue to MiniZinc.jl.
I can reproduce, with more information:
julia>solution_summary(model)
* Solver : MiniZinc
* Status
Result count :0
Termination status : OTHER_ERROR
Message from the solver:"=====ERROR=====Error: type error: no function or predicate with this signature found: `alldifferent(array[int] of var float)'Cannot use the following functions or predicates with the same identifier:predicate alldifferent(array [$X] of var set of int: x); (argument 1 expects type array[$_] of var set of int, but type array[int] of var float given)predicate alldifferent(array [$X] of var int: x); (argument 1 expects type array[$_] of var int, but type array[int] of var float given)predicate alldifferent(array [$X] of var opt int: x); (argument 1 expects type array[$_] of var opt int, but type array[int] of var float given)/private/var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_fPnuhi/model.mzn:4.12-43"* Candidate solution (result #1)
Primal status : NO_SOLUTION
Dual status : NO_SOLUTION
* Work counters
Solve time (sec) :1.20307e+00
Hello!
Looking at the JuMP docs for MiniZinc, we find a toy problem to be solved:
However this returns no solution:
Also not sure if it helps but the previous example (not using JuMP) works:
The text was updated successfully, but these errors were encountered: