omnics.constraint
Class AllDiff

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

public class AllDiff
extends Constraint

The AllDiff global constraint.

Author:
Cristian Frasinaru
See Also:
Serialized Form

Field Summary
 
Fields inherited from class omnics.Constraint
ALLOWED, filter, FORBIDDEN, MAX, MIN, name, problem, variables
 
Constructor Summary
AllDiff(Var... varArray)
          Creates a new instance of AllDiff
AllDiff(VarSet variables)
          Creates a new instance of AllDiff
 
Method Summary
 int eval(Tuple tuple)
          Evaluates a tuple.
 int eval(Var x, Var y, java.lang.Object a, java.lang.Object b)
          Evaluates two values.
 
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

AllDiff

public AllDiff(VarSet variables)
Creates a new instance of AllDiff


AllDiff

public AllDiff(Var... varArray)
Creates a new instance of AllDiff

Method Detail

eval

public int eval(Var x,
                Var y,
                java.lang.Object a,
                java.lang.Object b)
Evaluates two values.

Overrides:
eval in class Constraint
Parameters:
x - some variable of the constraint
y - some variable of the constraint
a - some value in x's domain
b - some value in y's domain
Returns:
a value between ValuationStructure.MIN and ValuationStructure.MAX.
See Also:
Constraint.eval(Tuple), ValuationStructure

eval

public int eval(Tuple tuple)
Evaluates a tuple.

Specified by:
eval in class Constraint
Parameters:
tuple - some tuple
Returns:
a value between ValuationStructure.MIN and ValuationStructure.MAX.
See Also:
Constraint.eval(Tuple), ValuationStructure