我正在修改 optaplanner-webexamples vrp。所以我有点使用 spring-boot,我编辑了一些模型等。
但是在运行 solve 时,它会在 VehicleRoutingSolution 类上产生 ClassCastException
java.lang.ClassCastException: id.co.asyst.vrp.core.solution.VehicleRoutingSolution cannot be cast to id.co.asyst.vrp.core.solution.VehicleRoutingSolution
at org.optaplanner.core.impl.domain.common.accessor.LambdaBeanPropertyMemberAccessor.executeGetter(LambdaBeanPropertyMemberAccessor.java:120)
at org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor.getScore(SolutionDescriptor.java:1071)
at org.optaplanner.core.impl.score.director.AbstractScoreDirector.cloneSolution(AbstractScoreDirector.java:212)
at org.optaplanner.core.impl.solver.scope.DefaultSolverScope.setWorkingSolutionFromBestSolution(DefaultSolverScope.java:230)
at org.optaplanner.core.impl.solver.AbstractSolver.solvingStarted(AbstractSolver.java:75)
at org.optaplanner.core.impl.solver.DefaultSolver.solvingStarted(DefaultSolver.java:210)
at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:190)
at id.co.asyst.vrp.rest.cdi.VehicleRoutingSolverManager.lambda$solve$1(VehicleRoutingSolverManager.java:105)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
我哪里做错了?我直接从 optaplanner-webexamples 获取的大部分代码对模型进行了很少的修改。大多只是表关系。
Qyouu
慕后森
尚方宝剑之说
相关分类