OptaPlanner: How to add a planning entity with ProblemFactChange

十年热恋 提交于 2020-01-07 05:34:09

问题


I have a long running solver that I wish to periodically update with new planning entities (incoming orders). Below is the sequence in the ProblemFactChange that I have pieced together. Is this the correct sequence? I could not find an example for this.

solution = scoreDirector.getWorkingSolution();
scoreDirector.beforeEntityAdded(order);
solution.getOrderList().add(order);
scoreDirector.triggerVariableListeners();
scoreDirector.afterEntityAdded(order);

回答1:


Yes, see also the new task assigning example which does that.



来源:https://stackoverflow.com/questions/37055070/optaplanner-how-to-add-a-planning-entity-with-problemfactchange

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