Package solver.exception

Examples of solver.exception.SolverException


    AbstractStrategy<IntVar> mainStrategy = null;

    private static IntVar[] extractIntVars(Solver solver) {
        IntVar[] ivars = ArrayUtils.append(solver.retrieveBoolVars(), solver.retrieveIntVars());
        if (ivars.length != solver.getNbVars()) {
            throw new SolverException("GenerateAndTest search cannot be applied on non integer (and boolean) variables");
        }
        return ivars;
    }
View Full Code Here


        if (low == Double.NEGATIVE_INFINITY) low = -Double.MAX_VALUE;
        double upp = var.getUB();
        if (upp == Double.POSITIVE_INFINITY) upp = Double.MAX_VALUE;
        double r = (low + upp) / 2.0;
        if (r <= low || r >= upp) {
            throw new SolverException("RealDomainMiddle: find a value outside current domain!");
        }
        return r;
    }
View Full Code Here

    protected CircularQueue<Deduction> pending = new CircularQueue<>(16);

    public RecorderExplanationEngine(Solver solver) {
        super(solver);
        if (!Configuration.PLUG_EXPLANATION) {
            throw new SolverException("\nExplanations are not plugged in.\n" +
                    "To activate explanations, create a user.property file at project root directory " +
                    "which contains the following two lines:\n" +
                    "# Enabling explanations:\n" +
                    "PLUG_EXPLANATION=true\n");
        }
View Full Code Here

        if (mapvar == null) {
            mapvar = new TIntObjectHashMap<>();
            if (isLeft) {
                if (!decision.hasNext()) {
                    System.out.println(decision);
                    throw new SolverException("Arg!");
                }
                leftbranchdecisions.put(vid, mapvar);
            } else {
                rightbranchdecisions.put(vid, mapvar);
            }
View Full Code Here

                || (ubi < 0 && outsideval == initUB)) {
            int id = ubidx.add(1);
            resizeubs(id + 1);
            ubs[id] = outsideval;
        } else {
            throw new SolverException("Unknown value");
        }
    }
View Full Code Here

                || (lbi < 0 && oldLB == initLB)) {
            int id = lbidx.add(1);
            resizelbs(id + 1);
            lbs[id] = newLB - 1;
        } else {
            throw new SolverException("Unknown value");
        }
    }
View Full Code Here

                || (ubi < 0 && oldUB == initUB)) {
            int id = ubidx.add(1);
            resizeubs(id + 1);
            ubs[id] = newUB + 1;
        } else {
            throw new SolverException("Unknown value");
        }
    }
View Full Code Here

                high = mid - 1;
            } else {
                return mid; // key found
            }
        }
        throw new SolverException("Cannot found correct interval");
    }
View Full Code Here

                low = mid + 1;
            } else {
                return mid; // key found
            }
        }
        throw new SolverException("Cannot found correct interval");
    }
View Full Code Here

     *
     * @param active true or false
     */
    public void activeUserExplanation(boolean active) {
        if (!Configuration.PROP_IN_EXP) {
            throw new SolverException("Configuration.properties should be modified to allow storing propagators in explanations. (PROP_IN_EXP property).");
        }
        userE = active;
    }
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.