Package com.exigen.ie.constrainer

Examples of com.exigen.ie.constrainer.IntExp


  /**
   * @return this in power of value where value >= 0
   */
  public javax.constraints.Var power(int value) {
    IntExp myVar = (IntExp) getImpl();
    return new Var(getProblem(),myVar.pow(value));
  }
View Full Code Here


   *            the events that will trigger the invocation of the
   *            Propagator.
   */
  public void addPropagator(Propagator propagator, PropagationEvent event) {
      ConstrainerPropagator observer = new ConstrainerPropagator(propagator, event);
      IntExp exp = (IntExp)getImpl();
      exp.attachObserver(observer);
  }
View Full Code Here

    super(vars[0].getProblem(),"AllDiff");
    Problem problem = (Problem) getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntExpArray intvars = new IntExpArray(constrainer,vars.length);
    for(int i=0; i<vars.length; i++) {
      IntExp var = (IntExp)vars[i].getImpl();
      intvars.set(var, i);
    }

    com.exigen.ie.constrainer.Constraint allDiff =
      new com.exigen.ie.constrainer.impl.ConstraintAllDiff(intvars);
View Full Code Here

   
    //clearSolutions();
    com.exigen.ie.constrainer.Goal saveGoal = new GoalSaveSolution(this);
    com.exigen.ie.constrainer.Goal totalGoal = new GoalAnd(goal,saveGoal);
   
    IntExp cObj = (IntExp)objectiveVar.getImpl();
    if ( objective.equals(Objective.MAXIMIZE) ) {
      cObj = cObj.mul(-1);
    }
//    if (solver.getMaxNumberOfSolutions() > 0)
//      constrainer.set
    boolean trace = false;
    boolean goal_saves_solution = true;
View Full Code Here

  public IntExpArray createConstrainerVars(Var[] vars) {
    javax.constraints.impl.Problem p = (javax.constraints.impl.Problem)getProblem();
    Constrainer constrainer = p.getConstrainer();
    IntExpArray intvars = new IntExpArray(constrainer,vars.length);
    for(int i=0; i<vars.length; i++) {
      IntExp var = (IntExp)vars[i].getImpl();
      intvars.set(var, i);
    }
    return intvars;
  }
View Full Code Here

   
    Problem p = (Problem)getProblem();
    Constrainer constrainer = p.getConstrainer();
    IntExpArray intvars = new IntExpArray(constrainer,vars.length);
    for(int i=0; i<vars.length; i++) {
      IntExp var = (IntExp)vars[i].getImpl();
      intvars.set(var, i);
    }
    constrainer.trace(intvars);
  }
View Full Code Here

    // TODO
  }
 
  public void defineConstraintImpl(Constraint constraint, IntExp constrainerVar, String oper, Var var) {
    IntBoolExp exp;
    IntExp cvar = (IntExp) var.getImpl();
    Oper op = stringToOper(oper);
    switch (op) {
    case EQ:
      exp = constrainerVar.eq(cvar);
      break;
View Full Code Here

  public IntExpArray getExpArray(Var[] vars) {
    Problem problem = (Problem) vars[0].getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntExpArray cVars = new IntExpArray(constrainer, vars.length);
    for (int i = 0; i < vars.length; i++) {
      IntExp exp = (IntExp) vars[i].getImpl();
      cVars.set(exp, i);
    }
    return cVars;
  }
View Full Code Here

          " It cannot be used in logical expressions.");
    }
    javax.constraints.impl.Problem p = (javax.constraints.impl.Problem)getProblem()
    com.exigen.ie.constrainer.Constraint myConstraint =
      (com.exigen.ie.constrainer.Constraint)getImpl();
    IntExp exp = myConstraint.toIntBoolExp();
    if ( exp == null) {
      String msg = "Failure to convert constraint "+getName() + " to VarBool. Not implemented.";
      p.log(msg);
      throw new RuntimeException(msg);
    }
View Full Code Here

    super(vars[0].getProblem(),name);
    Problem problem = (Problem) vars[0].getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntExpArray cVars = problem.getExpArray(vars);
    try {
      IntExp cardinality = constrainer.cardinality(cVars,cardValue);
      problem.defineConstraintImpl(this, cardinality, oper, var);
    } catch (Exception f) {
      throw new RuntimeException(
          "Failure to create constraint "+name);
    }
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.