OptaPlanner 用小发明克隆腐败

问题描述 投票:0回答:1

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
    用于适当设置阴影变量字段。

知道这里可能出了什么问题吗?不幸的是我无法分享我的实际代码:(

optaplanner
1个回答
0
投票

请向我们提供重现器新问题,我们很乐意在 1.3.0 中修复此问题。

1.2.0 的解决方法

src/main/resources/application.properties
中,禁用小工具:

quarkus.timefold.solver.domain-access-type=REFLECTION

更新:修复已在 1.3.0 中发布

感谢重现者,此问题已在 1.3.0 中修复,现已发布。

© www.soinside.com 2019 - 2024. All rights reserved.