All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.optaplanner.OptaPlannerBeanProvider Maven / Gradle / Ivy

Go to download

Constraint solving AI for employee rostering, vehicle routing, maintenance scheduling, school timetabling, etc

There is a newer version: 1.5.2.Final
Show newest version
package io.quarkus.optaplanner;

import javax.enterprise.inject.Produces;
import javax.inject.Singleton;

import org.optaplanner.core.api.score.ScoreManager;
import org.optaplanner.core.api.solver.SolverFactory;
import org.optaplanner.core.api.solver.SolverManager;
import org.optaplanner.core.config.solver.SolverConfig;
import org.optaplanner.core.config.solver.SolverManagerConfig;

import io.quarkus.arc.DefaultBean;

public class OptaPlannerBeanProvider {

    @DefaultBean
    @Singleton
    @Produces
     SolverFactory solverFactory(SolverConfig solverConfig) {
        return SolverFactory.create(solverConfig);
    }

    @DefaultBean
    @Singleton
    @Produces
     SolverManager solverManager(SolverFactory solverFactory,
            SolverManagerConfig solverManagerConfig) {
        return SolverManager.create(solverFactory, solverManagerConfig);
    }

    @DefaultBean
    @Singleton
    @Produces
     ScoreManager scoreManager(SolverFactory solverFactory) {
        return ScoreManager.create(solverFactory);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy