public abstract class IntDomain extends Domain
Modifier and Type | Field and Description |
---|---|
static int |
ANY
It specifies the constant for ANY event.
|
static int |
BOUND
It specifies the constant for BOUND event.
|
static int |
BoundDomainID
Unique identifier for a bound domain type.
|
static IntDomain |
emptyIntDomain
It specifies an empty integer domain.
|
static int[][] |
eventsInclusion
It specifies for each event what other events are subsumed by this
event.
|
static int |
GROUND
It specifies the constant for GROUND event.
|
static int |
IntervalDomainID
Unique identifier for an interval domain type.
|
static int |
MaxInt
It specifies the maximum element in the domain.
|
static int |
MinInt
It specifies the minimum element in the domain.
|
static int |
SmallDenseDomainID
Unique identifier for a small dense domain type.
|
failException, modelConstraints, modelConstraintsToEvaluate, NOINFO, NONE, searchConstraints, searchConstraintsCloned, searchConstraintsToEvaluate, stamp
Constructor and Description |
---|
IntDomain() |
Modifier and Type | Method and Description |
---|---|
void |
addDom(IntDomain domain)
It adds values as specified by the parameter to the domain.
|
abstract IntDomain |
cloneLight()
It clones the domain object, only data responsible for encoding domain
values is cloned.
|
abstract 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.
|
abstract boolean |
contains(int min,
int max)
It checks if an interval min..max belongs to the domain.
|
static IntervalDomain |
divBounds(int a,
int b,
int c,
int d) |
static IntervalDomain |
divIntBounds(int a,
int b,
int c,
int d) |
int |
elementsSmallerThan(int el)
It returns the number of elements smaller than el.
|
boolean |
eq(IntDomain domain)
It specifies if the other int domain is equal to this one.
|
abstract int |
getElementAt(int index)
It access the element at the specified position.
|
int[] |
getEventsInclusion(int pruningEvent)
It helps to specify what events should be executed if a given event occurs.
|
abstract Interval |
getInterval(int position)
It returns required interval.
|
int |
getRandomValue()
It returns a random value from the domain.
|
abstract int |
getSize()
It returns the size of the domain.
|
void |
in(int level,
Var var,
Domain domain)
It enforces that this domain is included within the specified domain.
|
void |
in(int storeLevel,
Var var,
IntDomain domain)
It updates the domain to have values only within the domain.
|
abstract 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.
|
abstract 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.
|
abstract 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.
|
abstract IntDomain |
intersect(IntDomain dom)
It intersects current domain with the one given as a parameter.
|
abstract IntDomain |
intersect(int min,
int max)
In intersects current domain with the interval min..max.
|
abstract int |
intersectAdapt(IntDomain intersect)
It computes an intersection with a given domain and stores it in this domain.
|
abstract int |
intersectAdapt(int min,
int max)
It computes an intersection of this domain with an interval [min..max].
|
abstract IntervalEnumeration |
intervalEnumeration()
It returns interval enumeration of the domain values.
|
void |
inValue(int level,
IntVar var,
int value)
It reduces domain to a single value.
|
boolean |
isIntersecting(IntDomain domain)
Checks if two domains intersect.
|
abstract boolean |
isIntersecting(int min,
int max)
It checks if interval min..max intersects with current domain.
|
int |
leftElement(int intervalNo)
It returns the left most element of the given interval.
|
int |
lex(IntDomain domain)
Returns the lexical ordering between the sets
|
abstract int |
max()
It returns the maximum value in a domain.
|
abstract int |
min()
It returns the minimum value in a domain.
|
static IntervalDomain |
mulBounds(int a,
int b,
int c,
int d) |
static int |
multiply(int a,
int b) |
abstract int |
nextValue(int value)
It gives next value in the domain from the given one (lexigraphical
ordering).
|
int |
noConstraints()
It returns the number of constraints
|
abstract int |
noIntervals()
It returns number of intervals required to represent this domain.
|
abstract IntDomain |
previousDomain()
It returns domain at earlier level at which the change has occurred.
|
abstract int |
previousValue(int value)
It gives previous value in the domain from the given one (lexigraphical
ordering).
|
abstract IntDomain |
recentDomainPruning(int currentStoreLevel)
It returns the values which have been removed at current store level.
|
int |
rightElement(int intervalNo)
It returns the right most element of the given interval.
|
abstract void |
setDomain(IntDomain domain)
It sets the domain to the specified domain.
|
abstract void |
setDomain(int min,
int max)
It sets this domain to contain exactly all values between min and max.
|
boolean |
singleton(Domain value)
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 |
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.
|
abstract IntDomain |
subtract(int min,
int max)
It subtracts interval min..max.
|
abstract void |
subtractAdapt(int value)
It removes value from the domain.
|
abstract void |
subtractAdapt(int min,
int max)
It removes all values between min and max to the domain.
|
int[] |
toIntArray()
It constructs and int array containing all elements in 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.
|
int |
unionAdapt(IntDomain union)
It computes a union between this domain and the domain provided as a parameter.
|
void |
unionAdapt(Interval i)
It adds interval of values to the domain.
|
abstract void |
unionAdapt(int min,
int max)
It adds all values between min and max to the domain.
|
int |
value()
It returns the value to which this domain is grounded.
|
abstract ValueEnumeration |
valueEnumeration()
It returns value enumeration of the domain values.
|
checkInvariants, clear, clone, constraints, domainID, isEmpty, isNumeric, isSparseRepresentation, noSearchConstraints, putModelConstraint, putSearchConstraint, removeLevel, removeModelConstraint, removeSearchConstraint, searchConstraints, setStamp, singleton, sizeConstraints, sizeConstraintsOriginal, stamp, toString, toStringConstraints, toStringFull
public static final int MinInt
public static final int MaxInt
public static final int GROUND
public static final int BOUND
public static final int ANY
public static final int[][] eventsInclusion
public static final int IntervalDomainID
public static final int BoundDomainID
public static final int SmallDenseDomainID
public static final IntDomain emptyIntDomain
public int[] getEventsInclusion(int pruningEvent)
getEventsInclusion
in class Domain
pruningEvent
- the pruning event for which we want to know what events it encompasses.public void unionAdapt(Interval i)
i
- Interval which needs to be added to the domain.public void addDom(IntDomain domain)
domain
- Domain which needs to be added to the domain.public abstract void unionAdapt(int min, int max)
min
- the left bound of the interval being added.max
- the right bound of the interval being added.public void unionAdapt(int value)
value
- value being added to the domain.public boolean isIntersecting(IntDomain domain)
domain
- the domain for which intersection is checked.public abstract boolean isIntersecting(int min, int max)
min
- the left bound of the interval.max
- the right bound of the interval.public boolean contains(IntDomain domain)
domain
- for which we check if it is contained in the current domain.public abstract boolean contains(int min, int max)
min
- the minimum value of the interval being checkedmax
- the maximum value of the interval being checkedpublic abstract IntDomain complement()
public boolean contains(int value)
value
- which is checked if it exists in the domain.public abstract int nextValue(int value)
value
- it specifies the value after which a next value has to be found.public abstract int previousValue(int value)
value
- before which a value is seeked for.public abstract ValueEnumeration valueEnumeration()
valueEnumeration
in class Domain
public abstract IntervalEnumeration intervalEnumeration()
public abstract int getSize()
public abstract IntDomain intersect(IntDomain dom)
dom
- domain with which the intersection needs to be computed.public abstract IntDomain intersect(int min, int max)
min
- the left bound of the interval (inclusive)max
- the right bound of the interval (inclusive)public IntDomain subtract(int value)
value
- the value for which the complement is computedpublic abstract void subtractAdapt(int value)
value
- the value for which the complement is computedpublic abstract void subtractAdapt(int min, int max)
min
- the left bound of the interval being removed.max
- the right bound of the interval being removed.public abstract int max()
public abstract int min()
public abstract void setDomain(IntDomain domain)
domain
- the domain from which this domain takes all elements.public abstract void setDomain(int min, int max)
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public boolean singleton(int c)
c
- the value to which the only element should be equal to.public IntDomain subtract(IntDomain domain)
domain
- the domain which is subtracted from this domain.public abstract IntDomain subtract(int min, int max)
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public IntDomain union(IntDomain domain)
domain
- the domain for which the union is computed.public IntDomain union(int min, int max)
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public IntDomain union(int value)
value
- it specifies the value which is being added.public void inMin(int storeLevel, Var var, int min)
storeLevel
- 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 inMax(int storeLevel, Var var, int max)
storeLevel
- 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 abstract void in(int storeLevel, Var var, int min, int max)
storeLevel
- 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 inValue(int level, IntVar var, int value)
level
- level of the store at which the update occurs.var
- variable for which this domain is used.value
- the value according to which the domain is updated.public void in(int storeLevel, Var var, IntDomain 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 void inComplement(int storeLevel, Var var, int complement)
storeLevel
- 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 abstract void inComplement(int storeLevel, Var var, int min, int max)
storeLevel
- 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 abstract int noIntervals()
public abstract Interval getInterval(int position)
position
- the position of the interval.public abstract void inShift(int storeLevel, Var var, IntDomain domain, int shift)
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.shift
- the shift which is used to shift the domain supplied as argument.public int leftElement(int intervalNo)
intervalNo
- the interval number.public int rightElement(int intervalNo)
intervalNo
- the interval number.public abstract IntDomain recentDomainPruning(int currentStoreLevel)
currentStoreLevel
- the current store level.public abstract IntDomain previousDomain()
public boolean eq(IntDomain domain)
domain
- the domain which is compared to this domain.public void in(int level, Var var, Domain domain)
Domain
public boolean singleton(Domain value)
Domain
public int noConstraints()
noConstraints
in class Domain
public abstract IntDomain cloneLight()
Domain
cloneLight
in class Domain
public int lex(IntDomain domain)
domain
- the set that should be lexically compared to this setpublic int elementsSmallerThan(int el)
el
- the element from which counted elements must be smaller than.public abstract int intersectAdapt(IntDomain intersect)
intersect
- domain with which the intersection is being computed.public int unionAdapt(IntDomain union)
union
- the domain with is used for the union operation with this domain.public abstract int intersectAdapt(int min, int max)
min
- the minimum value of the interval used in the intersection computation.max
- the maximum value of the interval used in the intersection computation.public int sizeOfIntersection(IntDomain domain)
domain
- the domain with which the intersection is computed.public abstract int getElementAt(int index)
index
- the position of the element, indexing starts from 0.public int[] toIntArray()
public int value()
public int getRandomValue()
public static final IntervalDomain mulBounds(int a, int b, int c, int d)
public static final IntervalDomain divBounds(int a, int b, int c, int d)
public static final IntervalDomain divIntBounds(int a, int b, int c, int d)
public static final int multiply(int a, int b)
Copyright © 2015. All rights reserved.