use of org.optaplanner.core.config.solver.SolverConfig 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.core.config.solver.SolverConfig 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.core.config.solver.SolverConfig in project kie-benchmarks by kiegroup.
the class AbstractCloudBalanceLocalSearchBenchmark method createSolver.
@Override
protected Solver<CloudBalance> 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.CLOUD_BALANCING.getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(localSearchPhaseConfig));
SolverFactory<CloudBalance> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.core.config.solver.SolverConfig in project kie-benchmarks by kiegroup.
the class ConferenceSchedulingExample method getBaseSolverConfig.
@Override
public SolverConfig getBaseSolverConfig() {
SolverConfig solverConfig = new SolverConfig();
solverConfig.withEntityClasses(Talk.class);
solverConfig.withSolutionClass(ConferenceSolution.class);
solverConfig.setScoreDirectorFactoryConfig(new ScoreDirectorFactoryConfig());
solverConfig.getScoreDirectorFactoryConfig().setInitializingScoreTrend("ONLY_DOWN");
solverConfig.getScoreDirectorFactoryConfig().setConstraintProviderClass(ConferenceSchedulingConstraintProvider.class);
return solverConfig;
}
use of org.optaplanner.core.config.solver.SolverConfig in project kie-benchmarks by kiegroup.
the class FlightCrewSchedulingExample method createInitialSolution.
public FlightCrewSolution createInitialSolution(DataSet dataSet) {
ConstructionHeuristicPhaseConfig chPhaseConfig = new ConstructionHeuristicPhaseConfig();
SolverConfig solverConfig = Examples.FLIGHT_CREW_SCHEDULING.getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(chPhaseConfig));
SolverFactory<FlightCrewSolution> solverFactory = SolverFactory.create(solverConfig);
Solver<FlightCrewSolution> constructionSolver = solverFactory.buildSolver();
FlightCrewSolution solution = Examples.FLIGHT_CREW_SCHEDULING.loadSolvingProblem(dataSet);
return constructionSolver.solve(solution);
}
Aggregations