Package solver.variables

Examples of solver.variables.IntVar.nextValue()


    protected void backPropForcePoss() throws ContradictionException {
        for (int i = poss.getFirstElement(); i >= 0; i = poss.getNextElement()) {
            IntVar v = vars[i];
            if (v.hasEnumeratedDomain()) {
                for (int val = v.getLB(); val <= v.getUB(); val = v.nextValue(val)) {
                    if (!setValues.contains(val)) {
                        v.removeValue(val, this);
                    }
                }
                poss.remove(i);
View Full Code Here


    }

    private void intersectionDomains() {
        final List<Integer> inter = new LinkedList<Integer>();
        IntVar v = vars[dVar.get(0)];
        for (int val = v.getLB(); val <= v.getUB(); val = v.nextValue(val)) {
            inter.add(val);
        }

        for (int i = 0; i < dVar.size(); i++) {
            final int next = dVar.get(i);
View Full Code Here

            } 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;
                    } else {
                        break;
                    }
View Full Code Here

    G_R.getNodes().clear();
    for(int i=0;i<n;i++){
      IntVar v = vars[i];
      int lb = v.getLB();
      int ub = v.getUB();
      for(int j=lb;j<=ub;j=v.nextValue(j)){
        if(j-offSet==source){
          support.addArc(i,n);
        }else{
          support.addArc(i,j-offSet);
        }
View Full Code Here

    G_R.getNodes().clear();
    for(int i=0;i<n;i++){
      IntVar v = vars[i];
      int lb = v.getLB();
      int ub = v.getUB();
      for(int j=lb;j<=ub;j=v.nextValue(j)){
        if(j-offSet==source){
          support.addArc(i,n);
        }else{
          support.addArc(i,j-offSet);
        }
View Full Code Here

          if (!y.contains(val)) {
            x.removeValue(val, aCause);
          }
        }
        ub = y.getUB();
        for (int val = y.getLB(); val <= ub; val = y.nextValue(val)) {
          if (!x.contains(val)) {
            y.removeValue(val, aCause);
          }
        }
      }
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.