Package solver.search.limits

Examples of solver.search.limits.BacktrackCounter


        final Solver solver = new Solver();
        IntVar[] vars = VF.enumeratedArray("vars", 3, 0, 2, solver);
        NogoodStoreFromRestarts ngs = new NogoodStoreFromRestarts(vars);
        solver.post(ngs);
        solver.set(ISF.random_value(vars, 29091981L));
        final BacktrackCounter sc = new BacktrackCounter(30);
        sc.setAction(new ICounterAction() {
            @Override
            public void onLimitReached() {
                solver.getSearchLoop().restart();
                sc.reset();
            }
        });
        solver.getSearchLoop().plugSearchMonitor(sc);
        solver.getSearchLoop().plugSearchMonitor(ngs);
        SMF.limitTime(solver, 200000);
View Full Code Here


        final Solver solver = new Solver();
        IntVar[] vars = VF.enumeratedArray("vars", 3, 0, 3, solver);
        NogoodStoreFromRestarts ngs = new NogoodStoreFromRestarts(vars);
        solver.post(ngs);
        solver.set(ISF.random_value(vars, 29091981L));
        final BacktrackCounter sc = new BacktrackCounter(32);
        sc.setAction(new ICounterAction() {
            @Override
            public void onLimitReached() {
                solver.getSearchLoop().restart();
                sc.reset();
            }
        });
        solver.getSearchLoop().plugSearchMonitor(sc);
        solver.getSearchLoop().plugSearchMonitor(ngs);
        SMF.limitTime(solver, 2000);
View Full Code Here

TOP

Related Classes of solver.search.limits.BacktrackCounter

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.