|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.core.Var
JaCoP.set.core.SetVar
public class SetVar
Defines a Finite Domain Variable (FDV) and related operations on it.
| Field Summary | |
|---|---|
SetDomain |
domain
It specifies the current domain associated with this set variable. |
static java.lang.String[] |
xmlAttributes
It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format. |
| Fields inherited from class JaCoP.core.Var |
|---|
id, idNumber, index, store, weight |
| Constructor Summary | |
|---|---|
SetVar()
No parameter, explicit, empty constructor for subclasses. |
|
SetVar(Store store)
This constructor creates a variable with empty domain (standard IntervalDomain domain), automatically generated name, and empty attached constraint list. |
|
SetVar(Store store,
int min,
int max)
This constructor creates a set variable with domain a set min..max automatically generated name, and empty attached constraint list. |
|
SetVar(Store store,
SetDomain dom)
It creates a variable in a given store, with a given name and a given domain. |
|
SetVar(Store store,
java.lang.String name)
This constructor creates a variable with an empty domain (standard IntervalDomain domain), the specified name, and an empty attached constraint list. |
|
SetVar(Store store,
java.lang.String name,
int min,
int max)
This constructor creates a variable in a given store, with the domain specified by min..max and with the given name. |
|
SetVar(Store store,
java.lang.String name,
SetDomain dom)
It creates a variable in a given store, with a given name and a given domain. |
|
| Method Summary | |
|---|---|
void |
addDom(int min,
int max)
It is possible to add the domain of variable. |
void |
addDom(SetDomain dom)
It is possible to add the domain of variable. |
SetDomain |
dom()
This function returns current domain of the variable. |
void |
domainHasChanged(int event)
It informs the variable that its variable has changed according to the specified event. |
boolean |
eq(SetVar var)
It checks if the domains of variables are equal. |
int |
getSize()
It returns the size of the current domain. |
boolean |
isEmpty()
It checks if the domain is empty. |
int |
level()
This function returns stamp of the current domain of variable. |
void |
putConstraint(Constraint c)
It registers constraint with current variable, so anytime this variable is changed the constraint is reevaluated. |
void |
putModelConstraint(Constraint c,
int pruningEvent)
It registers constraint with current variable, so anytime this variable is changed the constraint is reevaluated. |
void |
putSearchConstraint(Constraint c)
It registers constraint with current variable, so always when this variable is changed the constraint is reevaluated. |
SetDomain |
recentDomainPruning()
It returns the values which have been removed at current store level. |
void |
remove(int removedLevel)
It specifies the function being called by the manager upon backtracking. |
void |
removeConstraint(Constraint c)
It detaches constraint from the current variable, so change in variable will not cause constraint reevaluation. |
void |
setDomain(int min,
int max)
It is possible to set the domain of variable. |
void |
setDomain(SetDomain dom)
It is possible to set the domain of variable. |
boolean |
singleton()
It checks if the domain contains only one value. |
int |
sizeConstraints()
It returns current number of constraints which are associated with variable and are not yet satisfied. |
int |
sizeConstraintsOriginal()
It returns all constraints which are associated with variable, even the ones which are already satisfied. |
int |
sizeSearchConstraints()
It returns current number of constraints which are associated with variable and are not yet satisfied. |
java.lang.String |
toString()
|
java.lang.String |
toStringFull()
It returns the string representation of the variable using the full representation of the domain. |
| Methods inherited from class JaCoP.core.Var |
|---|
id, index |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public SetDomain domain
public static java.lang.String[] xmlAttributes
| Constructor Detail |
|---|
public SetVar(Store store,
java.lang.String name,
SetDomain dom)
store - store in which the variable is created.name - the name for the variable being created.dom - the domain of the variable being created.
public SetVar(Store store,
SetDomain dom)
store - store in which the variable is created.dom - the domain of the variable being created.public SetVar()
public SetVar(Store store)
store - store in which the variable is created.
public SetVar(Store store,
int min,
int max)
store - store in which the variable is created.min - the minimum value of the domain.max - the maximum value of the domain.
public SetVar(Store store,
java.lang.String name)
store - store in which the variable is created.name - the name for the variable being created.
public SetVar(Store store,
java.lang.String name,
int min,
int max)
store - the store in which the variable is created.name - the name of the variable being created.min - the minimum value of the variables domain.max - the maximum value of the variables domain.| Method Detail |
|---|
public void addDom(int min,
int max)
min - the left bound of the interval being added.max - the right bound of the interval being added.
public void setDomain(int min,
int max)
min - the left bound of the interval used to set this variable domain to.max - the right bound of the interval used to set this variable domain to.public void setDomain(SetDomain dom)
dom - domain to which the current variable domain is set to.public void addDom(SetDomain dom)
dom - the added domain.public SetDomain dom()
dom in class Varpublic boolean eq(SetVar var)
var - the variable to which current variable is compared to.
public int getSize()
getSize in class Varpublic boolean isEmpty()
isEmpty in class Var
public void putModelConstraint(Constraint c,
int pruningEvent)
putModelConstraint in class Varc - the constraint which is being attached to the variable.pruningEvent - type of the event which must occur to trigger the execution of the consistency function.public void putSearchConstraint(Constraint c)
putSearchConstraint in class Varc - the constraint which is added as a search constraint.public SetDomain recentDomainPruning()
public void removeConstraint(Constraint c)
removeConstraint in class Varc - the constraint being detached from the variable.public boolean singleton()
singleton in class Varpublic int sizeConstraints()
sizeConstraints in class Varpublic int sizeConstraintsOriginal()
sizeConstraintsOriginal in class Varpublic int sizeSearchConstraints()
sizeSearchConstraints in class Varpublic int level()
level in interface Backtrackablelevel in class Varpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toStringFull()
toStringFull in class Varpublic void remove(int removedLevel)
Backtrackable
public void domainHasChanged(int event)
domainHasChanged in class Varevent - the type of the change (GROUND, BOUND, ANY).public void putConstraint(Constraint c)
Var
putConstraint in class Varc - the constraint being attached to this variable.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||