org.sat4j.csp
Class Constant

java.lang.Object
  extended by org.sat4j.csp.Constant
All Implemented Interfaces:
Evaluable

public class Constant
extends Object
implements Evaluable


Constructor Summary
Constant(int value)
           
 
Method Summary
 Domain domain()
          Return the domain of the evaluable.
 void toClause(ISolver solver)
          Translates a variable over a domain into a set a clauses enforcing that exactly one value must be chosen in the domain.
 String toString()
           
 int translate(int key)
          Translates a value from the domain into a SAT variable in Dimacs format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Constant

public Constant(int value)
Method Detail

domain

public Domain domain()
Description copied from interface: Evaluable
Return the domain of the evaluable.

Specified by:
domain in interface Evaluable
Returns:
the domain of the evaluable.

translate

public int translate(int key)
Description copied from interface: Evaluable
Translates a value from the domain into a SAT variable in Dimacs format.

Specified by:
translate in interface Evaluable
Parameters:
key - a value from domain()
Returns:
the SAT variable associated with that value.

toClause

public void toClause(ISolver solver)
              throws ContradictionException
Description copied from interface: Evaluable
Translates a variable over a domain into a set a clauses enforcing that exactly one value must be chosen in the domain.

Specified by:
toClause in interface Evaluable
Parameters:
solver - a solver to feed with the clauses.
Throws:
ContradictionException - if a trivial inconsistency is met.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.