public abstract class SetDomain extends Domain
Modifier and Type | Field and Description |
---|---|
static int |
ANY
Any event.
|
static int |
BOUND
Bound event.
|
static int |
CARDINALITY
It specifies event that has changed the cardinality of the set.
|
static SetDomain |
emptyDomain
It predefines empty domain so there is no need to constantly create it when
needed.
|
static int |
GLB
It specifies event that GLB has grown.
|
static int |
GROUND
It specifies event that Set variable became singleton.
|
static int |
LUB
It specifies event that LUB has shrank.
|
static int |
MaxElement
It specifies the maximum element in the set domain.
|
static int |
MinElement
It specifies the minimum element in the set domain.
|
SetDomain |
previousDomain
It specifies the previous domain which was used by this domain.
|
static int |
SetDomainID
It specifies an unique ID for the domain.
|
failException, modelConstraints, modelConstraintsToEvaluate, NOINFO, NONE, searchConstraints, searchConstraintsCloned, searchConstraintsToEvaluate, stamp
Constructor and Description |
---|
SetDomain() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addDom(IntDomain set)
Adds a set of values to the set of possible values used within this set domain.
|
abstract void |
addDom(Interval i)
Adds an interval to the lub.
|
abstract void |
addDom(int min,
int max)
Adds an interval [min..max] to the domain.
|
abstract void |
addDom(SetDomain domain)
Adds a set domain to this set domain.
|
abstract IntDomain |
card()
Returns the cardinality of the setDomain as [glb.card(), lub.card()]
|
abstract String |
checkInvariants()
It checks if the domain has correct state.
|
abstract void |
clear()
Sets the domain to an empty SetDomain.
|
abstract SetDomain |
clone()
It clones the domain object.
|
abstract SetDomain |
cloneLight()
It clones the domain object, only data responsible for encoding domain
values is cloned.
|
abstract boolean |
contains(int value)
It checks if value belongs to the domain of the set.
|
abstract boolean |
contains(IntDomain set)
It checks if the supplied set or setDomain is still potentially a subset of this domain.
|
abstract boolean |
contains(SetDomain domain)
It checks if the supplied set domain is a subset of this domain.
|
abstract int |
domainID()
It returns an unique identifier of the domain.
|
abstract boolean |
eq(SetDomain domain)
It checks if the domain is equal to the supplied domain.
|
int[] |
getEventsInclusion(int pruningEvent)
It helps to specify what events should be executed if a given event occurs.
|
abstract IntDomain |
glb()
It returns the least upper bound of the domain.
|
abstract void |
in(int storeLevel,
SetVar var,
IntDomain glb,
IntDomain lub)
This function is equivalent to in(int storeLevel, Variable var, int min, int max).
|
abstract void |
in(int storeLevel,
SetVar var,
SetDomain domain)
It updates the domain to have values only within the domain.
|
void |
in(int level,
Var var,
Domain domain)
It enforces that this domain is included within the specified domain.
|
abstract void |
inCardinality(int level,
SetVar a,
int i,
int j)
It restricts the possible cardinality of the set domain.
|
abstract void |
inGLB(int level,
SetVar var,
int element)
It adds if necessary an element to glb.
|
abstract void |
inGLB(int level,
SetVar var,
IntDomain domain)
It specifies what elements must be in GLB.
|
abstract void |
inLUB(int level,
SetVar var,
IntDomain domain)
It specifies what elements can be in LUB.
|
abstract void |
inLUBComplement(int level,
SetVar var,
int element)
It specifies the element which can *NOT* be used as an element within a set assign
to a set variable.
|
abstract SetDomain |
intersect(IntDomain set)
It intersects current domain with the set of allowed values to be taken
by the set domain.
|
abstract SetDomain |
intersect(SetDomain domain)
It intersects current domain with the one given as a parameter.
|
abstract void |
inValue(int level,
SetVar var,
IntDomain set)
It assigns a set variable to the specified value.
|
abstract boolean |
isEmpty()
It returns true if given domain is empty.
|
abstract boolean |
isIntersecting(int min,
int max)
In intersects current domain with the interval min..max.
|
abstract boolean |
isIntersecting(SetDomain domain)
It returns true if this domain intersects with the supplied domain.
|
abstract boolean |
isNumeric()
A set is never numeric
|
abstract boolean |
isSparseRepresentation()
A set is not sparse
|
abstract IntDomain |
lub()
It returns the least upper bound of the domain.
|
int |
noConstraints()
It returns the number of constraints
|
void |
putModelConstraint(int storeLevel,
Var var,
Constraint C,
int pruningEvent)
It adds a constraint to a domain, it should only be called by
putConstraint function of Variable object.
|
void |
putSearchConstraint(int storeLevel,
Var var,
Constraint C)
It adds a constraint to a domain, it should only be called by
putConstraint function of Variable object.
|
SetDomain |
recentDomainPruning(int storeLevel)
It returns the values which have been removed at current store level.
|
void |
removeLevel(int level,
Var var)
It removes the specified level.
|
void |
removeModelConstraint(int storeLevel,
Var var,
Constraint C)
It removes a constraint from a domain, it should only be called by
removeConstraint function of Variable object.
|
void |
removeSearchConstraint(int storeLevel,
Var var,
int position,
Constraint C)
It removes a constraint from a domain, it should only be called by
removeConstraint function of Variable object.
|
abstract void |
setDomain(int min,
int max)
It sets the domain to contain any values in between min and max.
|
abstract void |
setDomain(SetDomain domain)
It sets the domain to the specified domain.
|
abstract boolean |
singleton()
It returns true if given domain has only one set-element.
|
abstract boolean |
singleton(IntDomain set)
It check whether the set domain is singleton and its value is
equal to the specified set.
|
int |
sizeConstraintsOriginal()
It returns all constraints which are associated with variable, even the
ones which are already satisfied.
|
abstract SetDomain |
subtract(int value)
It removes the value from any set allowed to be taken
by this set domain.
|
abstract SetDomain |
subtract(int min,
int max)
It subtracts the set {min..max}.
|
abstract SetDomain |
subtract(SetDomain domain)
It subtracts domain from current domain and returns the result.
|
String |
toStringConstraints()
It returns string description of the constraints attached to the domain.
|
String |
toStringFull()
not implemented.
|
abstract SetDomain |
union(int value)
It computes union of this domain and value.
|
abstract SetDomain |
union(int min,
int max)
It computes union of this domain and the interval.
|
abstract SetDomain |
union(SetDomain domain)
It computes union of the supplied domain with this domain.
|
abstract ValueEnumeration |
valueEnumeration()
It returns value enumeration of the domain values.
|
constraints, getSize, noSearchConstraints, searchConstraints, setStamp, singleton, sizeConstraints, stamp, toString
public static final int MinElement
public static final int MaxElement
public static final int SetDomainID
public static final int GROUND
public static final int GLB
public static final int LUB
public static final int BOUND
public static final int ANY
public static final int CARDINALITY
public SetDomain previousDomain
public static final SetDomain emptyDomain
public int[] getEventsInclusion(int pruningEvent)
getEventsInclusion
in class Domain
pruningEvent
- the pruning event for which we want to know what events it encompasses.public abstract void addDom(Interval i)
i
- The interval to be added to the lub.public abstract void addDom(IntDomain set)
set
- a set of values which can be taken by a set domain.public abstract void addDom(SetDomain domain)
domain
- a set domain containing information what sets are being added.public abstract void addDom(int min, int max)
min
- min value in the setmax
- max value in the setpublic abstract IntDomain card()
public abstract void clear()
public abstract boolean contains(IntDomain set)
set
- the set for which we check the inclusion relation.public abstract boolean contains(SetDomain domain)
domain
- the domain for which we check the inclusion relation.public abstract boolean contains(int value)
value
- value which is checked.public abstract int domainID()
public abstract boolean eq(SetDomain domain)
domain
- against which the equivalence test is performed.public abstract void in(int storeLevel, SetVar var, IntDomain glb, IntDomain lub)
storeLevel
- the level of the store at which the change occurrs.var
- the set variable for which the domain may change.glb
- the greatest lower bound of the domain.lub
- the least upper bound of the domain.public abstract void in(int storeLevel, SetVar var, SetDomain domain)
storeLevel
- level of the store at which the update occurs.var
- variable for which this domain is used.domain
- the domain according to which the domain is updated.public abstract SetDomain intersect(SetDomain domain)
domain
- domain with which the intersection needs to be computed.public abstract SetDomain intersect(IntDomain set)
set
- set of values which are allowed to be used within a set.public abstract boolean isEmpty()
public abstract boolean isIntersecting(SetDomain domain)
domain
- the domain against which the intersection is being checked.public abstract boolean isIntersecting(int min, int max)
min
- the left bound of the interval (inclusive)max
- the right bound of the interval (inclusive)public abstract boolean isNumeric()
public abstract boolean isSparseRepresentation()
isSparseRepresentation
in class Domain
public abstract IntDomain lub()
public abstract IntDomain glb()
public abstract SetDomain clone()
public abstract SetDomain cloneLight()
cloneLight
in class Domain
public void putModelConstraint(int storeLevel, Var var, Constraint C, int pruningEvent)
putModelConstraint
in class Domain
storeLevel
- the level at which the model constraint is to be added.var
- variable to which the constraint is attached to.C
- the constraint which is being attached to a variable.pruningEvent
- the type of the prunning event required to check the consistency of the attached constraint.public void putSearchConstraint(int storeLevel, Var var, Constraint C)
putSearchConstraint
in class Domain
storeLevel
- the level at which the search constraint is to be added.var
- variable to which the constraint is attached to.C
- the constraint which is being attached to a variable.public SetDomain recentDomainPruning(int storeLevel)
storeLevel
- the current store level.public void removeLevel(int level, Var var)
removeLevel
in class Domain
level
- the level which is being removed.var
- the variable to which this domain belonged to.public void removeSearchConstraint(int storeLevel, Var var, int position, Constraint C)
removeSearchConstraint
in class Domain
storeLevel
- specifies the current level of the store, from which it should be removed.var
- specifies variable for which the constraint is being removed.position
- specifies the position of the removed constraint.C
- the constraint which is being removed.public void removeModelConstraint(int storeLevel, Var var, Constraint C)
removeModelConstraint
in class Domain
storeLevel
- specifies the current level of the store, from which it should be removed.var
- specifies variable for which the constraint is being removed.C
- the constraint which is being removed.public abstract void setDomain(SetDomain domain)
domain
- the domain from which this domain takes all elements.public abstract void setDomain(int min, int max)
min
- the minimum value allowed to be taken within the set.max
- the maximal value allowed to be taken within the set.public abstract boolean singleton()
public abstract boolean singleton(IntDomain set)
set
- the set for which we check if it is equal to a value taken by this set domain.public int sizeConstraintsOriginal()
sizeConstraintsOriginal
in class Domain
public abstract SetDomain subtract(SetDomain domain)
domain
- the domain which is subtracted from this domain.public abstract SetDomain subtract(int min, int max)
min
- the left bound of the set.max
- the right bound of the set.public abstract SetDomain subtract(int value)
value
- value which can not be used within any set value assigned to this set domain.public String toStringConstraints()
toStringConstraints
in class Domain
public String toStringFull()
toStringFull
in class Domain
public abstract SetDomain union(SetDomain domain)
domain
- the domain for which the union is computed.public abstract SetDomain union(int min, int max)
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public abstract SetDomain union(int value)
value
- it specifies the value which is being added.public abstract ValueEnumeration valueEnumeration()
valueEnumeration
in class Domain
public abstract String checkInvariants()
Domain
checkInvariants
in class Domain
public void in(int level, Var var, Domain domain)
Domain
public abstract void inLUB(int level, SetVar var, IntDomain domain)
level
- level of the store at which this restriction takes place.var
- variable which domain is being restricted.domain
- the domain specifying the allowed values the domain of the set variable.public abstract void inLUBComplement(int level, SetVar var, int element)
level
- level of the store at which this restriction takes place.var
- variable which domain is being restricted.element
- the value being removed from the domain of the set variable.public abstract void inGLB(int level, SetVar var, IntDomain domain)
level
- level of the store at which this addition takes place.var
- variable which domain is being restricted.domain
- the domain specifying the required values of the set variable.public abstract void inGLB(int level, SetVar var, int element)
level
- 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 abstract void inValue(int level, SetVar var, IntDomain set)
level
- 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 int noConstraints()
noConstraints
in class Domain
public abstract void inCardinality(int level, SetVar a, int i, int j)
level
- level of the store at which the restriction takes place.a
- the variable which domain is being restricted.i
- the minimal allowed cardinalityj
- the maximal allowed cardinalityCopyright © 2022. All rights reserved.