use of org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig in project kogito-apps by kiegroup.
the class AbstractTaskAssigningCoreTest method createNonDaemonSolver.
protected Solver<TaskAssigningSolution> createNonDaemonSolver(int stepCountLimit) {
SolverConfig config = createBaseConfig();
ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = new ConstructionHeuristicPhaseConfig();
constructionHeuristicPhaseConfig.setConstructionHeuristicType(ConstructionHeuristicType.FIRST_FIT);
LocalSearchPhaseConfig phaseConfig = new LocalSearchPhaseConfig();
phaseConfig.setTerminationConfig(new TerminationConfig().withStepCountLimit(stepCountLimit));
config.setPhaseConfigList(Arrays.asList(constructionHeuristicPhaseConfig, phaseConfig));
SolverFactory<TaskAssigningSolution> solverFactory = SolverFactory.create(config);
return solverFactory.buildSolver();
}
use of org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig 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.constructionheuristic.ConstructionHeuristicPhaseConfig 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.constructionheuristic.ConstructionHeuristicPhaseConfig 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);
}
use of org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig in project droolsjbpm-integration by kiegroup.
the class AbstractTaskAssigningCoreTest method createNonDaemonSolver.
protected Solver<TaskAssigningSolution> createNonDaemonSolver(int stepCountLimit) {
SolverConfig config = createBaseConfig();
ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = new ConstructionHeuristicPhaseConfig();
constructionHeuristicPhaseConfig.setConstructionHeuristicType(ConstructionHeuristicType.FIRST_FIT);
LocalSearchPhaseConfig phaseConfig = new LocalSearchPhaseConfig();
phaseConfig.setTerminationConfig(new TerminationConfig().withStepCountLimit(stepCountLimit));
config.setPhaseConfigList(Arrays.asList(constructionHeuristicPhaseConfig, phaseConfig));
SolverFactory<TaskAssigningSolution> solverFactory = SolverFactory.create(config);
return solverFactory.buildSolver();
}
Aggregations