0
我有一个需要限制一个变种float数组中的每个元素的模型被AllDifferent属性为VAR浮动决策变量的minizinc阵列
不等于约束我试图用全球AllDifferent属性全局约束,但我得到以下错误:
MiniZinc: type error: no function or predicate with this signature found: `alldifferent(array[int] of var float)'
所以我换成以下理解的AllDifferent属性约束:
constraint forall (i,j in 1..nVERTICIES where i<j) (X[i] != X[j]);
,但现在我得到以下当我使用错误的地理编码求解:
Error: Registry: Constraint float_lin_ne not found
和下面的错误,当我用G12 MIP求解:
flatzinc: error: the built-in operation `float_lin_ne/3' is not supported by the MIP solver backend.
是否有不同的方式,我可以编码此约束?
我很惊讶,目前的编码不起作用。你确定你正在使用与解算器相对应的MiniZinc库吗?另一种方法是使用'X [i] Y [i]',虽然这肯定会减慢你的模型。我建议看看你的模型,在浮动上使用'alldifferent'是非常罕见的。你确定你不是在寻找类似“增加”或“减少”约束的东西吗? –
Dekker