Search in sources :

Example 1 with ConstructionHeuristicPhaseConfig

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();
}
Also used : TerminationConfig(org.optaplanner.core.config.solver.termination.TerminationConfig) TaskAssigningSolution(org.kie.kogito.taskassigning.core.model.TaskAssigningSolution) LocalSearchPhaseConfig(org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig) ConstructionHeuristicPhaseConfig(org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 2 with ConstructionHeuristicPhaseConfig

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);
}
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 3 with ConstructionHeuristicPhaseConfig

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();
}
Also used : VehicleRoutingSolution(org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution) ConstructionHeuristicPhaseConfig(org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 4 with ConstructionHeuristicPhaseConfig

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);
}
Also used : FlightCrewSolution(org.optaplanner.examples.flightcrewscheduling.domain.FlightCrewSolution) ConstructionHeuristicPhaseConfig(org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 5 with ConstructionHeuristicPhaseConfig

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();
}
Also used : TerminationConfig(org.optaplanner.core.config.solver.termination.TerminationConfig) TaskAssigningSolution(org.kie.server.services.taskassigning.core.model.TaskAssigningSolution) LocalSearchPhaseConfig(org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig) ConstructionHeuristicPhaseConfig(org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Aggregations

ConstructionHeuristicPhaseConfig (org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig)10 SolverConfig (org.optaplanner.core.config.solver.SolverConfig)9 LocalSearchPhaseConfig (org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig)5 TerminationConfig (org.optaplanner.core.config.solver.termination.TerminationConfig)4 ScoreDirectorFactoryConfig (org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig)2 ConferenceSchedulingTermination (org.jboss.qa.brms.performance.examples.conferencescheduling.termination.ConferenceSchedulingTermination)1 CloudBalance (org.kie.karaf.itest.planner.domain.CloudBalance)1 TaskAssigningSolution (org.kie.kogito.taskassigning.core.model.TaskAssigningSolution)1 TaskAssigningSolution (org.kie.server.services.taskassigning.core.model.TaskAssigningSolution)1 MoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.MoveSelectorConfig)1 UnionMoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig)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 LocalSearchForagerConfig (org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig)1 ConferenceSolution (org.optaplanner.examples.conferencescheduling.domain.ConferenceSolution)1 FlightCrewSolution (org.optaplanner.examples.flightcrewscheduling.domain.FlightCrewSolution)1 NurseRoster (org.optaplanner.examples.nurserostering.domain.NurseRoster)1