Package solver.variables

Examples of solver.variables.IntVar.updateUpperBound()


                    } else {
                        break;
                    }
                }
                v.updateLowerBound(newLB, this);
                v.updateUpperBound(newUB, this);
                if (v.isInstantiated()) {
                    poss.remove(i);
                    nbSure.add(1);
                }
            }
View Full Code Here


        int nbCounters = pi.getNbResources();
        for (int i = 0; i < nbCounters; i++) {
            IntVar z = this.z[i];
            Bounds bounds = counters.get(i).bounds();
            z.updateLowerBound(bounds.min.value, aCause);//, false);
            z.updateUpperBound(bounds.max.value, aCause);//, false);

        }
    }

    private void delayedBoundUpdate() throws ContradictionException {
View Full Code Here

                    } else {
                        break;
                    }
                }
                v.updateLowerBound(newLB, this);
                v.updateUpperBound(newUB, this);
                if (newLB > values[values.length - 1] || newUB < values[0]) {
                    poss.remove(i);
                }
            }
        }
View Full Code Here

                }
                poss.remove(i);
                nbSure.add(1);
            } else {
                v.updateLowerBound(values[0], this);
                v.updateUpperBound(values[values.length - 1], this);
                int newLB = v.getLB();
                int newUB = v.getUB();
                for (int val = v.getLB(); val <= newUB; val = v.nextValue(val)) {
                    if (!setValues.contains(val)) {
                        newLB = val + 1;
View Full Code Here

        RealVar io = (RealVar) objective;
        if (policy == ResolutionPolicy.MINIMIZE) {
          io.updateUpperBound(bestProvedUB.doubleValue() - offset, this);
          io.updateLowerBound(bestProvedLB.doubleValue(), this);
        } else {
          io.updateUpperBound(bestProvedUB.doubleValue(), this);
          io.updateLowerBound(bestProvedLB.doubleValue() + offset, this);
        }
      }
    }
  }
View Full Code Here

        for(int i=0;i<n;i++) {
          IntVar intVar = intVars[i];
          RealVar realVar = realVars[i];
          realVar.updateBounds((double) intVar.getLB() - epsilon, (double) intVar.getUB() + epsilon, aCause);
          intVar.updateLowerBound((int) Math.ceil(realVar.getLB() - epsilon), aCause);
          intVar.updateUpperBound((int) Math.floor(realVar.getUB() + epsilon), aCause);
          if (intVar.hasEnumeratedDomain()) {
            realVar.updateBounds((double) intVar.getLB() - epsilon, (double) intVar.getUB() + epsilon, aCause);
          }
        }
      }
View Full Code Here

      IntVar y = vars[j];
      while (x.getLB() != y.getLB() || x.getUB() != y.getUB()) {
        x.updateLowerBound(y.getLB(), aCause);
        x.updateUpperBound(y.getUB(), aCause);
        y.updateLowerBound(x.getLB(), aCause);
        y.updateUpperBound(x.getUB(), aCause);
      }
      if (x.hasEnumeratedDomain() && y.hasEnumeratedDomain()) {
        int ub = x.getUB();
        for (int val = x.getLB(); val <= ub; val = x.nextValue(val)) {
          if (!y.contains(val)) {
View Full Code Here

        if (objective.getSolver().getMeasures().getSolutionCount() > 0 && strict) {
          offset = 1;
        }
        IntVar io = (IntVar) objective;
        if (policy == ResolutionPolicy.MINIMIZE) {
          io.updateUpperBound(bestProvedUB.intValue() - offset, this);
          io.updateLowerBound(bestProvedLB.intValue(), this);
        } else {
          io.updateUpperBound(bestProvedUB.intValue(), this);
          io.updateLowerBound(bestProvedLB.intValue() + offset, this);
        }
View Full Code Here

        IntVar io = (IntVar) objective;
        if (policy == ResolutionPolicy.MINIMIZE) {
          io.updateUpperBound(bestProvedUB.intValue() - offset, this);
          io.updateLowerBound(bestProvedLB.intValue(), this);
        } else {
          io.updateUpperBound(bestProvedUB.intValue(), this);
          io.updateLowerBound(bestProvedLB.intValue() + offset, this);
        }
      } else {
        double offset = 0;
        if (objective.getSolver().getMeasures().getSolutionCount() > 0 && strict) {
View Full Code Here

        if (objective.getSolver().getMeasures().getSolutionCount() > 0 && strict) {
          offset = precision;
        }
        RealVar io = (RealVar) objective;
        if (policy == ResolutionPolicy.MINIMIZE) {
          io.updateUpperBound(bestProvedUB.doubleValue() - offset, this);
          io.updateLowerBound(bestProvedLB.doubleValue(), this);
        } else {
          io.updateUpperBound(bestProvedUB.doubleValue(), this);
          io.updateLowerBound(bestProvedLB.doubleValue() + offset, this);
        }
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.