use of org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution 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.examples.vehiclerouting.domain.VehicleRoutingSolution in project kie-benchmarks by kiegroup.
the class AbstractVRPLocalSearchBenchmark method createSolver.
@Override
protected Solver<VehicleRoutingSolution> createSolver() {
LocalSearchPhaseConfig localSearchPhaseConfig = new LocalSearchPhaseConfig();
localSearchPhaseConfig.setMoveSelectorConfig(new UnionMoveSelectorConfig());
((UnionMoveSelectorConfig) localSearchPhaseConfig.getMoveSelectorConfig()).setMoveSelectorConfigList(createMoveSelectorConfigList());
localSearchPhaseConfig.setAcceptorConfig(createAcceptorConfig());
localSearchPhaseConfig.setForagerConfig(new LocalSearchForagerConfig());
localSearchPhaseConfig.getForagerConfig().setAcceptedCountLimit(getAcceptedCountLimit());
localSearchPhaseConfig.setTerminationConfig(getTerminationConfig());
SolverConfig solverConfig = Examples.VEHICLE_ROUTING.getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(localSearchPhaseConfig));
SolverFactory<VehicleRoutingSolution> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution in project kie-benchmarks by kiegroup.
the class AbstractVRPTWLocalSearchBenchmark method createSolver.
@Override
protected Solver<VehicleRoutingSolution> createSolver() {
SolverConfig solverConfig = Examples.VEHICLE_ROUTING.getBaseSolverConfig();
solverConfig.getEntityClassList().add(TimeWindowedCustomer.class);
LocalSearchPhaseConfig localSearchPhaseConfig = new LocalSearchPhaseConfig();
localSearchPhaseConfig.setMoveSelectorConfig(new UnionMoveSelectorConfig());
((UnionMoveSelectorConfig) localSearchPhaseConfig.getMoveSelectorConfig()).setMoveSelectorConfigList(createMoveSelectorConfigList());
localSearchPhaseConfig.setAcceptorConfig(createAcceptorConfig());
localSearchPhaseConfig.setForagerConfig(new LocalSearchForagerConfig());
localSearchPhaseConfig.getForagerConfig().setAcceptedCountLimit(getAcceptedCountLimit());
localSearchPhaseConfig.setTerminationConfig(getTerminationConfig());
solverConfig.setPhaseConfigList(Collections.singletonList(localSearchPhaseConfig));
SolverFactory<VehicleRoutingSolution> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution in project kie-benchmarks by kiegroup.
the class VRPTimeWindowedConstructionBenchmark method createSolver.
@Override
protected Solver<VehicleRoutingSolution> createSolver() {
SolverConfig solverConfig = Examples.VEHICLE_ROUTING.getBaseSolverConfig();
ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = new ConstructionHeuristicPhaseConfig().withConstructionHeuristicType(getConstructionHeuristicType());
solverConfig.setPhaseConfigList(Collections.singletonList(constructionHeuristicPhaseConfig));
// diff between normal VRP and TimeWindowed
solverConfig.getEntityClassList().add(TimeWindowedCustomer.class);
SolverFactory<VehicleRoutingSolution> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution in project kie-benchmarks by kiegroup.
the class VehicleRoutingBenchmark method createSolver.
@Override
protected Solver<VehicleRoutingSolution> createSolver() {
// the pre-defined configuration in VehicleRouting cannot be used
SolverConfig solverConfig = new SolverConfig();
solverConfig.withEntityClasses(Standstill.class, Customer.class, TimeWindowedCustomer.class);
solverConfig.withSolutionClass(VehicleRoutingSolution.class);
ScoreDirectorFactoryConfig scoreDirectorFactoryConfig = new ScoreDirectorFactoryConfig();
scoreDirectorFactoryConfig.setInitializingScoreTrend("ONLY_DOWN");
scoreDirectorFactoryConfig.setConstraintProviderClass(VehicleRoutingConstraintProvider.class);
solverConfig.setPhaseConfigList(getPhaseConfigList());
solverConfig.setScoreDirectorFactoryConfig(scoreDirectorFactoryConfig);
solverConfig.setTerminationConfig(new TerminationConfig().withTerminationClass(HardVRPCalculateCountTermination.class));
SolverFactory<VehicleRoutingSolution> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
Aggregations