Package javax.constraints.impl

Examples of javax.constraints.impl.Problem


    }
  }
 
  public Element(int[] array, Var indexVar, String oper, Var var) {
    super(indexVar.getProblem(),name);
    Problem problem = (Problem) indexVar.getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntArray intValues = new IntArray(constrainer, array.length);
    for (int i = 0; i < array.length; i++) {
      intValues.set(array[i], i);
    }
    try {
      IntExp element = intValues.elementAt((IntExp) indexVar.getImpl());
      problem.defineConstraintImpl(this, element, oper, var);
    }
    catch (Exception f) {
      throw new RuntimeException("Failure to create constraint "+name);
    }
  }
View Full Code Here


    }
  }
 
  public Element(Var[] vars, Var indexVar, String oper, int value) {
    super(indexVar.getProblem(),name);
    Problem problem = (Problem) indexVar.getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntExpArray intvars = new IntExpArray(constrainer, vars.length);
    for (int i = 0; i < vars.length; i++) {
      IntExp exp = (IntExp)vars[i].getImpl();
      intvars.set(exp, i);
    }
    try {
      IntExp element = intvars.elementAt((IntExp) indexVar.getImpl());
      problem.defineConstraintImpl(this, element, oper, value);
    }
    catch (Exception f) {
      throw new RuntimeException("Failure to create constraint "+name);
    }
  }
View Full Code Here

    }
  }
 
  public Element(Var[] vars, Var indexVar, String oper, Var var) {
    super(indexVar.getProblem(),name);
    Problem problem = (Problem) indexVar.getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntExpArray intvars = new IntExpArray(constrainer, vars.length);
    for (int i = 0; i < vars.length; i++) {
      IntExp exp = (IntExp)vars[i].getImpl();
      intvars.set(exp, i);
    }
    try {
      IntExp element = intvars.elementAt((IntExp) indexVar.getImpl());
      problem.defineConstraintImpl(this, element, oper, var);
    }
    catch (Exception f) {
      throw new RuntimeException("Failure to create constraint "+name);
    }
  }
View Full Code Here

    IntBoolExp b2 = ((com.exigen.ie.constrainer.Constraint)myC2).toIntBoolExp();
    if (b2 == null)
      error(c2);
    IntBoolExp newConstraint;
    newConstraint = b1.and(b2);
    Problem p = (Problem)c1.getProblem();
    setImpl(p.getConstrainer().addConstraint(newConstraint));
  }
View Full Code Here


  public Linear(Var var1, String oper, Var var2) {
    super(var1.getProblem(), name);
    IntExp cVar1 = (IntExp) var1.getImpl();
    Problem problem = (Problem) var1.getProblem();
    problem.defineConstraintImpl(this, cVar1, oper, var2);
  }
View Full Code Here

  }
 
  public Linear(Var var, String oper, int value) {
    super(var.getProblem(), name);
    IntExp cVar = (IntExp) var.getImpl();
    Problem problem = (Problem) var.getProblem();
    problem.defineConstraintImpl(this, cVar, oper, value);
  }
View Full Code Here

    problem.defineConstraintImpl(this, cVar, oper, value);
  }

  public Linear(int[] values, Var[] vars, String oper, int value) {
    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, value);
  }
View Full Code Here

    problem.defineConstraintImpl(this, scalProd, oper, value);
  }

  public Linear(Var[] vars, String oper, int value) {
    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

    problem.defineConstraintImpl(this, sum, oper, value);
  }

  public Linear(int[] values, Var[] vars, String oper, Var var) {
    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

    problem.defineConstraintImpl(this, scalProd, oper, var);
  }

  public Linear(Var[] vars, String oper, Var var) {
    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, var);
  }
View Full Code Here

TOP

Related Classes of javax.constraints.impl.Problem

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.