OptaPlanner throwing IllegalStateException on CompositeMove created by CartesianProductMoveSelector

后端 未结 2 1699
独厮守ぢ
独厮守ぢ 2021-01-14 04:48

so basically my problem is, that OptaPlanner is throwing this:

java.lang.IllegalStateException: The entity (...) has a variable (previousEntry) with value (.         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-14 05:11

    experienced the same when creating a CompositeMove with multiple ChainedChange and ChainedSwapMoves. The reason for this is, that your first move might Change the PlanningValue of a PlanningEntity manipulated in a Move following that first one. While the creation of the moves already captures the Status of all the variables and values, the second move anticipates a not longer existing planning Status.

    Example: chain before your Move:

    (I) A -> B -> C -> D

    your Composite Move: 1) ChainedChangeMove for Moving B in front of A 2) ChainedChangeMove for Moving D in front of C

    in the move creation the values will be stored a shown in (I) in the moves. Move 1 will execute correct.

    Solution after move 1): (II) B -> A -> C -> D

    the second move will now try to move D behind B, but B is already referenced in the previousStandstill variable of A

    You can create similiar scenarios with other versions of composite moves. As long as the chained moves save the status of the chain at creation of the move, union moves and compsite moves will potentially fail.

提交回复
热议问题