org.sat4j.csp
Class Var
java.lang.Object
  
org.sat4j.csp.Var
- All Implemented Interfaces: 
 - Evaluable
 
public class Var
- extends java.lang.Object
- implements Evaluable
  
| 
Constructor Summary | 
Var(java.lang.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. | 
 java.lang.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 | 
 
Var
public Var(java.lang.String idvar,
           Domain domain,
           int lastvarnumber)
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 java.lang.String toString()
- Overrides:
 toString in class java.lang.Object
 
 
Copyright © 2009 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.