|
SugarTrace version 1.0.1 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsugartracer.decoder.Variable
public class Variable
This is a class for CSP integer variables and boolean variables.
Method Summary | |
---|---|
boolean |
contains(int code)
Returns true when the propositional variable code is used for this variable. |
String |
domainString(Assignment assignment)
Returns the string representation of the domain under given assignment |
String |
domainStringSaved()
Returns the string representation of the saved domain |
int |
getCodeMax()
Returns the maximum propositional variable index used to encode this variable. |
int |
getCodeMin()
Returns the minimum propositional variable index used to encode this variable. |
String |
getName()
Returns the name of this variable. |
boolean |
isAux()
Returns true when this object is an aux variable. |
boolean |
isBool()
Returns true when this object is a CSP boolean variable. |
boolean |
isModified(Assignment assignment)
Returns true when the domain is modified. |
int |
lb()
Returns the lower bound value of this variable. |
int |
lb(Assignment assignment)
Returns the lower bound value of this variable under given assignment. |
static Variable |
newBoolVariable(String name,
int code)
Creates a new CSP boolean variable object. |
static Variable |
newIntVariable(String name,
int code,
int[][] domain)
Creates a new CSP integer variable object. |
void |
reset()
Resets the variable to initial state |
void |
saveDomain(Assignment assignment)
Saves the domain information under given assignment. |
int |
toCode(int value)
Returns the index of the propositional variable corresponding to the value. |
String |
toString()
|
String[] |
toStrings(Assignment assignment,
boolean showOldDomain)
Returns the string representation of this variable |
int |
toValue(int code)
Returns the value of this integer variable corresponding to code. |
int |
ub()
Returns the upper bound value of this variable. |
int |
ub(Assignment assignment)
Returns the upper bound value of this variable under given assignment. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Variable newIntVariable(String name, int code, int[][] domain)
name
- then name of the variablecode
- the minimum propositional variable index used to encode this variabledomain
- array of intervals
public static Variable newBoolVariable(String name, int code)
name
- then name of the variablecode
- the minimum propositional variable index used to encode this variable
public void reset()
public String getName()
public boolean isBool()
public boolean isAux()
public boolean contains(int code)
code
- the index of the propositional variable
public int getCodeMin()
public int getCodeMax()
public int lb()
public int ub()
public int toValue(int code) throws TracerException
code
- the index of the propositional variable
TracerException
public int toCode(int value) throws TracerException
value
- the value of the variable
TracerException
public int lb(Assignment assignment)
assignment
- the assignment
public int ub(Assignment assignment)
assignment
- the assignment
public void saveDomain(Assignment assignment)
assignment
- the assignmentpublic boolean isModified(Assignment assignment)
assignment
-
public String domainString(Assignment assignment)
assignment
- the assignment
public String domainStringSaved()
public String[] toStrings(Assignment assignment, boolean showOldDomain)
assignment
- showOldDomain
-
public String toString()
toString
in class Object
|
SugarTrace version 1.0.1 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |