本文介绍了在minizinc的约束中使用表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人帮助我,我将不胜感激.我需要对两个数组的4个成员遵循用户在minizinc工具中指定的特定模式的约束进行建模.

I appreciate if anybody helps me with my question. I need to model the constraint that 4 members of two arrays follow a specific pattern given by the user in minizinc tool.

例如,我需要X [0],X [1],Y [0],Y [1]采取以下模式之一:

For example I need X[0],X[1],Y[0],Y[1] to take one of the following patterns:

(0,0,1,1),(0,1,0,1)和(0,1,1,1).

(0,0,1,1) , (0,1,0,1) and (0,1,1,1).

如果有人帮助我解决问题,我将不胜感激.

I appreciate if anybody helps me figure it out.

推荐答案

使用表约束:

constraint table([X[0], X[1], Y[0], Y[1]], [|
    0,0,1,1 |
    0,1,0,1 |
    0,1,1,1 |
|]);

这篇关于在minizinc的约束中使用表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 14:39