简体   繁体   English

如果我在 OptaPlanner 中将约束权重设置为零怎么办?

[英]What if I set the constraint weight to zero in OptaPlanner?

If I set the weight of a constraint to zero, does that mean that this constraint does not take effect?如果我将约束的权重设置为零,是否意味着该约束不会生效? look like below:如下所示:

@ConstraintWeight("Speaker conflict")
private HardMediumSoftScore speakerConflict = HardMediumSoftScore.ofHard(0);

Functionally: yes, the constraint has no score impact so is effectively ignored.功能上:是的,约束没有分数影响,因此被有效地忽略。

Implementation wise:实施明智:

  • In DRL score calculation in 7.20.0.Final that constraint rule still eats CPU power because Drools doesn't support disabling rules after building the KieBase at the moment.在 7.20.0.Final 的 DRL 分数计算中,约束规则仍然占用 CPU 能力,因为 Drools 目前不支持在构建 KieBase 后禁用规则。
  • In the ConstraintStreams prototype (long-term work in progress, not yet released) that constraint already automatically takes no CPU power because it isn't be added to the KieBase.在 ConstraintStreams 原型(正在进行的长期工作,尚未发布)中,该约束已经自动不占用 CPU 功率,因为​​它没有被添加到 KieBase。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM