net.sf.cpsolver.ifs.model
Class BinaryConstraint

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Constraint
      extended by net.sf.cpsolver.ifs.model.BinaryConstraint
Direct Known Subclasses:
CSPBinaryConstraint, Dependence, JenrlConstraint

public abstract class BinaryConstraint
extends Constraint

Binary constraint.

Extension of Constraint that links exactly two variables.

Version:
IFS 1.1 (Iterative Forward Search)
Copyright (C) 2006 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
See Also:
Variable, Constraint, Model

Field Summary
 
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint
iAssignedVariables, iConstraintListeners, iId
 
Constructor Summary
BinaryConstraint()
           
 
Method Summary
 void addVariable(Variable var)
          Add a variable to this constraint
 Variable another(Variable variable)
          Returns the variable out of the constraints variables which is different from the given variable.
 Variable first()
          First variable
 boolean isFirst(Variable variable)
          True, id the given variable is the first one
 Variable second()
          Second variable
 
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint
addConstraintListener, assigned, assignedVariables, computeConflicts, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, getName, hashCode, inConflict, isConsistent, isHard, removeConstraintListener, removeVariable, setModel, unassigned, variables
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryConstraint

public BinaryConstraint()
Method Detail

addVariable

public void addVariable(Variable var)
Description copied from class: Constraint
Add a variable to this constraint

Overrides:
addVariable in class Constraint

first

public Variable first()
First variable


second

public Variable second()
Second variable


isFirst

public boolean isFirst(Variable variable)
True, id the given variable is the first one


another

public Variable another(Variable variable)
Returns the variable out of the constraints variables which is different from the given variable.