|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectomnics.Var
public class Var
Represents a variable of a constraint satisfaction problem.
| Constructor Summary | |
|---|---|
Var(java.lang.String name)
Creates a new instance of Var, having a specified name and no domain (the domain is null). |
|
Var(java.lang.String name,
Domain domain)
Creates a new instance of Var, having a specified name and a specified domain. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object object)
Specifies how two variables are compared to each other. |
ConstraintSet |
getConstraints()
Gets a reference to the collection of constraints this variable holds, consisting of constraints in which it is involved. |
ConstraintSet |
getConstraints(Var var)
Returns the constraints of the problem which contain this variable and the variable given as argument. |
java.lang.Object |
getData()
Gets the annotation of this variable. |
Domain |
getDomain()
Gets a reference to the domain of the variable. |
int |
getIndex()
Gets the index of the variable in the set of the problems variables. |
Domain |
getInitialDomain()
Gets the initial domain of the solver. |
java.lang.String |
getName()
Gets the name of the variable. |
Problem |
getProblem()
Gets the problem this variable belongs to. |
java.util.List<java.lang.Object> |
getSupportFor(Var x,
java.lang.Object a)
Constructs the support set for x=a from this variable. |
java.lang.Object |
getValue()
Gets the value assigned to this variable in the current partial solution. |
boolean |
isActive()
Returns true if the variable is active. |
boolean |
isInstantiated()
Returns true if this variable has been instantiated. |
boolean |
isTarget()
|
void |
restoreInitialDomain()
Sets the domain of this variable to be a copy of its initial domain. |
void |
setActive(boolean active)
Sets the active status of the variable. |
void |
setData(java.lang.Object data)
Sets the annotation of this variable. |
void |
setDomain(Domain domain)
Sets the domain of the variable. |
void |
setName(java.lang.String name)
Sets the name of the variable. |
void |
setTarget(boolean target)
|
void |
setValue(java.lang.Object value)
Assigns a value to this variable in the current partial solution. |
java.lang.String |
toString()
Returns a string representation of this variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Var(java.lang.String name)
name - the name of the variable
public Var(java.lang.String name,
Domain domain)
name - the name of the variabledomain - the domain of the variableDomain| Method Detail |
|---|
public Problem getProblem()
public java.lang.String getName()
public void setName(java.lang.String name)
name - the name given to this variable
IllegalArgumentException - if the name is not uniquepublic java.lang.Object getData()
public void setData(java.lang.Object data)
data - the annotation associated to this variablepublic int getIndex()
public Domain getDomain()
public void setDomain(Domain domain)
domain - the domain of the variablegetInitialDomain()public Domain getInitialDomain()
public void restoreInitialDomain()
public ConstraintSet getConstraints()
public ConstraintSet getConstraints(Var var)
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
value - the value to be assigned to this variable.public boolean isInstantiated()
public java.util.List<java.lang.Object> getSupportFor(Var x,
java.lang.Object a)
x - some variable, other than thisa - some value from x's domain
public int compareTo(java.lang.Object object)
compareTo in interface java.lang.Comparableobject - an object representing a variable
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isActive()
public void setActive(boolean active)
active - if true, the variable is active, otherwise it is notpublic boolean isTarget()
public void setTarget(boolean target)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||