我正在尝试使用 OptaPlanner 解决 VRP。我用约束提供者、规划实体和规划解决方案等编写了所有代码。问题是,我试图通过以下方式获取解决方案
SolverConfig solverConfig = new SolverConfig();
solverConfig.withSolutionClass(Solution.class);
solverConfig.withEntityClasses(Stop.class, Standstill.class);
ScoreDirectorFactoryConfig scoreDirectorFactoryConfig = new ScoreDirectorFactoryConfig();
scoreDirectorFactoryConfig.setConstraintProviderClass(VrpConstraintProvider.class);
solverConfig.withScoreDirectorFactory(scoreDirectorFactoryConfig);
SolverFactory<Solution> solverFactory = SolverFactory.create(solverConfig);
Solver<Solution> solver = solverFactory.buildSolver();
Solution solution = solver.solve(solutionDef);
但这会导致无休止的等待解决方案。有什么想法是什么原因吗?提前致谢。