OptaPlanner:如何使用ProblemFactChange添加计划实体 [英] OptaPlanner: How to add a planning entity with ProblemFactChange
本文介绍了OptaPlanner:如何使用ProblemFactChange添加计划实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个运行时间很长的求解器,希望可以使用新的计划实体(收到的订单)定期进行更新.以下是我拼凑的ProblemFactChange中的序列.这是正确的顺序吗?我找不到这个例子.
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);
推荐答案
是的,另请参见 查看全文