Package solver

Examples of solver.Solver


     * @param HEIGHT    collection of height (each height should be >= 0)
     * @param USE_CUMUL indicates whether or not redundant cumulative constraints should be put on each dimension (advised)
     * @return a non-overlapping constraint
     */
    public static Constraint[] diffn(IntVar[] X, IntVar[] Y, IntVar[] WIDTH, IntVar[] HEIGHT, boolean USE_CUMUL) {
        Solver solver = X[0].getSolver();
        Constraint diffNCons = new Constraint(
                "DiffN",
                new PropDiffN(X, Y, WIDTH, HEIGHT, false),
                new PropDiffN(X, Y, WIDTH, HEIGHT, false)
        );
View Full Code Here


        // scalar
        if (OPERATOR.equals("=")) {
            return makeScalar(VARS, COEFFS, SCALAR, 1);
        }
        int[] b = Scalar.getScalarBounds(VARS, COEFFS);
        Solver s = VARS[0].getSolver();
        IntVar p = VF.bounded(StringUtils.randomName(), b[0], b[1], s);
        s.post(makeScalar(VARS, COEFFS, p, 1));
        return arithm(p, OPERATOR, SCALAR);
    }
View Full Code Here

     * @param SUBCIRCUIT_SIZE expected number of nodes in the circuit
     * @return a subcircuit constraint
     */
    public static Constraint subcircuit(IntVar[] VARS, int OFFSET, IntVar SUBCIRCUIT_SIZE) {
        int n = VARS.length;
        Solver solver = VARS[0].getSolver();
        IntVar nbLoops = VariableFactory.bounded("nLoops", 0, n, solver);
        return new Constraint("SubCircuit", ArrayUtils.append(
                alldifferent(VARS).getPropagators(),
                ArrayUtils.toArray(
                        new PropEqualXY_C(new IntVar[]{nbLoops, SUBCIRCUIT_SIZE}, n),
View Full Code Here

    BoolVar[][] vars, _vars;

    @Override
    public void createSolver() {
        solver = new Solver("BIBD");
    }
View Full Code Here

    //***********************************************************************************
    // METHODS
    //***********************************************************************************

    public void activate(int idx) throws ContradictionException {
        Solver solver = propagators[0].getSolver();
        assert bool.isInstantiatedTo(1 - idx);
        for (int p = indices[idx]; p < indices[idx + 1]; p++) {
            assert (propagators[p].isReifiedAndSilent());
            propagators[p].setReifiedTrue();
            solver.getExplainer().activePropagator(bool, propagators[p]);
            propagators[p].propagate(PropagatorEventType.FULL_PROPAGATION.getStrengthenedMask());
            solver.getEngine().onPropagatorExecution(propagators[p]);
        }
    }
View Full Code Here

    }

    @Override
    public void createSolver() {
        solver = new Solver("MagicSequence");
    }
View Full Code Here

    IntVar[] meetingTime;

    @Override
    public void createSolver() {
        solver = new Solver("MSP");
    }
View Full Code Here

        }
    }

    @Override
    public void createSolver() {
        solver = new Solver("Knapsack");
    }
View Full Code Here

    Constraint[] ALLDIFF;
    Constraint[] OTHERS;

    @Override
    public void createSolver() {
        solver = new Solver("AllIntervalSeries");
    }
View Full Code Here

    BoolVar[] bvars;

    @Override
    public void createSolver() {
        solver = new Solver("PertReified");
    }
View Full Code Here

TOP

Related Classes of solver.Solver

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.