|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.core.Var
JaCoP.core.IntVar
JaCoP.core.BooleanVar
public class BooleanVar
Defines a variable and related operations on it.
| Field Summary | |
|---|---|
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.IntVar |
|---|
domain |
| Fields inherited from class JaCoP.core.Var |
|---|
id, idNumber, index, store, weight |
| Constructor Summary | |
|---|---|
BooleanVar()
No parameter, explicit, empty constructor for subclasses. |
|
BooleanVar(Store store)
This constructor creates a variable with empty domain (standard FD domain), automatically generated name, and empty attached constraint list. |
|
BooleanVar(Store store,
BoundDomain dom)
It creates a Boolean variable. |
|
BooleanVar(Store store,
java.lang.String name)
Boolean variable constructor. |
|
BooleanVar(Store store,
java.lang.String name,
BoundDomain dom)
It creates a Boolean variable. |
|
BooleanVar(Store store,
java.lang.String name,
int min,
int max)
Boolean variable constructor. |
|
| Method Summary | |
|---|---|
void |
addDom(Domain dom)
It is possible to add the domain of variable. |
BoundDomain |
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(BooleanVar 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 constraint,
int pruningEvent)
It registers constraint with current variable, so anytime this variable is changed the constraint is reevaluated. |
void |
putSearchConstraint(Constraint constraint)
It registers constraint with current variable, so anytime this variable is changed the constraint is reevaluated. |
BoundDomain |
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 constraint)
It unregisters constraint with current variable, so change in variable will not cause constraint reevaluation. |
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 a boolean 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.IntVar |
|---|
addDom, addDom, eq, max, min, setDomain, setDomain, singleton, value |
| 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 static java.lang.String[] xmlAttributes
| Constructor Detail |
|---|
public BooleanVar()
public BooleanVar(Store store)
store - It specifies the store in which boolean variable should be created.
public BooleanVar(Store store,
java.lang.String name)
store - It specifies the store in which boolean variable should be created.name - It specifies the id of the variable.
public BooleanVar(Store store,
java.lang.String name,
int min,
int max)
store - It specifies the store in which boolean variable should be created.name - It specifies the id of the variable.min - it specifies the minimum value, which must be greater or equal 0.max - it specifies the maximum value, which must be smaller or equal 1.
public BooleanVar(Store store,
BoundDomain dom)
store - It specifies the store in which boolean variable should be created.dom - It specifies the domain of the boolean variable.
public BooleanVar(Store store,
java.lang.String name,
BoundDomain dom)
store - the store in which the variable is being created.name - the name of the created variable.dom - the domain specifying the domain of the variable.| Method Detail |
|---|
public void putModelConstraint(Constraint constraint,
int pruningEvent)
putModelConstraint in class IntVarconstraint - - constraint being attached to a variable.pruningEvent - - Only NONE and GROUND events are considered. By default GROUND event is used.public void putSearchConstraint(Constraint constraint)
putSearchConstraint in class IntVarconstraint - It specifies the constraint which is being added.public void removeConstraint(Constraint constraint)
removeConstraint in class IntVarconstraint - it specifies the constraint which is no longer attached to a variable.public int sizeConstraints()
sizeConstraints in class IntVarpublic int sizeConstraintsOriginal()
sizeConstraintsOriginal in class IntVarpublic int sizeSearchConstraints()
sizeSearchConstraints in class IntVarpublic java.lang.String toString()
toString in class IntVarpublic java.lang.String toStringFull()
IntVar
toStringFull in class IntVarpublic void addDom(Domain dom)
dom - the added domain.public BoundDomain dom()
dom in class IntVarpublic boolean eq(BooleanVar var)
var - the variable to which current variable is compared to.
public int getSize()
getSize in class IntVarpublic boolean isEmpty()
isEmpty in class IntVarpublic BoundDomain recentDomainPruning()
recentDomainPruning in class IntVarpublic boolean singleton()
singleton in class IntVarpublic int level()
level in interface Backtrackablelevel in class IntVarpublic void remove(int removedLevel)
Backtrackable
remove in interface Backtrackableremove in class IntVarpublic void domainHasChanged(int event)
domainHasChanged in class IntVarevent - the type of the change (GROUND, BOUND, ANY).public void putConstraint(Constraint c)
Var
putConstraint in class IntVarc - the constraint being attached to this variable.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||