Windows 11 上的 OptaPlanner 9.44.0 w/Java 11。
我有一个带有影子变量的系统。当我使用正常的域访问运行时,一切正常。但我正在尝试 GIZMO 域访问,并且收到以下错误(其中
MyInstance
是我实际班级的 toString()
):
Exception in thread "main" java.lang.IllegalStateException: Cloning corruption: the same entity (MyInstance) is present in both the original and the clone.
So when a planning variable in the original solution changes, the cloned solution will change too.
我尝试使用各种断言级别运行,除非使用 GIZMO,否则没有检测到任何问题。我尝试在每个相关的课程和领域添加
@DeepPlanningClone
,但没有什么区别。
其他一些可能相关的细节:
@ShadowVariable
(这是一个 List
)。List
,标记为@PlanningEntityCollectionProperty
)VariableListener
用于适当设置阴影变量字段。知道这里可能出了什么问题吗?不幸的是我无法分享我的实际代码:(