Package org.drools.planner.config

Examples of org.drools.planner.config.XmlSolverFactory


        new TrainDesignApp().init();
    }

    @Override
    protected Solver createSolver() {
        XmlSolverFactory solverFactory = new XmlSolverFactory();
        solverFactory.configure(SOLVER_CONFIG);
        return solverFactory.buildSolver();
    }
View Full Code Here


        new NQueensApp().init();
    }

    @Override
    protected Solver createSolver() {
        XmlSolverFactory solverFactory = new XmlSolverFactory();
        solverFactory.configure(SOLVER_CONFIG);
        return solverFactory.buildSolver();
    }
View Full Code Here

    protected void runSpeedTest(File unsolvedDataFile, String scoreAttainedString) {
        runSpeedTest(unsolvedDataFile, scoreAttainedString, EnvironmentMode.PRODUCTION);
    }

    protected void runSpeedTest(File unsolvedDataFile, String scoreAttainedString, EnvironmentMode environmentMode) {
        XmlSolverFactory solverFactory = buildSolverFactory(scoreAttainedString, environmentMode);
        Solver solver = solve(solverFactory, unsolvedDataFile);
        assertBestSolution(solver, scoreAttainedString);
    }
View Full Code Here

        Solver solver = solve(solverFactory, unsolvedDataFile);
        assertBestSolution(solver, scoreAttainedString);
    }

    private XmlSolverFactory buildSolverFactory(String scoreAttainedString, EnvironmentMode environmentMode) {
        XmlSolverFactory solverFactory = new XmlSolverFactory();
        solverFactory.configure(createSolverConfigResource());
        solverFactory.getSolverConfig().setEnvironmentMode(environmentMode);
        TerminationConfig terminationConfig = new TerminationConfig();
        terminationConfig.setScoreAttained(scoreAttainedString);
        solverFactory.getSolverConfig().setTerminationConfig(terminationConfig);
        return solverFactory;
    }
View Full Code Here

public class VrpWebAction {

    private static ExecutorService solvingExecutor = Executors.newFixedThreadPool(4);

    public void setup(HttpSession session) {
        SolverFactory solverFactory = new XmlSolverFactory(
                "/org/drools/planner/examples/vehiclerouting/solver/vehicleRoutingSolverConfig.xml");
        Solver solver = solverFactory.buildSolver();
        session.setAttribute(VrpSessionAttributeName.SOLVER, solver);

        URL unsolvedSolutionURL = getClass().getResource("/org/drools/planner/webexamples/vehiclerouting/A-n33-k6.vrp");
        VrpSchedule unsolvedSolution = (VrpSchedule) new VehicleRoutingSolutionImporter()
                .readSolution(unsolvedSolutionURL);
View Full Code Here

        new CurriculumCourseApp().init();
    }

    @Override
    protected Solver createSolver() {
        XmlSolverFactory solverFactory = new XmlSolverFactory();
        solverFactory.configure(SOLVER_CONFIG);
        return solverFactory.buildSolver();
    }
View Full Code Here

        new Manners2009App().init();
    }

    @Override
    protected Solver createSolver() {
        XmlSolverFactory solverFactory = new XmlSolverFactory();
        solverFactory.configure(SOLVER_CONFIG);
        return solverFactory.buildSolver();
    }
View Full Code Here

    protected void runSpeedTest(File unsolvedDataFile, String scoreAttainedString) {
        runSpeedTest(unsolvedDataFile, scoreAttainedString, EnvironmentMode.REPRODUCIBLE);
    }

    protected void runSpeedTest(File unsolvedDataFile, String scoreAttainedString, EnvironmentMode environmentMode) {
        XmlSolverFactory solverFactory = buildSolverFactory(scoreAttainedString, environmentMode);
        Solver solver = solve(solverFactory, unsolvedDataFile);
        assertBestSolution(solver, scoreAttainedString);
    }
View Full Code Here

        Solver solver = solve(solverFactory, unsolvedDataFile);
        assertBestSolution(solver, scoreAttainedString);
    }

    private XmlSolverFactory buildSolverFactory(String scoreAttainedString, EnvironmentMode environmentMode) {
        XmlSolverFactory solverFactory = new XmlSolverFactory();
        solverFactory.configure(createSolverConfigResource());
        solverFactory.getSolverConfig().setEnvironmentMode(environmentMode);
        TerminationConfig terminationConfig = new TerminationConfig();
        terminationConfig.setScoreAttained(scoreAttainedString);
        solverFactory.getSolverConfig().setTerminationConfig(terminationConfig);
        return solverFactory;
    }
View Full Code Here

        new TspApp().init();
    }

    @Override
    protected Solver createSolver() {
        XmlSolverFactory solverFactory = new XmlSolverFactory();
        solverFactory.configure(SOLVER_CONFIG);
        return solverFactory.buildSolver();
    }
View Full Code Here

TOP

Related Classes of org.drools.planner.config.XmlSolverFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.