|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.core.Domain
JaCoP.set.core.SetDomain
JaCoP.set.core.BoundSetDomain
public class BoundSetDomain
Defines a set interval determined by a least upper bound(lub) and a greatest lower bound(glb). The domain consist of zero, one or several sets.
| Field Summary | |
|---|---|
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. |
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.set.core.SetDomain |
|---|
ANY, BOUND, CARDINALITY, emptyDomain, eventsInclusion, GLB, GROUND, LUB, previousDomain, SetDomainID |
| Fields inherited from class JaCoP.core.Domain |
|---|
modelConstraints, modelConstraintsToEvaluate, NOINFO, NONE, searchConstraints, searchConstraintsCloned, searchConstraintsToEvaluate, stamp |
| Constructor Summary | |
|---|---|
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} |
|
| Method Summary | |
|---|---|
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()] |
java.lang.String |
checkInvariants()
It checks if the domain has correct state. |
void |
clear()
Sets the domain to an empty SetDomain. |
SetDomain |
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. |
java.lang.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. |
| Methods inherited from class JaCoP.set.core.SetDomain |
|---|
getEventsInclusion, in, noConstraints, putModelConstraint, putSearchConstraint, recentDomainPruning, removeLevel, removeModelConstraint, removeSearchConstraint, sizeConstraintsOriginal, toStringConstraints, toStringFull |
| Methods inherited from class JaCoP.core.Domain |
|---|
constraints, noSearchConstraints, searchConstraints, setStamp, sizeConstraints, stamp |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public IntDomain glb
public IntDomain lub
public IntDomain cardinality
public static java.lang.String[] xmlAttributes
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public void addDom(IntDomain set)
addDom in class SetDomainset - a set of values which can be taken by a set domain.public void addDom(SetDomain domain)
addDom in class SetDomaindomain - a set domain containing information what sets are being added.
public void addDom(int min,
int max)
addDom in class SetDomainmin - min value in the setmax - max value in the setpublic IntDomain card()
card in class SetDomainpublic void clear()
clear in class SetDomainpublic SetDomain clone()
clone in class Domainpublic SetDomain cloneLight()
cloneLight in class SetDomainpublic SetDomain complement()
public boolean contains(IntDomain set)
contains in class SetDomainset - the set for which we check the inclusion relation.
public boolean contains(SetDomain domain)
SetDomain
contains in class SetDomaindomain - the domain for which we check the inclusion relation.
public boolean contains(int value)
contains in class SetDomainvalue - value which is checked.
public int domainID()
domainID in class SetDomainpublic boolean eq(SetDomain domain)
eq in class SetDomaindomain - against which the equivalence test is performed.
public int getSize()
getSize in class Domainpublic IntDomain glb()
glb in class SetDomain
public void in(int storeLevel,
SetVar var,
IntDomain inGLB,
IntDomain inLUB)
in in class SetDomainstoreLevel - the level of the store at which the change occurrs.var - the set variable for which the domain may change.inGLB - the greatest lower bound of the domain.inLUB - the least upper bound of the domain.
public void in(int storeLevel,
SetVar var,
SetDomain setDom)
in in class SetDomainstoreLevel - level of the store at which the update occurs.var - variable for which this domain is used.setDom - the domain according to which the domain is updated.public SetDomain intersect(SetDomain domain)
intersect in class SetDomaindomain - domain with which the intersection needs to be computed.
public SetDomain intersect(IntDomain domain)
intersect in class SetDomaindomain - domain with which the intersection needs to be computed.
public boolean isEmpty()
isEmpty in class SetDomainpublic boolean isIntersecting(SetDomain domain)
isIntersecting in class SetDomaindomain - the domain against which the intersection is being checked.
public boolean isIntersecting(int min,
int max)
isIntersecting in class SetDomainmin - the left bound of the interval (inclusive)max - the right bound of the interval (inclusive)
public boolean isNumeric()
isNumeric in class SetDomainpublic boolean isSparseRepresentation()
isSparseRepresentation in class SetDomainpublic IntDomain lub()
lub in class SetDomainpublic void setDomain(SetDomain domain)
setDomain in class SetDomaindomain - the domain from which this domain takes all elements.
public void setDomain(int min,
int max)
setDomain in class SetDomainmin - the minimum value allowed to be taken within the set.max - the maximal value allowed to be taken within the set.public boolean singleton()
singleton in class SetDomainpublic boolean singleton(IntDomain set)
singleton in class SetDomainset - the set for which we check if it is equal to a value taken by this set domain.
public SetDomain subtract(SetDomain domain)
subtract in class SetDomaindomain - the domain which is subtracted from this domain.
public SetDomain subtract(int min,
int max)
subtract in class SetDomainmin - the left bound of the set.max - the right bound of the set.
public SetDomain subtract(int value)
subtract in class SetDomainvalue - value which can not be used within any set value assigned to this set domain.
public java.lang.String toString()
toString in class Domainpublic SetDomain union(SetDomain domain)
union in class SetDomaindomain - the domain for which the union is computed.
public SetDomain union(int min,
int max)
union in class SetDomainmin - the left bound of the interval (inclusive).max - the right bound of the interval (inclusive).
public SetDomain union(int value)
union in class SetDomainvalue - it specifies the value which is being added.
public ValueEnumeration valueEnumeration()
valueEnumeration in class SetDomainpublic java.lang.String checkInvariants()
Domain
checkInvariants in class SetDomain
public void inGLB(int level,
SetVar var,
int element)
inGLB in class SetDomainlevel - level at which the change is recorded.var - set variable to which the change applies to.element - the element which must be in glb.
public void inLUBComplement(int level,
SetVar var,
int element)
inLUBComplement in class SetDomainlevel - 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
inValue in class SetDomainlevel - level at which the change is recorded.var - set variable to which the change applies to.set - the value assigned to a set variable.public boolean singleton(Domain value)
Domain
singleton in class Domainvalue - value represented as domain object to which the domain must be equal to.
public void inLUB(int level,
SetVar var,
IntDomain intersect)
SetDomain
inLUB in class SetDomainlevel - level of the store at which this restriction takes place.var - variable which domain is being restricted.intersect - the domain specifying the allowed values the domain of the set variable.
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
inGLB in class SetDomainlevel - level of the store at which this addition takes place.var - variable which domain is being restricted.intersect - the domain specifying the required values of the set variable.
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
addDom in class SetDomaini - The interval to be added to the lub.
public void inCardinality(int level,
SetVar var,
int min,
int max)
SetDomain
inCardinality in class SetDomainlevel - 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 cardinality
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||