Package com.exigen.ie.constrainer

Examples of com.exigen.ie.constrainer.IntExp


    super(vars[0].getProblem(), name);
    Problem problem = (Problem) vars[0].getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntExpArray intvars = new IntExpArray(constrainer, vars.length);
    for (int i = 0; i < vars.length; i++) {
      IntExp cvar = (IntExp) vars[i].getImpl();
      intvars.set(cvar, i);
    }
    IntExp sum = constrainer.sum(intvars);
    problem.defineConstraintImpl(this, sum, oper, value);
  }
View Full Code Here


    super(vars[0].getProblem(), name);
    Problem problem = (Problem) vars[0].getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntExpArray intvars = new IntExpArray(constrainer, vars.length);
    for (int i = 0; i < vars.length; i++) {
      IntExp cvar = (IntExp) vars[i].getImpl();
      intvars.set(cvar, i);
    }
    IntExp scalProd = constrainer.scalarProduct(intvars, values);
    problem.defineConstraintImpl(this, scalProd, oper, var);
  }
View Full Code Here

  class AltResConstrObserver extends Observer
  {
    public void update(Subject var, EventOfInterest interest) throws Failure
    {
      IntExp event_var = (IntExp) var;
      //Debug.on(); Debug.print("AllDiffObserver("+var+") "+interest+" "+_bits); Debug.off();
      _goal.execute();
    }
View Full Code Here

     }
     System.out.println(" ]");
     */
    for (int t = c_start; t < c_end; t++)
    {
      IntExp capvar = _resource.getCapacityVar(t);
      if (capvar.max() < _capacity)
        constrainer().fail("resource assigning");
    }
    for (int t = c_start; t < c_end; t++)
    {
      IntExp capvar = _resource.getCapacityVar(t);
      capvar.setMax(capvar.max() - _capacity);
    }
    //_job.assignResource(_resource);
    return true;
  }
View Full Code Here

    _index.setMax (array.size () - 1);
    _elements = new LinkedList ();

    int                     min = index.min ();
    int                     max = index.max ();
    IntExp                  element;
    ArrayElementObserver observer;

    for (int i = min; i <= max; i ++) {
      element = array.get (i);
      observer = new ArrayElementObserver (element);
      element.attachObserver (observer);
      _elements.add (
        new ArrayElementAndObserver (
          element,
          i,
          observer
View Full Code Here

    values[valCounter++] = i;
  }

  for(int i=1; i < tmp.size(); i++)
  {
    IntExp curElem = tmp.get(i);
    int min = curElem.min();
    int max = curElem.max();
    if (min < values[valCounter-1])
      min = values[valCounter-1]+1;
    for (int j=min;j<max;j++){  //== Changed: j<=max replaced to j<max
        if (curElem.contains(j))
          values[valCounter++] = j;
    }
  }

View Full Code Here

  static IntExpArray createCopyOfIntExpArray(IntExpArray array){
    IntExpArray arrCopy = new IntExpArray(array.constrainer(), array.size());
    for (int i=0; i<array.size(); i++){
      IntVar varCopy;
      IntExp exp = array.get(i);
      if (exp instanceof IntVar)
        varCopy = createCopyOfIntVar((IntVar)exp);
      else
        varCopy = array.constrainer().addIntVar(exp.min(), exp.max(), IntVar.DOMAIN_PLAIN);
      arrCopy.set(varCopy, i);
    }
    return arrCopy;
  }
View Full Code Here

TOP

Related Classes of com.exigen.ie.constrainer.IntExp

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.