public class FloatIntervalDomain extends FloatDomain implements Cloneable
Modifier and Type | Field and Description |
---|---|
static FloatIntervalDomain |
emptyDomain
An empty domain, so no constant creation of empty domains is required.
|
FloatInterval[] |
intervals
The values of the domain are encoded as a list of intervals.
|
int |
size
It specifies number of intervals needed to encode the domain.
|
ANY, BOUND, E, emptyFloatDomain, FloatIntervalDomainID, GROUND, IntervalDomainID, MaxFloat, MinFloat, minimizationStep, PI, previousDomain
failException, modelConstraints, modelConstraintsToEvaluate, NOINFO, NONE, searchConstraints, searchConstraintsCloned, searchConstraintsToEvaluate, stamp
Constructor and Description |
---|
FloatIntervalDomain()
Empty constructor, does not initialize anything.
|
FloatIntervalDomain(double min,
double max)
It creates domain with all values between min and max.
|
FloatIntervalDomain(int size)
It creates an empty domain, with at least specified number of places in
an array list for intervals.
|
Modifier and Type | Method and Description |
---|---|
void |
addDom(FloatDomain domain)
It adds values as specified by the parameter to the domain.
|
void |
addLastElement(double i)
It adds a value to the domain.
|
String |
checkInvariants()
It is a function to check if the object is in consistent state.
|
void |
clear()
It removes all elements.
|
FloatIntervalDomain |
clone()
It clones the domain object.
|
FloatIntervalDomain |
cloneLight()
It clones the domain object, only data responsible for encoding domain
values is cloned.
|
FloatDomain |
complement()
It creates a complement of a domain.
|
boolean |
contains(double value) |
boolean |
contains(double min,
double max)
It checks if an interval min..max belongs to the domain.
|
boolean |
contains(FloatDomain domain)
It specifies if the current domain contains the domain given as a
parameter.
|
boolean |
contains(int value)
It checks if value belongs to the domain.
|
int |
domainID()
It returns an unique identifier of the domain.
|
boolean |
eq(FloatDomain domain)
It checks if the domain is equal to the supplied domain.
|
FloatIntervalEnumeration |
floatIntervalEnumeration()
It returns interval enumeration of the domain values.
|
FloatInterval |
getInterval(int position)
It returns required interval.
|
int |
getSize()
It returns the size of the domain.
|
double |
getSizeFloat() |
void |
in(int storeLevel,
Var var,
double min,
double max)
It updates the domain to have values only within the interval min..max.
|
void |
in(int storeLevel,
Var var,
FloatDomain domain)
It updates the domain to have values only within the domain.
|
void |
inComplement(int storeLevel,
Var var,
double complement)
It updates the domain to not contain the value complement.
|
void |
inComplement(int storeLevel,
Var var,
double min,
double max)
It updates the domain so it does not contain the supplied interval.
|
void |
inMax(int storeLevel,
Var var,
double max)
It updates the domain according to the maximum value and stamp value.
|
void |
inMin(int storeLevel,
Var var,
double min)
It updates the domain according to the minimum value and stamp value.
|
void |
inShift(int storeLevel,
Var var,
FloatDomain domain,
double shift)
It updates the domain to contain the elements as specifed by the domain,
which is shifted.
|
FloatDomain |
intersect(double min,
double max)
In intersects current domain with the domain min..max.
|
FloatDomain |
intersect(FloatDomain domain)
It interesects current domain with the one given as a parameter.
|
int |
intersectAdapt(FloatDomain domain)
It computes an intersection with a given domain and stores it in this domain.
|
int |
intersectAdapt(int min,
int max)
It computes an intersection of this domain with an interval [min..max].
|
IntervalEnumeration |
intervalEnumeration()
It returns interval enumeration of the domain values.
|
int |
intervalNo(double value)
It specifies the position of the interval which contains specified value.
|
boolean |
isEmpty()
It returns true if given domain is empty.
|
boolean |
isIntersecting(double min,
double max)
It checks if interval min..max intersects with current domain.
|
boolean |
isIntersecting(FloatDomain domain)
Checks if two domains intersect.
|
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.
|
double |
leftElement(int intervalNo)
It returns the left most element of the given interval.
|
double |
max()
It returns the maximum value in a domain.
|
double |
min()
It returns the minimum value in a domain.
|
double |
nextValue(double value) |
int |
noIntervals()
It returns the number intervals into which this domain is split.
|
FloatDomain |
previousDomain()
It returns domain at earlier level at which the change has occurred.
|
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.
|
FloatDomain |
recentDomainPruning(int storeLevel)
It removes a constraint from a domain, it should only be called by
removeConstraint function of Variable object.
|
void |
removeInterval(int position)
It removes the counter-th interval from the domain.
|
void |
removeLevel(int level,
Var var)
It removes a level of a domain.
|
void |
removeSearchConstraint(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.
|
double |
rightElement(int intervalNo)
It returns the left most element of the given interval.
|
void |
setDomain(double min,
double max)
It sets the domain to all values between min and max.
|
void |
setDomain(FloatDomain domain)
It sets the domain to the specified domain.
|
boolean |
singleton()
It returns true if given domain has only one element.
|
boolean |
singleton(double 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(FloatDomain domain)
It computes the size of the intersection between this domain and the domain
supplied as a parameter.
|
FloatDomain |
subtract(double value)
It intersects with the domain which is a complement of value.
|
FloatIntervalDomain |
subtract(double min,
double max)
It subtracts min..max from current domain and returns the result.
|
FloatDomain |
subtract(FloatDomain domain)
It subtracts domain from current domain and returns the result.
|
void |
subtractAdapt(double value)
It removes value from the domain.
|
void |
subtractAdapt(double minValue,
double maxValue)
It removes all values between min and max to the domain.
|
String |
toString()
It returns string description of the domain (only values in the domain).
|
String |
toStringConstraints()
It returns string description of the constraints attached to the domain.
|
String |
toStringFull()
It returns complete string description containing all relevant
information.
|
FloatDomain |
union(double value)
It computes union of dom1 and value and returns the result.
|
FloatDomain |
union(double min,
double max)
It computes union of current domain and an interval min..max;
|
FloatDomain |
union(FloatDomain domain)
It computes union of dom1 from dom2 and returns the result.
|
void |
unionAdapt(double value)
It adds a values to the domain.
|
void |
unionAdapt(double min,
double max)
It adds all values between min and max to the domain.
|
int |
unionAdapt(FloatDomain union)
It computes a union between this domain and the domain provided as a parameter.
|
void |
unionAdapt(FloatInterval i)
It adds interval of values to the domain.
|
ValueEnumeration |
valueEnumeration()
It returns value enumeration of the domain values.
|
addBounds, divBounds, down, epsilon, format, getEventsInclusion, in, intervalPrint, inValue, lex, maxULP, minULP, mulBounds, next, noConstraints, precision, previous, previousForMinimization, putModelConstraint, removeModelConstraint, setFormat, setOutward, setPrecision, setStep, singleton, subBounds, toIntArray, ulp, up, value
constraints, noSearchConstraints, searchConstraints, setStamp, sizeConstraints, stamp
public FloatInterval[] intervals
public int size
public static final FloatIntervalDomain emptyDomain
public FloatIntervalDomain()
public FloatIntervalDomain(int size)
size
- defines the initial size of an array storing the intervals.public FloatIntervalDomain(double min, double max)
min
- defines the left bound of a domain.max
- defines the right bound of a domain.public int domainID()
public FloatDomain previousDomain()
FloatDomain
previousDomain
in class FloatDomain
public void unionAdapt(FloatInterval i)
unionAdapt
in class FloatDomain
i
- Interval which needs to be added to the domain.public void addLastElement(double i)
i
- value to be addedpublic void addDom(FloatDomain domain)
addDom
in class FloatDomain
domain
- Domain which needs to be added to the domain.public void unionAdapt(double min, double max)
unionAdapt
in class FloatDomain
min
- the left bound of the interval being added.max
- the right bound of the interval being added.public boolean isIntersecting(FloatDomain domain)
isIntersecting
in class FloatDomain
domain
- the domain for which intersection is checked.public boolean isIntersecting(double min, double max)
FloatDomain
isIntersecting
in class FloatDomain
min
- the left bound of the interval.max
- the right bound of the interval.public FloatIntervalDomain cloneLight()
cloneLight
in class FloatDomain
public FloatIntervalDomain clone()
clone
in class FloatDomain
public boolean contains(FloatDomain domain)
contains
in class FloatDomain
domain
- for which we check if it is contained in the current domain.public FloatDomain complement()
complement
in class FloatDomain
public boolean contains(int value)
contains
in class FloatDomain
value
- which is checked if it exists in the domain.public boolean contains(double value)
contains
in class FloatDomain
public double nextValue(double value)
public ValueEnumeration valueEnumeration()
valueEnumeration
in class FloatDomain
public IntervalEnumeration intervalEnumeration()
intervalEnumeration
in class FloatDomain
public FloatIntervalEnumeration floatIntervalEnumeration()
floatIntervalEnumeration
in class FloatDomain
public boolean eq(FloatDomain domain)
eq
in class FloatDomain
domain
- the domain which is compared to this domain.public int getSize()
getSize
in class FloatDomain
public double getSizeFloat()
public FloatDomain intersect(FloatDomain domain)
intersect
in class FloatDomain
domain
- domain with which the intersection needs to be computed.public FloatDomain intersect(double min, double max)
intersect
in class FloatDomain
min
- the left bound of the interval (inclusive)max
- the right bound of the interval (inclusive)public FloatDomain subtract(double value)
FloatDomain
subtract
in class FloatDomain
value
- the value for which the complement is computedpublic boolean isEmpty()
public double max()
max
in class FloatDomain
public double min()
min
in class FloatDomain
public void removeInterval(int position)
position
- it specifies the position of the removed interval.public void setDomain(FloatDomain domain)
setDomain
in class FloatDomain
domain
- the domain from which this domain takes all elements.public void setDomain(double min, double max)
setDomain
in class FloatDomain
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public boolean singleton()
public boolean singleton(double c)
singleton
in class FloatDomain
c
- the value to which the only element should be equal to.public FloatDomain subtract(FloatDomain domain)
subtract
in class FloatDomain
domain
- the domain which is subtracted from this domain.public FloatIntervalDomain subtract(double min, double max)
subtract
in class FloatDomain
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public FloatDomain union(FloatDomain domain)
union
in class FloatDomain
domain
- the domain for which the union is computed.public FloatDomain union(double min, double max)
union
in class FloatDomain
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public FloatDomain union(double value)
union
in class FloatDomain
value
- it specifies the value which is being added.public String toString()
public String toStringConstraints()
toStringConstraints
in class Domain
public String toStringFull()
toStringFull
in class Domain
public void inMin(int storeLevel, Var var, double min)
inMin
in class FloatDomain
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, double max)
inMax
in class FloatDomain
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 void in(int storeLevel, Var var, double min, double max)
in
in class FloatDomain
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 in(int storeLevel, Var var, FloatDomain domain)
in
in class FloatDomain
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 int noIntervals()
noIntervals
in class FloatDomain
public int intervalNo(double value)
value
- value for which an interval containing it is searched.public FloatInterval getInterval(int position)
FloatDomain
getInterval
in class FloatDomain
position
- the position of the interval.public void inComplement(int storeLevel, Var var, double complement)
inComplement
in class FloatDomain
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 void inComplement(int storeLevel, Var var, double min, double max)
FloatDomain
inComplement
in class FloatDomain
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 void inShift(int storeLevel, Var var, FloatDomain domain, double shift)
inShift
in class FloatDomain
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 boolean isSparseRepresentation()
isSparseRepresentation
in class Domain
public boolean isNumeric()
public double leftElement(int intervalNo)
leftElement
in class FloatDomain
intervalNo
- the interval number.public double rightElement(int intervalNo)
rightElement
in class FloatDomain
intervalNo
- the interval number.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 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 void removeSearchConstraint(int storeLevel, Var var, Constraint C)
storeLevel
- the current level of the store.var
- the variable for which the constraint is being removed.C
- the constraint being removed.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 FloatDomain recentDomainPruning(int storeLevel)
recentDomainPruning
in class FloatDomain
storeLevel
- the current store level.public int sizeConstraintsOriginal()
sizeConstraintsOriginal
in class Domain
public String checkInvariants()
checkInvariants
in class Domain
public void unionAdapt(double value)
FloatDomain
unionAdapt
in class FloatDomain
value
- value being added to the domain.public void subtractAdapt(double value)
FloatDomain
subtractAdapt
in class FloatDomain
value
- the value for which the complement is computedpublic void subtractAdapt(double minValue, double maxValue)
FloatDomain
subtractAdapt
in class FloatDomain
minValue
- the left bound of the interval being removed.maxValue
- the right bound of the interval being removed.public int intersectAdapt(FloatDomain domain)
FloatDomain
intersectAdapt
in class FloatDomain
domain
- domain with which the intersection is being computed.public int unionAdapt(FloatDomain union)
FloatDomain
unionAdapt
in class FloatDomain
union
- the domain with is used for the union operation with this domain.public int intersectAdapt(int min, int max)
FloatDomain
intersectAdapt
in class FloatDomain
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(FloatDomain domain)
FloatDomain
sizeOfIntersection
in class FloatDomain
domain
- the domain with which the intersection is computed.public boolean contains(double min, double max)
FloatDomain
contains
in class FloatDomain
min
- the minimum value of the interval being checkedmax
- the maximum value of the interval being checkedCopyright © 2022. All rights reserved.