public class BooleanVar extends IntVar
Constructor and Description |
---|
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,
org.jacop.core.BoundDomain dom)
It creates a Boolean variable.
|
BooleanVar(Store store,
int min,
int max)
Boolean variable constructor.
|
BooleanVar(Store store,
String name)
Boolean variable constructor.
|
BooleanVar(Store store,
String name,
org.jacop.core.BoundDomain dom)
It creates a Boolean variable.
|
BooleanVar(Store store,
String name,
int min,
int max)
Boolean variable constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDom(Domain dom)
It is possible to add the domain of variable.
|
org.jacop.core.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.
|
org.jacop.core.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.
|
String |
toString() |
String |
toStringFull()
It returns the string representation of the variable using the full representation
of the domain.
|
addDom, addDom, eq, getSizeFloat, max, min, setDomain, setDomain, singleton, value
activity, addPositionMapping, addPositionMapping, afcValue, applyDecay, createEmptyPositioning, getStore, id, index, positionMapping, positionMapping, updateActivity
public BooleanVar()
public BooleanVar(Store store)
store
- It specifies the store in which boolean variable should be created.public BooleanVar(Store store, 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, 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, int min, int max)
store
- It specifies the store in which boolean variable should be created.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, org.jacop.core.BoundDomain dom)
store
- It specifies the store in which boolean variable should be created.dom
- It specifies the domain of the boolean variable.public void putModelConstraint(Constraint constraint, int pruningEvent)
putModelConstraint
in class IntVar
constraint
- - 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 IntVar
constraint
- It specifies the constraint which is being added.public void removeConstraint(Constraint constraint)
removeConstraint
in class IntVar
constraint
- it specifies the constraint which is no longer attached to a variable.public int sizeConstraints()
sizeConstraints
in class IntVar
public int sizeConstraintsOriginal()
sizeConstraintsOriginal
in class IntVar
public int sizeSearchConstraints()
sizeSearchConstraints
in class IntVar
public String toString()
public String toStringFull()
IntVar
toStringFull
in class IntVar
public void addDom(Domain dom)
dom
- the added domain.public org.jacop.core.BoundDomain dom()
public boolean eq(BooleanVar var)
var
- the variable to which current variable is compared to.public int getSize()
public boolean isEmpty()
public org.jacop.core.BoundDomain recentDomainPruning()
recentDomainPruning
in class IntVar
public boolean singleton()
public int level()
level
in interface Backtrackable
level
in class IntVar
public void remove(int removedLevel)
Backtrackable
remove
in interface Backtrackable
remove
in class IntVar
removedLevel
- level that is being removed.public void domainHasChanged(int event)
domainHasChanged
in class IntVar
event
- the type of the change (GROUND, BOUND, ANY).public void putConstraint(Constraint c)
Var
putConstraint
in class IntVar
c
- the constraint being attached to this variable.Copyright © 2022. All rights reserved.