|
@@ -16,6 +16,8 @@ import org.optaplanner.core.api.score.constraint.ConstraintMatch;
|
|
|
import org.optaplanner.core.api.solver.SolutionManager;
|
|
|
import org.optaplanner.core.api.solver.Solver;
|
|
|
import org.optaplanner.core.api.solver.SolverFactory;
|
|
|
+import org.optaplanner.core.api.solver.event.BestSolutionChangedEvent;
|
|
|
+import org.optaplanner.core.api.solver.event.SolverEventListener;
|
|
|
import org.optaplanner.core.config.solver.EnvironmentMode;
|
|
|
import org.optaplanner.core.config.solver.SolverConfig;
|
|
|
import org.optaplanner.core.config.solver.termination.TerminationConfig;
|
|
@@ -59,6 +61,14 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
// .withMoveThreadCount("4")
|
|
|
);
|
|
|
Solver<ApsSolution> solver = solverFactory.buildSolver();
|
|
|
+ /*solver.addEventListener(new SolverEventListener<ApsSolution>() {
|
|
|
+ public void bestSolutionChanged(BestSolutionChangedEvent<ApsSolution> event) {
|
|
|
+ System.out.println("************"+event.getNewBestScore()+"************");
|
|
|
+ *//*if(solver.isEveryProblemChangeProcessed()) {
|
|
|
+ System.out.println(event.getNewBestScore());
|
|
|
+ }*//*
|
|
|
+ }
|
|
|
+ });*/
|
|
|
// optaplanner 求解器数据装配
|
|
|
ApsSolution apsSolution = getPreApsSolution(productionScheduleVo);
|
|
|
// ApsSolution apsSolutionData = solver.solve(apsSolution);
|