public class BoundSetDomain extends SetDomain implements Cloneable
Modifier and Type | Field and Description |
---|---|
IntDomain |
cardinality
The cardinality of the set.
|
IntDomain |
glb
The greatest lower bound of the domain.
|
IntDomain |
lub
The least upper bound of the domain.
|
ANY, BOUND, CARDINALITY, emptyDomain, GLB, GROUND, LUB, MaxElement, MinElement, previousDomain, SetDomainID
failException, modelConstraints, modelConstraintsToEvaluate, NOINFO, NONE, searchConstraints, searchConstraintsCloned, searchConstraintsToEvaluate, stamp
Constructor and Description |
---|
BoundSetDomain()
It is a constructor which will create an empty SetDomain.
|
BoundSetDomain(IntDomain glb,
IntDomain lub)
Creates a new instance of SetDomain.
|
BoundSetDomain(IntDomain glb,
IntDomain lub,
IntDomain cardinality)
Creates BoundSetDomain object.
|
BoundSetDomain(int e1,
int e2)
It creates a new instance of SetDomain with glb empty and lub={e1..e2}
|
Modifier and Type | Method and Description |
---|---|
void |
addDom(IntDomain set)
Adds a set of value to the possible values used within this set domain.
|
void |
addDom(Interval i)
Adds an interval to the lub.
|
void |
addDom(int min,
int max)
Adds an interval [min..max] to the domain.
|
void |
addDom(SetDomain domain)
Adds a set to the domain.
|
IntDomain |
card()
Returns the cardinality of the setDomain as [glb.card(), lub.card()]
|
String |
checkInvariants()
It checks if the domain has correct state.
|
void |
clear()
Sets the domain to an empty SetDomain.
|
BoundSetDomain |
clone()
Clones the domain.
|
SetDomain |
cloneLight()
It clones the domain object, only data responsible for encoding domain
values is cloned.
|
SetDomain |
complement()
It creates a complement of a domain.
|
boolean |
contains(int value)
It checks if value belongs to the domain.
|
boolean |
contains(IntDomain set)
It checks if the supplied set or setDomain is a subset of this domain.
|
boolean |
contains(SetDomain domain)
It checks if the supplied set domain is a subset of this domain.
|
int |
domainID()
It returns an unique identifier of the domain.
|
boolean |
eq(SetDomain domain)
It checks if the domain is equal to the supplied domain.
|
int |
getSize()
Returns the number of elements in the domain.
|
IntDomain |
glb()
It returns the greatest lower bound of the domain.
|
void |
in(int storeLevel,
SetVar var,
IntDomain inGLB,
IntDomain inLUB)
This function is equivalent to in(int storeLevel, Variable var, int min, int max).
|
void |
in(int storeLevel,
SetVar var,
SetDomain setDom)
It updates the domain to have values only within the domain.
|
void |
inCardinality(int level,
SetVar var,
int min,
int max)
It restricts the possible cardinality of the set domain.
|
void |
inGLB(int level,
SetVar var,
int element)
It adds if necessary an element to glb.
|
void |
inGLB(int level,
SetVar var,
IntDomain intersect)
It specifies what elements must be in GLB.
|
void |
inLUB(int level,
SetVar var,
IntDomain intersect)
It specifies what elements can be in LUB.
|
void |
inLUBComplement(int level,
SetVar var,
int element)
It removes if necessary an element from lub.
|
SetDomain |
intersect(IntDomain domain)
It intersects current domain with the one given as a parameter.
|
SetDomain |
intersect(SetDomain domain)
It intersects current domain with the one given as a parameter.
|
void |
inValue(int level,
SetVar var,
IntDomain set)
It assigns a set variable to the specified value.
|
void |
inValueGLB(int level,
SetVar var)
It assigns a set variable to glb of its current domain.
|
void |
inValueLUB(int level,
SetVar var)
It assigns a set variable to lub of its current domain.
|
boolean |
isEmpty()
It returns true if given domain is empty.
|
boolean |
isIntersecting(int min,
int max)
In intersects current domain with the interval min..max.
|
boolean |
isIntersecting(SetDomain domain)
It returns true if given domain intersects this domain.
|
boolean |
isNumeric()
A set is never numeric
|
boolean |
isSparseRepresentation()
A set is not sparse
|
IntDomain |
lub()
It returns the least upper bound of the domain.
|
void |
setDomain(int min,
int max)
It sets the domain to the the set {min..max}.
|
void |
setDomain(SetDomain domain)
It sets the domain to the specified domain.
|
boolean |
singleton()
It returns true if given domain has only one set-element.
|
boolean |
singleton(Domain value)
It returns true if given domain has only one element.
|
boolean |
singleton(IntDomain set)
It returns true if given domain has only one set-element and this set-element only contains c.
|
SetDomain |
subtract(int value)
It subtracts the set {value}.
|
SetDomain |
subtract(int min,
int max)
It subtracts the elements of the set {min..max}.
|
SetDomain |
subtract(SetDomain domain)
It subtracts domain from current domain and returns the result.
|
String |
toString()
It returns string description of the domain.
|
SetDomain |
union(int value)
It computes union of this domain and value.
|
SetDomain |
union(int min,
int max)
It computes union of this domain and the interval.
|
SetDomain |
union(SetDomain domain)
It computes union of the supplied domain with this domain.
|
ValueEnumeration |
valueEnumeration()
It returns value enumeration of the domain values.
|
getEventsInclusion, in, noConstraints, putModelConstraint, putSearchConstraint, recentDomainPruning, removeLevel, removeModelConstraint, removeSearchConstraint, sizeConstraintsOriginal, toStringConstraints, toStringFull
constraints, noSearchConstraints, searchConstraints, setStamp, sizeConstraints, stamp
public IntDomain glb
public IntDomain lub
public IntDomain cardinality
public BoundSetDomain(IntDomain glb, IntDomain lub, IntDomain cardinality)
glb
- it specifies the left bound of the SetDomain (inclusive).lub
- it specifies the right bound of the setDomain (inclusive).cardinality
- it specifies the allowed cardinality of the assigned set.public BoundSetDomain(IntDomain glb, IntDomain lub)
glb
- it specifies the left bound of the SetDomain (inclusive).lub
- it specifies the right bound of the setDomain (inclusive).public BoundSetDomain()
public BoundSetDomain(int e1, int e2)
e1
- the minimum element of lub.e2
- the maximum element of lub.public void addDom(IntDomain set)
public void addDom(SetDomain domain)
public void addDom(int min, int max)
public IntDomain card()
public void clear()
public BoundSetDomain clone()
public SetDomain cloneLight()
cloneLight
in class SetDomain
public SetDomain complement()
public boolean contains(IntDomain set)
public boolean contains(SetDomain domain)
SetDomain
public boolean contains(int value)
public int domainID()
public boolean eq(SetDomain domain)
public int getSize()
public IntDomain glb()
public void in(int storeLevel, SetVar var, IntDomain inGLB, IntDomain inLUB)
public void in(int storeLevel, SetVar var, SetDomain setDom)
public SetDomain intersect(SetDomain domain)
public SetDomain intersect(IntDomain domain)
public boolean isEmpty()
public boolean isIntersecting(SetDomain domain)
isIntersecting
in class SetDomain
domain
- the domain against which the intersection is being checked.public boolean isIntersecting(int min, int max)
isIntersecting
in class SetDomain
min
- the left bound of the interval (inclusive)max
- the right bound of the interval (inclusive)public boolean isNumeric()
public boolean isSparseRepresentation()
isSparseRepresentation
in class SetDomain
public IntDomain lub()
public void setDomain(SetDomain domain)
public void setDomain(int min, int max)
public boolean singleton()
public boolean singleton(IntDomain set)
public SetDomain subtract(SetDomain domain)
public SetDomain subtract(int min, int max)
public SetDomain subtract(int value)
public String toString()
public SetDomain union(SetDomain domain)
public SetDomain union(int min, int max)
public SetDomain union(int value)
public ValueEnumeration valueEnumeration()
valueEnumeration
in class SetDomain
public String checkInvariants()
Domain
checkInvariants
in class SetDomain
public void inGLB(int level, SetVar var, int element)
public void inLUBComplement(int level, SetVar var, int element)
inLUBComplement
in class SetDomain
level
- level at which the change is recorded.var
- set variable to which the change applies to.element
- the element which can not be in lub.public void inValue(int level, SetVar var, IntDomain set)
SetDomain
public boolean singleton(Domain value)
Domain
public void inLUB(int level, SetVar var, IntDomain intersect)
SetDomain
public void inValueLUB(int level, SetVar var)
level
- level of the store at which the change takes place.var
- variable for which the domain is changing.public void inGLB(int level, SetVar var, IntDomain intersect)
SetDomain
public void inValueGLB(int level, SetVar var)
level
- level of the store at which the change takes place.var
- variable for which the domain is changing.public void addDom(Interval i)
SetDomain
public void inCardinality(int level, SetVar var, int min, int max)
SetDomain
inCardinality
in class SetDomain
level
- level of the store at which the restriction takes place.var
- the variable which domain is being restricted.min
- the minimal allowed cardinalitymax
- the maximal allowed cardinalityCopyright © 2022. All rights reserved.