omnics.constraint
Class AllDiff
java.lang.Object
omnics.Constraint
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
|
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 |
AllDiff
public AllDiff(VarSet variables)
- Creates a new instance of AllDiff
AllDiff
public AllDiff(Var... varArray)
- Creates a new instance of AllDiff
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 constrainty - some variable of the constrainta - some value in x's domainb - 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