Package solver.thread

Examples of solver.thread.ThreadSolver


        sm1.post(IntConstraintFactory.arithm((IntVar) sm1.getVars()[0], "<=", n1));

        Solver sm2 = modeler(n);
        sm2.post(IntConstraintFactory.arithm((IntVar) sm2.getVars()[0], ">=", n1 + 1));

        ThreadSolver ts1 = new ThreadSolver(sm1);
        ThreadSolver ts2 = new ThreadSolver(sm2);
//

        ts1.findAllSolutions();
        ts2.findAllSolutions();
        float tsms = ts1.getSolver().getMeasures().getTimeCount() + ts2.getSolver().getMeasures().getTimeCount();

        ts1.join();
        ts2.join();

        int nbSol = (int) sref.getMeasures().getSolutionCount();
        Assert.assertEquals(ts1.solver.getMeasures().getSolutionCount()
                + ts2.solver.getMeasures().getSolutionCount(), nbSol);
    }
View Full Code Here


    public void test2() throws InterruptedException {
        int n = 10;

        ThreadSolver[] solvers = new ThreadSolver[n];
        for (int i = 0; i < n; i++) {
            solvers[i] = new ThreadSolver(modeler(n));
        }
        for (int i = 0; i < n; i++) {
            solvers[i].findAllSolutions();
        }
        for (int i = 0; i < n; i++) {
View Full Code Here

TOP

Related Classes of solver.thread.ThreadSolver

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.