问题
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