是否可以在规则的后果部分使用硬约束和软约束分数,但其中一个具有非零值。例如
scoreHolder.addHardConstraintMatch(kcontext, $weight * isHard);
scoreHolder.addSoftConstraintMatch(kcontext, $weight * isSoft);
其中 isHard/isSoft 其中一个为 1,另一个为零。
上面总是取最后执行的语句的值(即软约束)
是否可以在规则的后果部分使用硬约束和软约束分数,但其中一个具有非零值。例如
scoreHolder.addHardConstraintMatch(kcontext, $weight * isHard);
scoreHolder.addSoftConstraintMatch(kcontext, $weight * isSoft);
其中 isHard/isSoft 其中一个为 1,另一个为零。
上面总是取最后执行的语句的值(即软约束)
这是OptaPlanner 6.2.0 及更低版本中的一个已知问题。问题出在AbstractScoreHolder
因为它只以规则id作为key,而不是score level。