public abstract class Domain extends Object
Modifier and Type | Field and Description |
---|---|
static FailException |
failException
An exception used if failure encountered in functions in();
|
Constraint[][] |
modelConstraints
It specifies constraints which are attached to current domain, each array
has different pruning event.
|
int[] |
modelConstraintsToEvaluate
It specifies the first position of a constraint which is satisfied.
|
static int |
NOINFO
It specifies the constant responsible of conveying a message that
no information is provided by the domain when describing the change
which has occurred within the domain.
|
static int |
NONE
It specifies the constant for NONE event, if event is NONE then
the constraint is not attached to a variable.
|
List<Constraint> |
searchConstraints
It specifies constraints which are attached to current domain.
|
boolean |
searchConstraintsCloned
It specifies if the vector of constraints were cloned (if it was not
cloned then the same vector is reused across domains with different
stamps.
|
int |
searchConstraintsToEvaluate
It specifies the position of the last constraint which is still not yet
satisfied.
|
int |
stamp
It specifies the level of this domain, which specifies at which store
level it was created and used.
|
Constructor and Description |
---|
Domain() |
Modifier and Type | Method and Description |
---|---|
abstract String |
checkInvariants()
It checks if the domain has correct state.
|
abstract void |
clear()
It removes all elements.
|
abstract Domain |
clone()
It clones the domain object.
|
abstract Domain |
cloneLight()
It clones the domain object, only data responsible for encoding domain
values is cloned.
|
List<Constraint> |
constraints()
It returns all the constraints attached currently to the domain.
|
abstract int |
domainID()
It returns an unique identifier of the domain.
|
abstract int[] |
getEventsInclusion(int pruningEvent)
It specifies what events should be executed if a given event occurs.
|
abstract int |
getSize()
It returns the size of the domain.
|
abstract void |
in(int level,
Var var,
Domain domain)
It enforces that this domain is included within the specified domain.
|
abstract boolean |
isEmpty()
It returns true if given domain is empty.
|
abstract boolean |
isNumeric()
It specifies if domain is a finite domain of numeric values (integers).
|
abstract boolean |
isSparseRepresentation()
It specifies if the domain type is more suited to representing sparse
domain.
|
abstract int |
noConstraints()
It returns the number of constraints
|
int |
noSearchConstraints()
It returns number of search constraints.
|
abstract 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.
|
abstract 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.
|
abstract void |
removeLevel(int level,
Var var)
It removes the specified level.
|
abstract 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.
|
abstract 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.
|
List<Constraint> |
searchConstraints() |
void |
setStamp(int stamp)
It sets the stamp of the domain.
|
abstract boolean |
singleton()
It returns true if given domain has only one element.
|
abstract boolean |
singleton(Domain value)
It returns true if given domain has only one element.
|
int |
sizeConstraints()
It returns all constraints which are associated with variable, even the
ones which are already satisfied.
|
abstract int |
sizeConstraintsOriginal()
It returns all constraints which are associated with variable, even the
ones which are already satisfied.
|
int |
stamp()
It returns the stamp of the domain.
|
abstract String |
toString()
It returns string description of the domain (only values in the domain).
|
abstract String |
toStringConstraints()
It returns string description of the constraints attached to the domain.
|
abstract String |
toStringFull()
It returns complete string description containing all relevant
information about the domain.
|
abstract ValueEnumeration |
valueEnumeration()
It returns value enumeration of the domain values.
|
public static final int NOINFO
public static final int NONE
public static final FailException failException
public Constraint[][] modelConstraints
public int[] modelConstraintsToEvaluate
public List<Constraint> searchConstraints
public boolean searchConstraintsCloned
public int searchConstraintsToEvaluate
public int stamp
public abstract void clear()
public abstract Domain cloneLight()
public abstract ValueEnumeration valueEnumeration()
public abstract int getSize()
public abstract boolean isEmpty()
public abstract void removeModelConstraint(int storeLevel, Var var, Constraint c)
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 removeSearchConstraint(int storeLevel, Var var, int position, Constraint c)
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 List<Constraint> searchConstraints()
public void setStamp(int stamp)
stamp
- defines the time stamp of the domain.public abstract boolean singleton()
public abstract boolean singleton(Domain value)
value
- value represented as domain object to which the domain must be equal to.public abstract int noConstraints()
public int noSearchConstraints()
public int stamp()
public abstract String toString()
public abstract String toStringConstraints()
public abstract String toStringFull()
public abstract void removeLevel(int level, Var var)
level
- the level which is being removed.var
- the variable to which this domain belonged to.public abstract int domainID()
public abstract boolean isSparseRepresentation()
public abstract boolean isNumeric()
public abstract void putModelConstraint(int storeLevel, Var var, Constraint C, int pruningEvent)
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 abstract void putSearchConstraint(int storeLevel, Var var, Constraint C)
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 int sizeConstraints()
public abstract int sizeConstraintsOriginal()
public List<Constraint> constraints()
public abstract void in(int level, Var var, Domain domain)
level
- store level at which this inclusion is enforced.var
- variable which is informed of the change if any occurs.domain
- the domain which restricts this domain.public abstract String checkInvariants()
public abstract int[] getEventsInclusion(int pruningEvent)
pruningEvent
- the pruning event for which we want to know what events it encompasses.Copyright © 2022. All rights reserved.