Package solver.exception

Examples of solver.exception.SolverException


        this.X = vars[0];
        this.Z = vars[1];
        this.Y = y;
        assert y > 1;
        if (!(Times.inIntBounds((long) X.getLB() * Y) && Times.inIntBounds((long) X.getUB() * Y))) {
            throw new SolverException("Integer overflow.\nConsider reducing the variable domains.");
        }
        this.enumerated = X.hasEnumeratedDomain() && Z.hasEnumeratedDomain();
    }
View Full Code Here


        for (int i = 0; i < size; i++) {
            offsets[i] = vs[i].getLB();
            blocks[i] = nbElt;
            if ((vars[i].getTypeAndKind() & Variable.KIND) != Variable.BOOL) allboolean = false;
            if (!vars[i].hasEnumeratedDomain()) {
                throw new SolverException("GAC2001 can not be used with bound variables");
            } else nbElt += vars[i].getUB() - vars[i].getLB() + 1;
        }
        this.supports = new IStateInt[nbElt * size];
        IEnvironment env = vs[0].getSolver().getEnvironment();
        for (int i = 0; i < supports.length; i++) {
View Full Code Here

        long totalSize = 1;
        for (int i = 0; i < vars.length && totalSize > 0; i++) { // to prevent from long overflow
            totalSize *= vars[i].getDomainSize();
        }
        if (totalSize < 0) {
            throw new SolverException("Tuples required too much memory ...");
        }
        if (totalSize / 8 > 50 * 1024 * 1024) {
            return new TuplesLargeTable(tuples, vars);
        }
        return new TuplesTable(tuples, vars);
View Full Code Here

    public void flush() {
    }

    @Override
    public void fails(ICause cause, Variable variable, String message) throws ContradictionException {
        throw new SolverException("The Propagator " + cause + " is not idempotent!\n" +
                "See stack trace for more details -- it can be due to a view!");
    }
View Full Code Here

    public void clear() {
    }

    @Override
    public void onVariableUpdate(Variable variable, IEventType type, ICause cause) throws ContradictionException {
        throw new SolverException("The Propagator " + cause + " is not idempotent!");
    }
View Full Code Here

            lowerbounds[i] = vars[i].getLB();
            upperbounds[i] = vars[i].getUB();
            totalSize *= upperbounds[i] - lowerbounds[i] + 1;
        }
        if (totalSize < 0 || (totalSize / 8 > 50 * 1024 * 1024)) {
            throw new SolverException("Tuples required over 50Mo of memory...");
        }
        table = new BitSet(totalSize);
        int nt = tuples.nbTuples();
        for (int i = 0; i < nt; i++) {
            int[] tuple = tuples.get(i);
View Full Code Here

        long totalSize = 1;
        for (int i = 0; i < vars.length && totalSize > 0; i++) { // to prevent from long overflow
            totalSize *= vars[i].getDomainSize();
        }
        if (totalSize < 0) {
            throw new SolverException("Tuples required too much memory ...");
        }
        if (totalSize / 8 > 50 * 1024 * 1024) {
            return new TuplesLargeTable(tuples, vars);
        }
        return new TuplesTable(tuples, vars);
View Full Code Here

                    case 10:
                        conf(s, OPT, OPT);
                        break;
                    default:
                        alive = false;
                        throw new SolverException("to stop ^^");

                }
                Assert.fail("Fail on " + cas);

            } catch (SolverException ignored) {
View Full Code Here

        return NoDelta.singleton;
    }

    @Override
    public void createDelta() {
        throw new SolverException("Unable to create delta for RealVar!");
    }
View Full Code Here

        if (branch == 1) {
            e.add(explainer.explain(getPositiveDeduction()));
        } else if (branch == 2) {
            e.add(explainer.explain(getNegativeDeduction()));
        } else {
            throw new SolverException("Cannot explain a decision which has not been applied or refuted");
        }
    }
View Full Code Here

TOP

Related Classes of solver.exception.SolverException

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.