omnics.constraint
Class DistEq

java.lang.Object
  extended by omnics.Constraint
      extended by omnics.constraint.BinaryConstraint
          extended by omnics.constraint.DistEq
All Implemented Interfaces:
java.io.Serializable

public class DistEq
extends BinaryConstraint

Enforces |x-y|=c.

Author:
Cristian Frasinaru
See Also:
Serialized Form

Field Summary
 
Fields inherited from class omnics.constraint.BinaryConstraint
xIndex, yIndex
 
Fields inherited from class omnics.Constraint
ALLOWED, filter, FORBIDDEN, MAX, MIN, name, problem, variables
 
Constructor Summary
DistEq(Var x, Var y, int c)
          Creates a new instance of DistEq.
 
Method Summary
 int eval(java.lang.Object xvalue, java.lang.Object yvalue)
          This is the method that evaluates the tuple (x=a,y=b).
 
Methods inherited from class omnics.constraint.BinaryConstraint
eval, eval
 
Methods inherited from class omnics.Constraint
eval, getFilter, getName, getProblem, getTuples, getVarArray, getVariables, setFilter, setName, setVariables, setVariables, toString, variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistEq

public DistEq(Var x,
              Var y,
              int c)
Creates a new instance of DistEq.

Method Detail

eval

public int eval(java.lang.Object xvalue,
                java.lang.Object yvalue)
Description copied from class: BinaryConstraint
This is the method that evaluates the tuple (x=a,y=b). Must be implemented in the subclasses.

Specified by:
eval in class BinaryConstraint