Package com.exigen.ie.constrainer

Examples of com.exigen.ie.constrainer.Constraint


    IntExpArray cards = _intvars.cards().cards();

    for(int i = 0; i < cards.size(); ++i)
    {
      Constraint ct = cards.elementAt(i).less(2);
      ct.execute();
    }

    return null;
  } // end of execute
View Full Code Here


    IntExpArray vars = new IntExpArray(C, size);
    vars.set(x, 0);
    vars.set(y, 1);
    vars.set(z, 2);

    Constraint constraintAllDiff2 = new ConstraintAllDiff2(vars);
    constraintAllDiff2.execute();

    //IntExp cost = C.addIntVar(0,20,"cost");
    //Constraint sum = new ConstraintAddVector(vars,cost);
    //sum.execute();
    IntExp cost = C.sum(vars); cost.name("cost");
View Full Code Here

    IntExpArray vars = new IntExpArray(C, size);
    vars.set(x, 0);
    vars.set(y, 1);
    vars.set(z, 2);

    Constraint constraintAllDiff2 = new ConstraintAllDiff2(vars);
    constraintAllDiff2.execute();

    //IntExp cost = C.addIntVar(0,20,"cost");
    //Constraint sum = new ConstraintAddVector(vars,cost);
    //sum.execute();
    IntExp cost = C.sum(vars); cost.name("cost");
View Full Code Here

    Constrainer constrainer = problem.getConstrainer();
    IntExpArray cVars = problem.getExpArray(vars);   
    IntExpArray cCardinalityVars = problem.getExpArray(cardVars);
    try {
      IntExpArray cards = constrainer.distribute(cVars,values);
      Constraint newC = new ConstrainerIntExpArrayEq(cards,cCardinalityVars);
      setImpl(constrainer.addConstraint(newC));
    } catch (Exception f) {
      throw new RuntimeException(
          "Failure to create GlobalCardinality constraint");
    }   
View Full Code Here

    IntExpArray cValueVars = problem.getExpArray(valueVars);
    IntExpArray cCardVars = problem.getExpArray(valueVars);
    try {
      IntArrayCards givenCards = cCardVars.cards();
      IntArrayCards distributedCards = constrainer.distribute(cVars,cValueVars);
      Constraint newC = new ConstrainerArrayCardsEq(distributedCards,givenCards);
      setImpl(constrainer.addConstraint(newC));
    } catch (Exception f) {
      throw new RuntimeException(
          "Failure to create GlobalCardinality constraint");
    }
View Full Code Here

TOP

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

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.