|
@@ -9,6 +9,10 @@ import com.rongwei.rwapsserver.aps.score.ApsConstraintProvider;
|
|
|
import com.rongwei.rwapsserver.aps.service.ProductionScheduleService;
|
|
|
import com.rongwei.rwapsserver.aps.vo.ProductionScheduleRetVo;
|
|
|
import com.rongwei.rwapsserver.aps.vo.ProductionScheduleVo;
|
|
|
+import org.optaplanner.core.api.score.ScoreExplanation;
|
|
|
+import org.optaplanner.core.api.score.ScoreManager;
|
|
|
+import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
|
|
|
+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.config.solver.SolverConfig;
|
|
@@ -32,7 +36,12 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
.withTerminationSpentLimit(Duration.ofSeconds(5)));
|
|
|
Solver<ApsSolution> solver = solverFactory.buildSolver();
|
|
|
ApsSolution solvedBalance = solver.solve(getTestApsSolution());
|
|
|
+ System.out.println("*****************************");
|
|
|
System.out.println(solvedBalance);
|
|
|
+ SolutionManager<ApsSolution, HardSoftScore> scoreManager = SolutionManager.create(solverFactory);
|
|
|
+ System.out.println(scoreManager.explain(solvedBalance));
|
|
|
+ System.out.println("*****************************");
|
|
|
+ productionScheduleRetVo.setScoreResult(scoreManager.explain(solvedBalance).toString());
|
|
|
return productionScheduleRetVo;
|
|
|
}
|
|
|
|