how to keep track of planning variable assignment in optaplanner

江枫思渺然 提交于 2019-12-13 04:27:40

问题


Is there a way to access planning variable's assignment during planning?

In my use case, I want to assign a planning variable with certain status only one time only during planning. After that I don't want to use that planning variable.

I know that in optaplanner, a planning variable/problem fact can not change, so i can not change its status.

Is there a way to get list of planning variable assignment during planning so that in java code or drools file, i can avoid re-assignment if it has been used once?

Thanks!


回答1:


Use a hard constraint to enforce that.

Yes, you could use MoveFilters too, but that's not a good idea because sometimes you need to break hard constraints to escape local optima.



来源:https://stackoverflow.com/questions/52825065/how-to-keep-track-of-planning-variable-assignment-in-optaplanner

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