Search in sources :

Example 26 with SolverConfig

use of org.optaplanner.core.config.solver.SolverConfig in project kie-benchmarks by kiegroup.

the class NurseRosteringExample method getBaseSolverConfig.

@Override
public SolverConfig getBaseSolverConfig() {
    SolverConfig solverConfig = new SolverConfig();
    solverConfig.withEntityClasses(ShiftAssignment.class);
    solverConfig.withSolutionClass(NurseRoster.class);
    solverConfig.setScoreDirectorFactoryConfig(new ScoreDirectorFactoryConfig());
    solverConfig.getScoreDirectorFactoryConfig().setConstraintProviderClass(NurseRosteringConstraintProvider.class);
    solverConfig.getScoreDirectorFactoryConfig().setInitializingScoreTrend("ONLY_DOWN");
    return solverConfig;
}
Also used : ScoreDirectorFactoryConfig(org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 27 with SolverConfig

use of org.optaplanner.core.config.solver.SolverConfig in project kie-benchmarks by kiegroup.

the class ProjectJobSchedulingExample method getBaseSolverConfig.

@Override
public SolverConfig getBaseSolverConfig() {
    SolverConfig solverConfig = new SolverConfig();
    solverConfig.setEnvironmentMode(EnvironmentMode.REPRODUCIBLE);
    solverConfig.withEntityClasses(Allocation.class);
    solverConfig.withSolutionClass(Schedule.class);
    solverConfig.setScoreDirectorFactoryConfig(new ScoreDirectorFactoryConfig());
    solverConfig.getScoreDirectorFactoryConfig().setIncrementalScoreCalculatorClass(ProjectJobSchedulingIncrementalScoreCalculator.class);
    solverConfig.getScoreDirectorFactoryConfig().setInitializingScoreTrend("ONLY_DOWN");
    return solverConfig;
}
Also used : ScoreDirectorFactoryConfig(org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 28 with SolverConfig

use of org.optaplanner.core.config.solver.SolverConfig in project kie-benchmarks by kiegroup.

the class VehicleRoutingExample method getBaseSolverConfig.

@Override
public SolverConfig getBaseSolverConfig() {
    SolverConfig solverConfig = new SolverConfig();
    solverConfig.withEntityClassList(new ArrayList<>(Arrays.asList(Standstill.class, Customer.class)));
    solverConfig.withSolutionClass(VehicleRoutingSolution.class);
    solverConfig.setEnvironmentMode(EnvironmentMode.REPRODUCIBLE);
    solverConfig.setScoreDirectorFactoryConfig(new ScoreDirectorFactoryConfig());
    solverConfig.getScoreDirectorFactoryConfig().setIncrementalScoreCalculatorClass(VehicleRoutingIncrementalScoreCalculator.class);
    solverConfig.getScoreDirectorFactoryConfig().setInitializingScoreTrend("ONLY_DOWN");
    return solverConfig;
}
Also used : ScoreDirectorFactoryConfig(org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Example 29 with SolverConfig

use of org.optaplanner.core.config.solver.SolverConfig 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)

Example 30 with SolverConfig

use of org.optaplanner.core.config.solver.SolverConfig in project droolsjbpm-integration by kiegroup.

the class AbstractTaskAssigningCoreTest method createBaseConfig.

protected SolverConfig createBaseConfig() {
    SolverConfig config = new SolverConfig();
    config.setSolutionClass(TaskAssigningSolution.class);
    config.setEntityClassList(Arrays.asList(TaskOrUser.class, Task.class));
    config.setScoreDirectorFactoryConfig(new ScoreDirectorFactoryConfig().withScoreDrls("org/kie/server/services/taskassigning/solver/taskAssigningScoreRules.drl"));
    return config;
}
Also used : ScoreDirectorFactoryConfig(org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig) Task(org.kie.server.services.taskassigning.core.model.Task) TaskOrUser(org.kie.server.services.taskassigning.core.model.TaskOrUser) SolverConfig(org.optaplanner.core.config.solver.SolverConfig)

Aggregations

SolverConfig (org.optaplanner.core.config.solver.SolverConfig)54 TerminationConfig (org.optaplanner.core.config.solver.termination.TerminationConfig)17 ScoreDirectorFactoryConfig (org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig)14 LocalSearchPhaseConfig (org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig)12 CounterfactualPrediction (org.kie.kogito.explainability.model.CounterfactualPrediction)11 Prediction (org.kie.kogito.explainability.model.Prediction)11 PredictionInput (org.kie.kogito.explainability.model.PredictionInput)11 PredictionOutput (org.kie.kogito.explainability.model.PredictionOutput)11 Feature (org.kie.kogito.explainability.model.Feature)10 Output (org.kie.kogito.explainability.model.Output)10 PredictionProvider (org.kie.kogito.explainability.model.PredictionProvider)10 Test (org.junit.jupiter.api.Test)9 ConstructionHeuristicPhaseConfig (org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig)9 LinkedList (java.util.LinkedList)7 CounterfactualEntity (org.kie.kogito.explainability.local.counterfactual.entities.CounterfactualEntity)7 LocalSearchForagerConfig (org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig)7 VehicleRoutingSolution (org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution)7 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 Value (org.kie.kogito.explainability.model.Value)6 UnionMoveSelectorConfig (org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig)6