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.
|
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.
|
protected Store |
store
It keeps a reference to the store.
|
static 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, trace
queueIndex
Constructor and Description |
---|
Geost(Collection<GeostObject> objects,
Collection<ExternalConstraint> constraints,
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 |
---|---|
ArrayList<Var> |
arguments()
It returns the variables in a scope of the constraint.
|
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.
|
protected DBox |
findForbiddenDomain(GeostObject o,
int currentShape,
int[] point,
Geost.SweepDirection dir,
LexicographicalOrder order) |
protected void |
flushQueue(Collection<Var> variables)
It does the processing needed given the set of variables that was updated
between two consecutive calls to the consistency function.
|
protected void |
genInternalConstraints() |
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.
|
List<Long> |
getStatistics()
It returns all the statistics gathered by geost constraint during the search.
|
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.
|
protected void |
onObjectUpdate(GeostObject o)
It performs the necessary operations for a given changed object.
|
protected int |
pruneMax(Store store,
GeostObject o,
int currentShape,
int d,
int limit)
the sweeping routine for minimal bounds.
|
protected int |
pruneMin(Store store,
GeostObject o,
int currentShape,
int d,
int limit)
the sweeping routine for minimal bounds.
|
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.
|
String |
toString()
It produces a string representation of a constraint state.
|
protected void |
updateInternalConstraintsGeneratingOutboxes(GeostObject o)
It is called whenever the object currently being pruned changes.
|
cleanAfterFailure, decompose, getGuideConstraint, getGuideValue, getGuideVariable, impose, imposeDecomposition, numberArgs, requiresMonotonicity, setConsistencyPruningEvent, supplyGuideFeedback
auxiliaryVariables, derivative, imposeDecomposition
public boolean enforceNoSkip
public boolean partialShapeSweep
public Collection<InternalConstraint> internalConstraints
public final LexicographicalOrder order
protected Store store
public final boolean filterUseless
public boolean alwaysUseFrames
public boolean backtracking
public final GeostObject[] objects
public final ExternalConstraint[] externalConstraints
public final Shape[] shapeRegister
public static String[] xmlAttributes
public Geost(Collection<GeostObject> objects, Collection<ExternalConstraint> constraints, 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 String checkInvariants()
public final Shape getShape(int id)
id
- the unique id of the shape we are looking for.protected void genInternalConstraints()
protected int pruneMin(Store store, GeostObject o, int currentShape, int d, int limit)
store
- the storeo
- the object to pruned
- the current most significant dimensionlimit
- stop pruning if going beyond this valueprotected int pruneMax(Store store, GeostObject o, int currentShape, int d, int limit)
store
- the storeo
- the object to pruned
- the current most significant dimensionlimit
- stop pruning if going beyond this valueprotected DBox findForbiddenDomain(GeostObject o, int currentShape, int[] point, Geost.SweepDirection dir, LexicographicalOrder order)
public 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.protected void updateInternalConstraintsGeneratingOutboxes(GeostObject o)
o
- the object currently being pruned for which internal constraints are being filtered.protected void flushQueue(Collection<Var> variables)
variables
- public final void queueObject(GeostObject o)
o
- the object which is possibly put into the queue.protected void onObjectUpdate(GeostObject o)
o
- the object which had a domain changepublic int getConsistencyPruningEvent(Var var)
Constraint
getConsistencyPruningEvent
in class Constraint
var
- variable for which pruning event is retrievedpublic 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 String toString()
Constraint
toString
in class Constraint
Copyright © 2015. All rights reserved.