Search in sources :

Example 6 with LocalSearchForagerConfig

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

Example 7 with LocalSearchForagerConfig

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

Example 8 with LocalSearchForagerConfig

use of org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig 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();
}
Also used : LocalSearchForagerConfig(org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig) CloudBalance(org.optaplanner.examples.cloudbalancing.domain.CloudBalance) 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