在 OptaPlanner 的约束中使用 HardMediumSoftScore 时出现异常
Exception when using a HardMediumSoftScore in a constraint in OptaPlanner
我试图在约束中使用 HardMediumSoftScore
,但出现以下异常:
java.lang.IllegalArgumentException: The constraintWeight (1hard/0medium/0soft) of class (class org.optaplanner.core.api.score.buildin.hardmediumsoft.HardMediumSoftScore) for constraintPackage (xxx) and constraintName (xxx) must be of the scoreClass (class org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore).
我在文档中看不到任何关于为什么我不能使用中等分数,或者我需要做任何不同于使用硬分数或软分数的事情。
我在使用 v8.9.1-FINAL
和 v8.10.0-FINAL
时遇到了同样的问题。
有什么想法吗?提前致谢。
您的规划域的某些部分将包含对 HardSoftScore
的引用。从这个来自约束的异常消息,我猜你的规划解决方案正在使用 HardSoftScore
而不是 HardMediumSoftScore
.
您可以自由使用其中任何一种,但您需要始终如一地使用其中一种。
我试图在约束中使用 HardMediumSoftScore
,但出现以下异常:
java.lang.IllegalArgumentException: The constraintWeight (1hard/0medium/0soft) of class (class org.optaplanner.core.api.score.buildin.hardmediumsoft.HardMediumSoftScore) for constraintPackage (xxx) and constraintName (xxx) must be of the scoreClass (class org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore).
我在文档中看不到任何关于为什么我不能使用中等分数,或者我需要做任何不同于使用硬分数或软分数的事情。
我在使用 v8.9.1-FINAL
和 v8.10.0-FINAL
时遇到了同样的问题。
有什么想法吗?提前致谢。
您的规划域的某些部分将包含对 HardSoftScore
的引用。从这个来自约束的异常消息,我猜你的规划解决方案正在使用 HardSoftScore
而不是 HardMediumSoftScore
.
您可以自由使用其中任何一种,但您需要始终如一地使用其中一种。