OptaPlanner throwing IllegalStateException on CompositeMove created by CartesianProductMoveSelector

北战南征 提交于 2019-12-06 08:10:53

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!