org.sat4j.csp
Class Var

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

public class Var
extends Object
implements Evaluable


Constructor Summary
Var(String idvar, Domain domain, int lastvarnumber)
           
 
Method Summary
 Domain domain()
          Return the domain of the evaluable.
 int findValue(int[] model)
           
 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

Var

public Var(String idvar,
           Domain domain,
           int lastvarnumber)
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.

findValue

public int findValue(int[] model)

toString

public String toString()
Overrides:
toString in class Object


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