Examples of IntVar


Examples of solver.variables.IntVar

    // to fix determinism in the construction, we iterate over the original array of variables
    int b = 0, e = map.size();
    IntVar[] tmpV = new IntVar[e];
    int[] tmpC = new int[e];
    for (int i = 0; i < vars.length; i++) {
      IntVar key = vars[i];
      int coeff = map.get(key);
      if (coeff > 0) {
        tmpV[b] = key;
        tmpC[b++] = coeff;
      } else if (coeff < 0) {
View Full Code Here

Examples of solver.variables.IntVar

        for (int i = 0; i < data.prefPerPeople(); i++) {
            int pa = data.preferences()[(2 * i)];
            int pb = data.preferences()[2 * i + 1];


      IntVar k = VariableFactory.bounded(StringUtils.randomName(),-20000,20000,solver);
      solver.post(IntConstraintFactory.sum(new IntVar[]{positions[pb], k}, positions[pa]));
      dist[i] = VariableFactory.abs(k);

            solver.post(
                    ifThenElse(viols[i],
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.