how to keep track of planning variable assignment

2019-08-28 21:21发布

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条回答
Luminary・发光体
2楼-- · 2019-08-28 21:57

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.

查看更多
登录 后发表回答