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();
}
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();
}
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();
}
Aggregations