org.sat4j.csp
Class Var
java.lang.Object
   org.sat4j.csp.Var
org.sat4j.csp.Var
- All Implemented Interfaces: 
- Evaluable
- public class Var 
- extends Object- implements Evaluable
 
| 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.
 | 
 
 
Var
public Var(String idvar,
           Domain domain,
           int lastvarnumber)
domain
public Domain domain()
- Description copied from interface: Evaluable
- Return the domain of the evaluable.
 
- 
- Specified by:
- domainin 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:
- translatein 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:
- toClausein 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:
- toStringin class- Object
 
- 
 
Copyright © 2012 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.