use of org.optaplanner.core.config.phase.custom.CustomPhaseConfig in project kie-benchmarks by kiegroup.
the class VRPMultithreadedSolvingScalabilityBenchmark method createInitialSolution.
@Override
protected VehicleRoutingSolution createInitialSolution() {
CustomPhaseConfig customPhaseConfig = new CustomPhaseConfig();
customPhaseConfig.setCustomPhaseCommandClassList(Collections.singletonList(VehicleRoutingSolutionInitializer.class));
SolverConfig solverConfig = getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(customPhaseConfig));
SolverFactory<VehicleRoutingSolution> solverFactory = SolverFactory.create(solverConfig);
Solver<VehicleRoutingSolution> constructionSolver = solverFactory.buildSolver();
VehicleRoutingSolution solution = Examples.VEHICLE_ROUTING.loadSolvingProblem(dataset);
return constructionSolver.solve(solution);
}
use of org.optaplanner.core.config.phase.custom.CustomPhaseConfig in project kie-benchmarks by kiegroup.
the class CloudBalancingMultithreadedSolvingScalabilityBenchmark method createInitialSolution.
@Override
protected CloudBalance createInitialSolution() {
CustomPhaseConfig customPhaseConfig = new CustomPhaseConfig();
customPhaseConfig.setCustomPhaseCommandClassList(Collections.singletonList(CloudBalanceSolutionInitializer.class));
SolverConfig solverConfig = getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(customPhaseConfig));
SolverFactory<CloudBalance> solverFactory = SolverFactory.create(solverConfig);
Solver<CloudBalance> constructionSolver = solverFactory.buildSolver();
CloudBalance solution = Examples.CLOUD_BALANCING.loadSolvingProblem(dataset);
return constructionSolver.solve(solution);
}
use of org.optaplanner.core.config.phase.custom.CustomPhaseConfig in project kie-benchmarks by kiegroup.
the class AbstractTSPLocalSearchBenchmark method createInitialSolution.
@Override
protected TspSolution createInitialSolution() {
CustomPhaseConfig customPhaseConfig = new CustomPhaseConfig();
customPhaseConfig.setCustomPhaseCommandClassList(Collections.singletonList(TSPSolutionInitializer.class));
SolverConfig solverConfig = Examples.TRAVELING_SALESMAN.getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(customPhaseConfig));
SolverFactory<TspSolution> solverFactory = SolverFactory.create(solverConfig);
Solver<TspSolution> constructionSolver = solverFactory.buildSolver();
TspSolution solution = Examples.TRAVELING_SALESMAN.loadSolvingProblem(dataset);
return constructionSolver.solve(solution);
}
use of org.optaplanner.core.config.phase.custom.CustomPhaseConfig in project kie-benchmarks by kiegroup.
the class VehicleRoutingExample method createInitialSolution.
public VehicleRoutingSolution createInitialSolution(DataSet dataSet) {
CustomPhaseConfig customPhaseConfig = new CustomPhaseConfig();
customPhaseConfig.setCustomPhaseCommandClassList(Collections.singletonList(VehicleRoutingSolutionInitializer.class));
SolverConfig solverConfig = Examples.VEHICLE_ROUTING.getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(customPhaseConfig));
SolverFactory<VehicleRoutingSolution> solverFactory = SolverFactory.create(solverConfig);
Solver<VehicleRoutingSolution> constructionSolver = solverFactory.buildSolver();
VehicleRoutingSolution solution = Examples.VEHICLE_ROUTING.loadSolvingProblem(dataSet);
return constructionSolver.solve(solution);
}
use of org.optaplanner.core.config.phase.custom.CustomPhaseConfig in project kie-benchmarks by kiegroup.
the class AbstractVRPTWLocalSearchBenchmark method createInitialSolution.
@Override
protected VehicleRoutingSolution createInitialSolution() {
SolverConfig solverConfig = Examples.VEHICLE_ROUTING.getBaseSolverConfig();
// different from simple VRP
solverConfig.getEntityClassList().add(TimeWindowedCustomer.class);
CustomPhaseConfig customPhaseConfig = new CustomPhaseConfig();
customPhaseConfig.setCustomPhaseCommandClassList(Collections.singletonList(VehicleRoutingSolutionInitializer.class));
solverConfig.setPhaseConfigList(Collections.singletonList(customPhaseConfig));
SolverFactory<VehicleRoutingSolution> solverFactory = SolverFactory.create(solverConfig);
Solver<VehicleRoutingSolution> constructionSolver = solverFactory.buildSolver();
VehicleRoutingSolution solution = Examples.VEHICLE_ROUTING.loadSolvingProblem(dataset);
return constructionSolver.solve(solution);
}
Aggregations