Package solver.exception

Examples of solver.exception.SolverException



    public DistanceXYC(IntVar X, IntVar Y, Operator operator, int C) {
        super("DistanceXYC " + operator.name(), new PropDistanceXYC(ArrayUtils.toArray(X, Y), operator, C));
        if (operator != Operator.EQ && operator != Operator.GT && operator != Operator.LT && operator != Operator.NQ) {
            throw new SolverException("Unexpected operator for distance");
        }
        this.X = X;
        this.Y = Y;
        this.C = C;
        this.operator = operator;
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 delayedPropagation(Propagator propagator, PropagatorEventType type) throws ContradictionException {
        int aid = p2i.get(propagator.getId());
        if (!schedule_c[aid]) {
            PropagatorPriority prio = /*dynamic ? prop.dynPriority() :*/ propagator.getPriority();
            int q = match_c[prio.priority - 1];
            if (q == -1) throw new SolverException("Cannot schedule coarse event for low priority propagator.");
            pro_queue_c[q].addLast(propagator);
            schedule_c[aid] = true;
            event_c[aid] = type;
            notEmpty = notEmpty | (1 << (q + max_f));
        }
View Full Code Here

            if (totalSize < 0) { // to prevent from integer overflow
                totalSize = -1;
            }
        }
        if ((totalSize / Integer.MAX_VALUE) + 1 < 0 || (totalSize / Integer.MAX_VALUE) + 1 > Integer.MAX_VALUE)
            throw new SolverException("Tuples required too much memory ...");

        tables = new TIntObjectHashMap<>();
        int nt = tuples.nbTuples();
        for (int i = 0; i < nt; i++) {
            int[] tuple = tuples.get(i);
View Full Code Here

                } else {
                    sat++;
                }
            }
            if (sat != propagators.length) {
                throw new SolverException("GenerateAndTest has generated an incomplete instantiation");
            }
        }
View Full Code Here

        public void desactivatePropagator(Propagator propagator) {
        }

        @Override
        public void dynamicAddition(Constraint c, boolean permanent) {
            throw new SolverException("GenerateAndTest does not support propagator dynamic addition");
        }
View Full Code Here

            throw new SolverException("GenerateAndTest does not support propagator dynamic addition");
        }

        @Override
        public void dynamicDeletion(Constraint c) {
            throw new SolverException("GenerateAndTest does not support propagator dynamic deletion");
        }
View Full Code Here

            arity = tuple.length;
            ranges = new int[2 * arity];
            Arrays.fill(ranges, 0, arity, Integer.MAX_VALUE);
            Arrays.fill(ranges, arity, 2 * arity, Integer.MIN_VALUE);
        } else if (arity != tuple.length) {
            throw new SolverException("The given tuple does not match the arity: " + arity);
        }
        tuples.add(tuple);
        for (int i = 0; i < arity; i++) {
            ranges[i] = Math.min(ranges[i], tuple[i]);
            ranges[i + arity] = Math.max(ranges[i + arity], tuple[i]);
View Full Code Here

        } else if (operator == Operator.GT) {
            op = ">";
        } else if (operator == Operator.LT) {
            op = "<";
        } else {
            throw new SolverException("unknown operator");
        }
        return "|" + vars[0] + " - " + vars[1] + "| " + op + " " + vars[2];
    }
View Full Code Here

    public int[][] getTupleTable() {
        return tuplesIndexes;
    }

    public boolean checkTuple(int[] tuple) {
        throw new SolverException("TuplesList is an unusual large relation...");
    }
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.