|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.core.Domain
JaCoP.core.IntDomain
JaCoP.core.BoundDomain
public class BoundDomain
Defines interval of numbers which is part of FDV definition which consist of one or several intervals.
| Field Summary | |
|---|---|
static BoundDomain |
emptyDomain
It predefines empty domain so there is no need to constantly create it when needed. |
int |
max
The maximal value of the domain. |
int |
min
The minimal value of the domain. |
BoundDomain |
previousDomain
It specifies the previous domain which was used by this domain. |
| Fields inherited from class JaCoP.core.IntDomain |
|---|
ANY, BOUND, BoundDomainID, emptyIntDomain, eventsInclusion, GROUND, IntervalDomainID, MaxInt, MinInt, SmallDenseDomainID |
| Fields inherited from class JaCoP.core.Domain |
|---|
modelConstraints, modelConstraintsToEvaluate, NOINFO, NONE, searchConstraints, searchConstraintsCloned, searchConstraintsToEvaluate, stamp |
| Constructor Summary | |
|---|---|
BoundDomain()
It is a constructor which will create an empty Bound domain. |
|
BoundDomain(int min,
int max)
Creates a new instance of BoundDomain. |
|
| Method Summary | |
|---|---|
void |
addDom(IntDomain domain)
It adds values as specified by the parameter to the domain. |
java.lang.String |
checkInvariants()
It checks if the domain has correct state. |
void |
clear()
It removes all elements. |
BoundDomain |
clone()
It clones the domain object. |
BoundDomain |
cloneLight()
It clones this domain. |
IntDomain |
complement()
It creates a complement of a domain. |
boolean |
contains(int value)
It checks if value belongs to the domain. |
boolean |
contains(IntDomain domain)
It specifies if the current domain contains the domain given as a parameter. |
boolean |
contains(int min,
int max)
It checks if an interval min..max belongs to the domain. |
IntDomain |
divide(int div)
It divides the domain by a given constant. |
int |
domainID()
It returns an unique identifier of the domain. |
boolean |
eq(IntDomain domain)
It specifies if the other int domain is equal to this one. |
int |
getElementAt(int index)
It access the element at the specified position. |
Interval |
getInterval(int position)
It returns required interval. |
int |
getRandomValue()
It returns a random value from the domain. |
int |
getSize()
It returns the size of the domain. |
void |
in(int storeLevel,
Var var,
IntDomain domain)
It updates the domain to have values only within the domain. |
void |
in(int storeLevel,
Var var,
int min,
int max)
It updates the domain to have values only within the interval min..max. |
void |
inComplement(int storeLevel,
Var var,
int complement)
It updates the domain to not contain the value complement. |
void |
inComplement(int storeLevel,
Var var,
int min,
int max)
It updates the domain so it does not contain the supplied interval. |
void |
inMax(int storeLevel,
Var var,
int max)
It updates the domain according to the maximum value and stamp value. |
void |
inMin(int storeLevel,
Var var,
int min)
It updates the domain according to the minimum value and stamp value. |
void |
inShift(int storeLevel,
Var var,
IntDomain domain,
int shift)
It updates the domain to contain the elements as specifed by the domain, which is shifted. |
IntDomain |
intersect(IntDomain dom)
It intersects current domain with the one given as a parameter. |
IntDomain |
intersect(int min,
int max)
In intersects current domain with the interval min..max. |
int |
intersectAdapt(IntDomain intersect)
It computes an intersection with a given domain and stores it in this domain. |
int |
intersectAdapt(int minIntersect,
int maxIntersect)
It computes an intersection of this domain with an interval [min..max]. |
IntervalEnumeration |
intervalEnumeration()
It returns interval enumeration of the domain values. |
boolean |
isEmpty()
It returns true if given domain is empty. |
boolean |
isIntersecting(IntDomain domain)
Checks if two domains intersect. |
boolean |
isIntersecting(int min,
int max)
It checks if interval min..max intersects with current domain. |
boolean |
isNumeric()
It specifies if domain is a finite domain of numeric values (integers). |
boolean |
isSparseRepresentation()
It specifies if the domain type is more suited to representing sparse domain. |
int |
leftElement(int intervalNo)
It returns the left most element of the given interval. |
int |
max()
It returns the maximum value in a domain. |
int |
min()
It returns the minimum value in a domain. |
IntDomain |
multiply(int mul)
It multiplies the domain by a given constant. |
int |
nextValue(int value)
It gives next value in the domain from the given one (lexigraphical ordering). |
int |
noIntervals()
It returns number of intervals required to represent this domain. |
int |
previousValue(int value)
It gives previous value in the domain from the given one (lexigraphical ordering). |
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. |
IntDomain |
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. |
int |
rightElement(int intervalNo)
It returns the right most element of the given interval. |
void |
setDomain(IntDomain domain)
It sets the domain to the specified domain. |
void |
setDomain(int min,
int max)
It sets this domain to contain exactly all values between min and max. |
boolean |
singleton()
It returns true if given domain has only one element. |
boolean |
singleton(int c)
It returns true if given domain has only one element equal c. |
int |
sizeConstraintsOriginal()
It returns all constraints which are associated with variable, even the ones which are already satisfied. |
int |
sizeOfIntersection(IntDomain domain)
It computes the size of the intersection between this domain and the domain supplied as a parameter. |
IntDomain |
subtract(int value)
It intersects with the domain which is a complement of value. |
IntDomain |
subtract(IntDomain domain)
It subtracts domain from current domain and returns the result. |
BoundDomain |
subtract(int min,
int max)
It subtracts interval min..max. |
void |
subtractAdapt(int complement)
It removes value from the domain. |
void |
subtractAdapt(int min,
int max)
It removes all values between min and max to the domain. |
java.lang.String |
toString()
It returns string description of the domain (only values in the domain). |
java.lang.String |
toStringConstraints()
It returns string description of the constraints attached to the domain. |
java.lang.String |
toStringFull()
It returns complete string description containing all relevant information about the domain. |
IntDomain |
union(int value)
It computes union of this domain and value. |
IntDomain |
union(IntDomain domain)
It computes union of the supplied domain with this domain. |
IntDomain |
union(int min,
int max)
It computes union of this domain and the interval. |
void |
unionAdapt(int value)
It adds a values to the domain. |
void |
unionAdapt(Interval i)
It adds interval of values to the domain. |
void |
unionAdapt(int min,
int max)
It adds all values between min and max to the domain. |
ValueEnumeration |
valueEnumeration()
It returns value enumeration of the domain values. |
| Methods inherited from class JaCoP.core.IntDomain |
|---|
elementsSmallerThan, getEventsInclusion, in, inValue, lex, noConstraints, singleton, toIntArray, unionAdapt, value |
| 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 int min
public int max
public BoundDomain previousDomain
public static BoundDomain emptyDomain
| Constructor Detail |
|---|
public BoundDomain()
public BoundDomain(int min,
int max)
min - it specifies the left bound of the BoundDomain (inclusive).max - it specifies the right bound of the BoundDomain (inclusive).| Method Detail |
|---|
public void unionAdapt(Interval i)
IntDomain
unionAdapt in class IntDomaini - public void addDom(IntDomain domain)
IntDomain
addDom in class IntDomaindomain - Domain which needs to be added to the domain.
public void unionAdapt(int min,
int max)
IntDomain
unionAdapt in class IntDomainmin - the left bound of the interval being added.max - the right bound of the interval being added.public void clear()
Domain
clear in class Domainpublic BoundDomain clone()
Domain
clone in class Domainpublic BoundDomain cloneLight()
cloneLight in class IntDomainpublic IntDomain complement()
IntDomain
complement in class IntDomainpublic boolean contains(IntDomain domain)
IntDomain
contains in class IntDomaindomain - for which we check if it is contained in the current domain.
public boolean contains(int value)
IntDomain
contains in class IntDomainvalue - which is checked if it exists in the domain.
public IntDomain divide(int div)
div - the constant by which the domain should be divided.
public int domainID()
Domain
domainID in class Domainpublic boolean eq(IntDomain domain)
IntDomain
eq in class IntDomaindomain - the domain which is compared to this domain.
public Interval getInterval(int position)
IntDomain
getInterval in class IntDomainposition - the position of the interval.
public int getSize()
IntDomain
getSize in class IntDomain
public void in(int storeLevel,
Var var,
int min,
int max)
IntDomain
in in class IntDomainstoreLevel - level of the store at which the update occurs.var - variable for which this domain is used.min - the minimum value to which the domain is updated.max - the maximum value to which the domain is updated.
public void in(int storeLevel,
Var var,
IntDomain domain)
IntDomain
in in class IntDomainstoreLevel - 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 void inComplement(int storeLevel,
Var var,
int complement)
IntDomain
inComplement in class IntDomainstoreLevel - level of the store at which the update occurs.var - variable for which this domain is used.complement - value which is removed from the domain if it belonged to the domain.
public void inComplement(int storeLevel,
Var var,
int min,
int max)
IntDomain
inComplement in class IntDomainstoreLevel - level of the store at which the update occurs.var - variable for which this domain is used.min - the left bound of the interval (inclusive).max - the right bound of the interval (inclusive).
public void inMax(int storeLevel,
Var var,
int max)
IntDomain
inMax in class IntDomainstoreLevel - level of the store at which the update occurs.var - variable for which this domain is used.max - the maximum value to which the domain is updated.
public void inMin(int storeLevel,
Var var,
int min)
IntDomain
inMin in class IntDomainstoreLevel - level of the store at which the update occurs.var - variable for which this domain is used.min - the minimum value to which the domain is updated.
public void inShift(int storeLevel,
Var var,
IntDomain domain,
int shift)
IntDomain
inShift in class IntDomainstoreLevel - 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.shift - the shift which is used to shift the domain supplied as argument.public IntDomain intersect(IntDomain dom)
IntDomain
intersect in class IntDomaindom - domain with which the intersection needs to be computed.
public IntDomain intersect(int min,
int max)
IntDomain
intersect in class IntDomainmin - the left bound of the interval (inclusive)max - the right bound of the interval (inclusive)
public IntDomain subtract(int value)
IntDomain
subtract in class IntDomainvalue - the value for which the complement is computed
public IntervalEnumeration intervalEnumeration()
IntDomain
intervalEnumeration in class IntDomainpublic boolean isEmpty()
Domain
isEmpty in class Domainpublic boolean isIntersecting(IntDomain domain)
IntDomain
isIntersecting in class IntDomaindomain - the domain for which intersection is checked.
public boolean isIntersecting(int min,
int max)
IntDomain
isIntersecting in class IntDomainmin - the left bound of the interval.max - the right bound of the interval.
public boolean isNumeric()
Domain
isNumeric in class Domainpublic boolean isSparseRepresentation()
Domain
isSparseRepresentation in class Domainpublic int leftElement(int intervalNo)
IntDomain
leftElement in class IntDomainintervalNo - the interval number.
public int max()
IntDomain
max in class IntDomainpublic int min()
IntDomain
min in class IntDomainpublic IntDomain multiply(int mul)
mul - a factor by which the domain is being multiplied.
public int nextValue(int value)
IntDomain
nextValue in class IntDomainvalue - it specifies the value after which a next value has to be found.
public int noIntervals()
IntDomain
noIntervals in class IntDomain
public void putModelConstraint(int storeLevel,
Var var,
Constraint C,
int pruningEvent)
putModelConstraint in class DomainstoreLevel - 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 DomainstoreLevel - 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 IntDomain recentDomainPruning(int storeLevel)
IntDomain
recentDomainPruning in class IntDomainstoreLevel - the current store level.
public void removeLevel(int level,
Var var)
Domain
removeLevel in class Domainlevel - 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 DomainstoreLevel - 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 DomainstoreLevel - 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 int rightElement(int intervalNo)
IntDomain
rightElement in class IntDomainintervalNo - the interval number.
public void setDomain(IntDomain domain)
IntDomain
setDomain in class IntDomaindomain - the domain from which this domain takes all elements.
public void setDomain(int min,
int max)
IntDomain
setDomain in class IntDomainmin - the left bound of the interval (inclusive).max - the right bound of the interval (inclusive).public boolean singleton()
Domain
singleton in class Domainpublic boolean singleton(int c)
IntDomain
singleton in class IntDomainc - the value to which the only element should be equal to.
public int sizeConstraintsOriginal()
Domain
sizeConstraintsOriginal in class Domainpublic IntDomain subtract(IntDomain domain)
IntDomain
subtract in class IntDomaindomain - the domain which is subtracted from this domain.
public BoundDomain subtract(int min,
int max)
IntDomain
subtract in class IntDomainmin - the left bound of the interval (inclusive).max - the right bound of the interval (inclusive).
public java.lang.String toString()
Domain
toString in class Domainpublic java.lang.String toStringConstraints()
Domain
toStringConstraints in class Domainpublic java.lang.String toStringFull()
Domain
toStringFull in class Domainpublic IntDomain union(IntDomain domain)
IntDomain
union in class IntDomaindomain - the domain for which the union is computed.
public IntDomain union(int min,
int max)
IntDomain
union in class IntDomainmin - the left bound of the interval (inclusive).max - the right bound of the interval (inclusive).
public IntDomain union(int value)
IntDomain
union in class IntDomainvalue - it specifies the value which is being added.
public ValueEnumeration valueEnumeration()
IntDomain
valueEnumeration in class IntDomainpublic int previousValue(int value)
IntDomain
previousValue in class IntDomainvalue - before which a value is seeked for.
public java.lang.String checkInvariants()
Domain
checkInvariants in class Domainpublic void unionAdapt(int value)
IntDomain
unionAdapt in class IntDomainvalue - value being added to the domain.public void subtractAdapt(int complement)
IntDomain
subtractAdapt in class IntDomaincomplement - the value for which the complement is computed
public void subtractAdapt(int min,
int max)
IntDomain
subtractAdapt in class IntDomainmin - the left bound of the interval being removed.max - the right bound of the interval being removed.public int intersectAdapt(IntDomain intersect)
IntDomain
intersectAdapt in class IntDomainintersect - domain with which the intersection is being computed.
public int intersectAdapt(int minIntersect,
int maxIntersect)
IntDomain
intersectAdapt in class IntDomainminIntersect - the minimum value of the interval used in the intersection computation.maxIntersect - the maximum value of the interval used in the intersection computation.
public int getElementAt(int index)
IntDomain
getElementAt in class IntDomainindex - the position of the element, indexing starts from 0.
public int sizeOfIntersection(IntDomain domain)
IntDomain
sizeOfIntersection in class IntDomaindomain - the domain with which the intersection is computed.
public int getRandomValue()
IntDomain
getRandomValue in class IntDomain
public boolean contains(int min,
int max)
IntDomain
contains in class IntDomainmin - the minimum value of the interval being checkedmax - the maximum value of the interval being checked
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||