我必须使用 CSP 逻辑问题解决。 epfl.ch/JCL/" rel="nofollow noreferrer">Java 约束库。现在我已经设法表示了问题的一些约束,其中大多数都基于“等于”和“不等于”二元约束。我的疑问是,如何表示基于加法的约束?示例:
- 变量 1 属于 DomainA
- 变量 2 属于 DomainB
- 变量 3 属于 DomainA
- 变量 4 属于 DomainB
现在约束:
- 变量 1 和变量 2 的总和为
大于变量 3 和的总和
变量4。
观察:这些变量代表金钱,因此可以相加。
I have to solve a CSP logic problem using Java Constraints Library. For now I've managed to represent some constraints of the problem, most of them are based on "equals" and "not equals" binary constraints. My doubt is, how to represent an addition based constraint? Example:
- variable1 belongs to DomainA
- variable2 belongs to DomainB
- variable3 belongs to DomainA
- variable4 belongs to DomainB
Now the constraint:
- The sum of variable1 and variable2 is
greater than the sum of variable3 and
variable4.
Observation: these variables represent money, so they can be added.
发布评论
评论(1)
由于Java约束库仅使用一元或二元约束,因此我们必须进行 约束以表示n元约束。我们还可以继承库中现有的关系类并定义新的兼容关系。
编辑:截至 2020 年,JCL 库链接已失效,这是该库的原始论文:https://www.aaai.org/Papers/Workshops/1997/WS-97-05/WS97-05-004.pdf
Since Java Constraint Library uses only unary or binary constraints, we have to do Binarization of Constraints in order to represent n-ary constraints. We can also inherit existing relations classes in the library and define new compatible relations.
EDIT: as of 2020, the JCL library link is dead, here's the original paper for that library: https://www.aaai.org/Papers/Workshops/1997/WS-97-05/WS97-05-004.pdf