Select 来自 ShadowVariableListener 中的 ProblemFactCollectionProperty 和 PlanningEntityCollectionProperty,就像在 ContraintProvider 中一样

Select from ProblemFactCollectionProperty and PlanningEntityCollectionProperty in ShadowVariableListener like in ContraintProvider

为了更新我的影子变量,我必须考虑一些可以从保存在 ProblemFactCollectionProperty/PlanningEntityCollectionProperty 中的对象中获得的约束。

是否可以从 ShadowVariableListener 内部的 ProblemFactCollectionProperty 和 PlanningEntityCollectionProperty select 像使用 ContraintProvider 那样完成?或者我是否必须将指向这些集合的指针添加到具有此影子变量侦听器的每个对象,以便侦听器可以访问 ProblemFactCollectionProperty/PlanningEntityCollectionProperty?

VariableListener 中的所有方法都有一个 ScoreDirector 参数,因此您可以使用 scoreDirector.getWorkingSolution() 来获取您的工作解决方案。

不要在 VariableListener 中缓存该解决方案实例或其实体列表实例,因为解决方案克隆可能会影响真正的实例。