|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.cpsolver.ifs.model.Constraint<V,T>
net.sf.cpsolver.ifs.model.BinaryConstraint<CSPVariable,CSPValue>
net.sf.cpsolver.ifs.example.csp.CSPBinaryConstraint
public class CSPBinaryConstraint
CSP binary constraint.
This class only implements the generation of a binary CSP constraint and the
consistency check.
| Field Summary |
|---|
| Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
|---|
iAssignedVariables, iConstraintListeners, iId |
| Constructor Summary | |
|---|---|
CSPBinaryConstraint(int id,
int nrCompatiblePairs)
Constructor |
|
| Method Summary | |
|---|---|
void |
computeConflicts(CSPValue aValue,
Set<CSPValue> conflicts)
Add the other variable to the set of conflicts, if it is not compatible with the given value. |
String |
getName()
Constraint's name -- for printing purposes |
void |
init(Random rndNumGen)
Initializes the constraint. |
boolean |
isConsistent(CSPValue value1,
CSPValue value2)
True if the pair of given values is compatible. |
| Methods inherited from class net.sf.cpsolver.ifs.model.BinaryConstraint |
|---|
addVariable, another, first, isFirst, second |
| Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
|---|
addConstraintListener, assigned, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, inConflict, isHard, removeConstraintListener, removeVariable, setModel, unassigned, variables |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSPBinaryConstraint(int id,
int nrCompatiblePairs)
nrCompatiblePairs - number of compatible pairs of values in the constraint| Method Detail |
|---|
public void init(Random rndNumGen)
rndNumGen - random number generator
public boolean isConsistent(CSPValue value1,
CSPValue value2)
isConsistent in class Constraint<CSPVariable,CSPValue>
public void computeConflicts(CSPValue aValue,
Set<CSPValue> conflicts)
computeConflicts in class Constraint<CSPVariable,CSPValue>aValue - value to be assigned to its varaibleconflicts - resultant set of conflicting valuespublic String getName()
Constraint
getName in class Constraint<CSPVariable,CSPValue>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||