use of org.optaplanner.core.config.solver.termination.TerminationConfig 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();
}
use of org.optaplanner.core.config.solver.termination.TerminationConfig in project kie-benchmarks by kiegroup.
the class ConferenceSchedulingBenchmark method createSolver.
@Override
protected Solver<ConferenceSolution> createSolver() {
// the pre-defined configuration in ConferenceScheduling cannot be used
SolverConfig solverConfig = new SolverConfig();
solverConfig.withEntityClasses(Talk.class);
solverConfig.withSolutionClass(ConferenceSolution.class);
ScoreDirectorFactoryConfig scoreDirectorFactoryConfig = new ScoreDirectorFactoryConfig();
scoreDirectorFactoryConfig.setConstraintProviderClass(ConferenceSchedulingConstraintProvider.class);
LocalSearchPhaseConfig localSearchPhaseConfig = new LocalSearchPhaseConfig();
localSearchPhaseConfig.setLocalSearchType(LocalSearchType.TABU_SEARCH);
solverConfig.setPhaseConfigList(Arrays.asList(new ConstructionHeuristicPhaseConfig(), localSearchPhaseConfig));
solverConfig.setScoreDirectorFactoryConfig(scoreDirectorFactoryConfig);
solverConfig.setTerminationConfig(new TerminationConfig().withTerminationClass(ConferenceSchedulingTermination.class));
SolverFactory<ConferenceSolution> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.core.config.solver.termination.TerminationConfig in project kie-benchmarks by kiegroup.
the class VehicleRoutingBenchmark method createSolver.
@Override
protected Solver<VehicleRoutingSolution> createSolver() {
// the pre-defined configuration in VehicleRouting cannot be used
SolverConfig solverConfig = new SolverConfig();
solverConfig.withEntityClasses(Standstill.class, Customer.class, TimeWindowedCustomer.class);
solverConfig.withSolutionClass(VehicleRoutingSolution.class);
ScoreDirectorFactoryConfig scoreDirectorFactoryConfig = new ScoreDirectorFactoryConfig();
scoreDirectorFactoryConfig.setInitializingScoreTrend("ONLY_DOWN");
scoreDirectorFactoryConfig.setConstraintProviderClass(VehicleRoutingConstraintProvider.class);
solverConfig.setPhaseConfigList(getPhaseConfigList());
solverConfig.setScoreDirectorFactoryConfig(scoreDirectorFactoryConfig);
solverConfig.setTerminationConfig(new TerminationConfig().withTerminationClass(HardVRPCalculateCountTermination.class));
SolverFactory<VehicleRoutingSolution> solverFactory = SolverFactory.create(solverConfig);
return solverFactory.buildSolver();
}
use of org.optaplanner.core.config.solver.termination.TerminationConfig in project kie-benchmarks by kiegroup.
the class CloudBalancingMultithreadedSolvingScalabilityBenchmark method getTerminationConfig.
@Override
protected TerminationConfig getTerminationConfig() {
TerminationConfig terminationConfig = new TerminationConfig();
terminationConfig.setStepCountLimit(500);
return terminationConfig;
}
use of org.optaplanner.core.config.solver.termination.TerminationConfig in project kie-benchmarks by kiegroup.
the class AbstractProjectJobSchedulingMoveSelectorBenchmark method getTerminationConfig.
@Override
public TerminationConfig getTerminationConfig() {
TerminationConfig terminationConfig = new TerminationConfig();
terminationConfig.setTerminationClass(ProjectJobSchedulingCalculateCountTermination.class);
return terminationConfig;
}
Aggregations