use of org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig in project kie-benchmarks by kiegroup.
the class VehicleRoutingBenchmark method getPhaseConfigList.
private List<PhaseConfig> getPhaseConfigList() {
ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = new ConstructionHeuristicPhaseConfig();
constructionHeuristicPhaseConfig.setConstructionHeuristicType(ConstructionHeuristicType.FIRST_FIT_DECREASING);
LocalSearchPhaseConfig localSearchPhaseConfig = new LocalSearchPhaseConfig();
SubChainChangeMoveSelectorConfig subChainChangeMoveSelectorConfig = new SubChainChangeMoveSelectorConfig();
subChainChangeMoveSelectorConfig.setSelectReversingMoveToo(true);
SubChainSwapMoveSelectorConfig subChainSwapMoveSelectorConfig = new SubChainSwapMoveSelectorConfig();
subChainSwapMoveSelectorConfig.setSelectReversingMoveToo(true);
List<MoveSelectorConfig> moveSelectorConfigList = Arrays.asList(new ChangeMoveSelectorConfig(), new SwapMoveSelectorConfig(), subChainChangeMoveSelectorConfig, subChainSwapMoveSelectorConfig);
UnionMoveSelectorConfig selectorConfig = new UnionMoveSelectorConfig(moveSelectorConfigList);
LocalSearchForagerConfig foragerConfig = new LocalSearchForagerConfig();
foragerConfig.setAcceptedCountLimit(FORAGER_CONFIG_ACCEPTED_COUNT_LIMIT);
localSearchPhaseConfig.setForagerConfig(foragerConfig);
localSearchPhaseConfig.setMoveSelectorConfig(selectorConfig);
localSearchPhaseConfig.setAcceptorConfig(new LocalSearchAcceptorConfig().withLateAcceptanceSize(ACCEPTOR_CONFIG_LATE_ACCEPTANCE_SIZE));
return Arrays.asList(constructionHeuristicPhaseConfig, localSearchPhaseConfig);
}
use of org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig in project kie-benchmarks by kiegroup.
the class AbstractMultithreadedSolvingScalabilityBenchmark method createSolver.
@Override
public Solver<Solution_> createSolver() {
SolverConfig solverConfig = getBaseSolverConfig();
solverConfig.setMoveThreadCount(moveThreadCount);
LocalSearchPhaseConfig localSearchPhaseConfig = new LocalSearchPhaseConfig();
localSearchPhaseConfig.setMoveSelectorConfig(getMoveSelectorConfig());
localSearchPhaseConfig.setAcceptorConfig(getAcceptorConfig());
localSearchPhaseConfig.setForagerConfig(new LocalSearchForagerConfig());
localSearchPhaseConfig.getForagerConfig().setAcceptedCountLimit(getAcceptedCountLimit());
localSearchPhaseConfig.setTerminationConfig(getTerminationConfig());
solverConfig.setPhaseConfigList(Collections.singletonList(localSearchPhaseConfig));
SolverFactory<Solution_> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig in project kie-benchmarks by kiegroup.
the class AbstractTSPLocalSearchBenchmark method createSolver.
@Override
protected Solver<TspSolution> 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.TRAVELING_SALESMAN.getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(localSearchPhaseConfig));
SolverFactory<TspSolution> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig in project kie-benchmarks by kiegroup.
the class AbstractNurseRosteringMoveSelectorBenchmark method createSolver.
@Override
protected Solver<NurseRoster> createSolver() {
LocalSearchPhaseConfig localSearchPhaseConfig = new LocalSearchPhaseConfig();
UnionMoveSelectorConfig unionMoveSelectorConfig = new UnionMoveSelectorConfig();
unionMoveSelectorConfig.setMoveSelectorConfigList(createMoveSelectorConfigList());
localSearchPhaseConfig.setMoveSelectorConfig(unionMoveSelectorConfig);
localSearchPhaseConfig.setAcceptorConfig(createAcceptorConfig());
localSearchPhaseConfig.setForagerConfig(new LocalSearchForagerConfig());
localSearchPhaseConfig.getForagerConfig().setAcceptedCountLimit(getAcceptedCountLimit());
localSearchPhaseConfig.setTerminationConfig(getTerminationConfig());
SolverConfig solverConfig = Examples.NURSE_ROSTERING.getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(localSearchPhaseConfig));
SolverFactory<NurseRoster> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig in project kie-benchmarks by kiegroup.
the class AbstractProjectJobSchedulingLocalSearchBenchmark method createSolver.
@Override
protected Solver<Schedule> 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.PROJECT_JOB_SCHEDULING.getBaseSolverConfig();
solverConfig.setPhaseConfigList(Collections.singletonList(localSearchPhaseConfig));
SolverFactory<Schedule> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
Aggregations