Java约束库(JCL)问题:如何表示加法?

发布于 2024-08-03 03:24:45 字数 482 浏览 5 评论 0 原文

我必须使用 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜爱皱眉﹌ 2024-08-10 03:24:45

由于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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文