Search in sources :

Example 1 with LocalSearchForagerConfig

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);
}
Also used : SubChainSwapMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainSwapMoveSelectorConfig) SwapMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.SwapMoveSelectorConfig) SubChainChangeMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainChangeMoveSelectorConfig) ChangeMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.ChangeMoveSelectorConfig) MoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.MoveSelectorConfig) UnionMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig) SubChainSwapMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainSwapMoveSelectorConfig) SwapMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.SwapMoveSelectorConfig) LocalSearchForagerConfig(org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig) LocalSearchAcceptorConfig(org.optaplanner.core.config.localsearch.decider.acceptor.LocalSearchAcceptorConfig) SubChainChangeMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainChangeMoveSelectorConfig) ChangeMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.ChangeMoveSelectorConfig) LocalSearchPhaseConfig(org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig) ConstructionHeuristicPhaseConfig(org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig) SubChainSwapMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainSwapMoveSelectorConfig) SubChainChangeMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainChangeMoveSelectorConfig) UnionMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig)

Example 2 with LocalSearchForagerConfig

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();
}
Also used : LocalSearchForagerConfig(org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig) LocalSearchPhaseConfig(org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 3 with LocalSearchForagerConfig

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();
}
Also used : LocalSearchForagerConfig(org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig) LocalSearchPhaseConfig(org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig) TspSolution(org.optaplanner.examples.tsp.domain.TspSolution) UnionMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 4 with LocalSearchForagerConfig

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();
}
Also used : LocalSearchForagerConfig(org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig) LocalSearchPhaseConfig(org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig) NurseRoster(org.optaplanner.examples.nurserostering.domain.NurseRoster) UnionMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 5 with LocalSearchForagerConfig

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();
}
Also used : LocalSearchForagerConfig(org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig) Schedule(org.optaplanner.examples.projectjobscheduling.domain.Schedule) LocalSearchPhaseConfig(org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig) UnionMoveSelectorConfig(org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Aggregations

LocalSearchPhaseConfig (org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig)8 LocalSearchForagerConfig (org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig)8 UnionMoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig)7 SolverConfig (org.optaplanner.core.config.solver.SolverConfig)7 VehicleRoutingSolution (org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution)2 ConstructionHeuristicPhaseConfig (org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig)1 MoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.MoveSelectorConfig)1 ChangeMoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.generic.ChangeMoveSelectorConfig)1 SwapMoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.generic.SwapMoveSelectorConfig)1 SubChainChangeMoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainChangeMoveSelectorConfig)1 SubChainSwapMoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainSwapMoveSelectorConfig)1 LocalSearchAcceptorConfig (org.optaplanner.core.config.localsearch.decider.acceptor.LocalSearchAcceptorConfig)1 CloudBalance (org.optaplanner.examples.cloudbalancing.domain.CloudBalance)1 NurseRoster (org.optaplanner.examples.nurserostering.domain.NurseRoster)1 Schedule (org.optaplanner.examples.projectjobscheduling.domain.Schedule)1 TspSolution (org.optaplanner.examples.tsp.domain.TspSolution)1