public class ExtensionalSupportSTR extends Constraint
Modifier and Type | Field and Description |
---|---|
boolean |
backtrackOccured
It specifies if there was a backtrack and no yet consistency function execution after backtracking.
|
int |
first
Gives the position of the first tuple (in the current list)
or -1 if the current list is empty.
|
boolean |
firstConsistencyCheck
It specifies if there was no first consistency check yet.
|
int |
firstResidue
It stores the position of the first residue.
|
TimeStamp<Integer> |
headsOfEliminatedTuples
Gives the first position of the eliminated tuple at a given level.
|
int |
last
Gives the position of the last tuple (in the current list)
or -1 if the current list is empty.
|
int |
lastAssignedVariablePosition |
int |
lastResidue
It stores the position of the last residue.
|
IntVar[] |
list
It stores variables within this extensional constraint, order does
matter.
|
int |
nbGlobalValuesToBeSupported
The number of variable-value pairs which need to have support.
|
int |
nbSupportsVariables
It specifies the current number of variables for which it is required to check
if their values from the domains are supported.
|
int |
nbValidityVariables
It specifies the number of variables for which validity check within a tuple must be performed.
|
int[] |
nbValuesToBeSupported
The number of variable-value pairs which need to have support per variable.
|
int[] |
nexts
Gives the position of the next tuple wrt the position given in index, or -1.
|
boolean |
reinsertBefore
It specifies if the tuples previously removed are re-inserted at the beginning.
|
boolean |
residuesBefore
It specifies if the residues are moved at the beginning of the list.
|
int[] |
supportsVariablePositions
The positions of the variables for which GAC must be checked.
|
TimeStamp<Integer> |
tailsOfEliminatedTuples
Gives the last position of the eliminated tuple at a given level.
|
int[][] |
tuples |
int[] |
validityVariablePositions
The positions of the variables for which validity of any tuple must be checked.
|
HashMap<Var,Integer> |
varToIndex
It specifies the mapping of the variable into its index.
|
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 |
---|
ExtensionalSupportSTR(IntVar[] list,
boolean reinsertBefore,
boolean residuesBefore)
Partial constructor which stores variables involved in a constraint but
does not get information about tuples yet.
|
ExtensionalSupportSTR(IntVar[] variables,
int[][] tuples)
It creates an extensional constraint.
|
ExtensionalSupportSTR(IntVar[] list,
int[][] tuples,
boolean reinsertBefore,
boolean residuesBefore)
It constructs an extensional constraint.
|
Modifier and Type | Method and Description |
---|---|
ArrayList<Var> |
arguments()
It returns the variables in a scope of the constraint.
|
void |
consistency(Store store)
It is a (most probably incomplete) consistency function which removes the
values from variables domains.
|
static void |
fromXML(ExtensionalSupportSTR object,
String content)
It updates the specified constraint with the information
stored in the string.
|
int |
getConsistencyPruningEvent(Var var)
It retrieves the pruning event which causes reevaluation of the
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 |
queueVariable(int level,
Var V)
This is a function called to indicate which variable in a scope of
constraint has changed.
|
void |
remove(int previous,
int current)
It removes the tuple which is no longer valid.
|
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.
|
boolean |
satisfied()
It checks if the constraint is satisfied.
|
void |
storeResidue(int previous,
int current)
It moves the residue to the beginning of the list.
|
String |
toString()
It produces a string representation of a constraint state.
|
void |
toXML(TransformerHandler tf)
It writes the content of this object as the content of XML
element so later it can be used to restore the object from
XML.
|
cleanAfterFailure, decompose, getGuideConstraint, getGuideValue, getGuideVariable, id, impose, imposeDecomposition, numberArgs, removeLevelLate, requiresMonotonicity, setConsistencyPruningEvent, supplyGuideFeedback
auxiliaryVariables, derivative, imposeDecomposition
public IntVar[] list
public int[][] tuples
public int first
public int last
public int[] nexts
public TimeStamp<Integer> headsOfEliminatedTuples
public TimeStamp<Integer> tailsOfEliminatedTuples
public int nbGlobalValuesToBeSupported
public int[] nbValuesToBeSupported
public int firstResidue
public int lastResidue
public int nbValidityVariables
public int[] validityVariablePositions
public int nbSupportsVariables
public int[] supportsVariablePositions
public HashMap<Var,Integer> varToIndex
public int lastAssignedVariablePosition
public static String[] xmlAttributes
public boolean reinsertBefore
public boolean residuesBefore
public boolean firstConsistencyCheck
public boolean backtrackOccured
public ExtensionalSupportSTR(IntVar[] list, boolean reinsertBefore, boolean residuesBefore)
list
- the variables in the scope of the constraint.reinsertBefore
- it specifies if the tuples which were removed and are reinstatiated are inserted at the beginning.residuesBefore
- it specifies if the residue tuples are moved to the beginning.public ExtensionalSupportSTR(IntVar[] list, int[][] tuples, boolean reinsertBefore, boolean residuesBefore)
list
- the variables in the scope of the constraint.tuples
- the tuples which are supports.reinsertBefore
- it specifies if the tuples which were removed and are reinstatiated are inserted at the beginning.residuesBefore
- it specifies if the residue tuples are moved to the beginning.public ExtensionalSupportSTR(IntVar[] variables, int[][] tuples)
variables
- the variables in the scope of the constraint.tuples
- the support tuples.public void remove(int previous, int current)
previous
- the tuple pointing at removed tuple.current
- the removed tuple.public void storeResidue(int previous, int current)
previous
- the tuple pointing at tuple residue.current
- the residue tuple.public ArrayList<Var> arguments()
Constraint
arguments
in class Constraint
public void removeLevel(int level)
Constraint
removeLevel
in class Constraint
level
- the level which is being removed.public void consistency(Store store)
Constraint
consistency
in class Constraint
store
- constraint store within which the constraint consistency is being checked.public int getConsistencyPruningEvent(Var var)
Constraint
getConsistencyPruningEvent
in class Constraint
var
- variable for which pruning event is retrievedpublic 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 boolean satisfied()
Constraint
satisfied
in class Constraint
public String toString()
Constraint
toString
in class Constraint
public void toXML(TransformerHandler tf) throws SAXException
tf
- a place to write the content of the object.SAXException
public static void fromXML(ExtensionalSupportSTR object, String content)
object
- the constraint to be updated.content
- the information used for update.Copyright © 2015. All rights reserved.