public class Geost extends Constraint
Modifier and Type | Class and Description |
---|---|
static class |
Geost.SweepDirection |
Modifier and Type | Field and Description |
---|---|
boolean |
alwaysUseFrames
It defines whether outbox generation should always rely on overlapping frames.
|
boolean |
backtracking
It is a flag set to true during remove level late function execution so objects which
are being updated upon backtracking can be handled properly.
|
boolean |
enforceNoSkip
if set to true, a variable will never be skipped, even if grounded and not in queue
|
ExternalConstraint[] |
externalConstraints
It stores the reference to the collection of external constraints
which must be satisfied within this constraint.
|
boolean |
filterUseless
It specifies that filtering of useless internal constraint takes place
before an object is being pruned.
|
java.util.Collection<InternalConstraint> |
internalConstraints
It stores all generated internal constraints for all objects/constraints.
|
GeostObject[] |
objects
It stores the reference to the collection of objects provided to
the constructor.
|
LexicographicalOrder |
order
It specifies the order between dimensions which is used by the
pruning algorithm.
|
boolean |
partialShapeSweep
set to false to disable relaxed shape pruning
|
Shape[] |
shapeRegister
It stores information about shapes used by objects within this geost constraint.
|
static java.lang.String[] |
xmlAttributes
It specifies the arguments required to be saved by an XML format as well as
the constructor being called to recreate an object from an XML format.
|
atomicExecution, consistencyPruningEvents, earlyTerminationOK, id, increaseWeight, numberArgs, numberId
queueIndex
Constructor and Description |
---|
Geost(java.util.Collection<GeostObject> objects,
java.util.Collection<ExternalConstraint> constraints,
java.util.Collection<Shape> shapes) |
Geost(GeostObject[] objects,
ExternalConstraint[] constraints,
Shape[] shapes)
It creates a geost constraint from provided objects, external constraints,
as well as shapes.
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<Var> |
arguments()
It returns the variables in a scope of the constraint.
|
java.lang.String |
checkInvariants()
It checks that this constraint has consistent data structures.
|
void |
consistency(Store store)
It is a (most probably incomplete) consistency function which removes the
values from variables domains.
|
int |
getConsistencyPruningEvent(Var var)
It retrieves the pruning event which causes reevaluation of the
constraint.
|
Shape |
getShape(int id)
It returns the shape with a given id if such exists.
|
java.util.List<java.lang.Long> |
getStatistics()
It returns all the statistics gathered by geost constraint during the search.
|
java.lang.String |
id()
It gives the id string of a constraint.
|
void |
impose(Store store)
It imposes the constraint in a given store.
|
void |
increaseWeight()
It increases the weight of the variables in the constraint scope.
|
void |
queueObject(GeostObject o)
It puts the object into the queue if it can be still pruned or cause failure.
|
void |
queueVariable(int level,
Var v)
This is a function called to indicate which variable in a scope of
constraint has changed.
|
void |
removeConstraint()
It removes the constraint by removing this constraint from all variables.
|
void |
removeLevel(int level)
This function is called in case of the backtrack, so a constraint can
clear the queue of changed variables which is no longer valid.
|
void |
removeLevelLate(int level)
This function is called in case of the backtrack.
|
boolean |
satisfied()
Geost is satisfied if all of its external constraints are satisfied.
|
java.lang.String |
toString()
It produces a string representation of a constraint state.
|
cleanAfterFailure, decompose, getGuideConstraint, getGuideValue, getGuideVariable, impose, imposeDecomposition, numberArgs, requiresMonotonicity, setConsistencyPruningEvent, supplyGuideFeedback
auxiliaryVariables, imposeDecomposition
public boolean enforceNoSkip
public boolean partialShapeSweep
public java.util.Collection<InternalConstraint> internalConstraints
public final LexicographicalOrder order
public final boolean filterUseless
public boolean alwaysUseFrames
public boolean backtracking
public final GeostObject[] objects
public final ExternalConstraint[] externalConstraints
public final Shape[] shapeRegister
public static java.lang.String[] xmlAttributes
public Geost(java.util.Collection<GeostObject> objects, java.util.Collection<ExternalConstraint> constraints, java.util.Collection<Shape> shapes)
public Geost(GeostObject[] objects, ExternalConstraint[] constraints, Shape[] shapes)
objects
- objects in the scope of the geost constraint.constraints
- the collection of external constraints enforced by geost.shapes
- the list of different shapes used by the objects in scope of the geost.public java.lang.String checkInvariants()
public final Shape getShape(int id)
id
- the unique id of the shape we are looking for.public java.util.ArrayList<Var> arguments()
Constraint
arguments
in class Constraint
public void consistency(Store store)
Constraint
consistency
in class Constraint
store
- constraint store within which the constraint consistency is being checked.public final void queueObject(GeostObject o)
o
- the object which is possibly put into the queue.public int getConsistencyPruningEvent(Var var)
Constraint
getConsistencyPruningEvent
in class Constraint
var
- variable for which pruning event is retrievedpublic java.lang.String id()
Constraint
id
in class Constraint
public void impose(Store store)
Constraint
impose
in class Constraint
store
- the constraint store to which the constraint is imposed to.public void increaseWeight()
Constraint
increaseWeight
in class Constraint
public void queueVariable(int level, Var v)
Constraint
queueVariable
in class Constraint
level
- the level of the store at which the change has occurred.v
- variable which has changed.public void removeConstraint()
Constraint
removeConstraint
in class Constraint
public void removeLevel(int level)
Constraint
removeLevel
in class Constraint
level
- the level which is being removed.public void removeLevelLate(int level)
Constraint
removeLevelLate
in class Constraint
level
- the level which is being removed.public boolean satisfied()
satisfied
in class Constraint
public java.lang.String toString()
Constraint
toString
in class Constraint
public java.util.List<java.lang.Long> getStatistics()