|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.constraints.DecomposedConstraint
JaCoP.constraints.Constraint
JaCoP.constraints.regular.Regular
public class Regular
Regular constraint accepts only the assignment to variables which is accepted by an automaton. This constraint implements a polynomial algorithm to establish GAC. There are number of improvements (iterative execution, optimization of computational load upon backtracking) to improve the constraint further.
| Field Summary | |
|---|---|
static boolean |
debugAll
It specifies if debugging information should be printed out. |
java.util.HashMap<java.lang.Integer,java.lang.String> |
dNames
dNames contain a "name" for each value from the union of all variabl's domains. |
FSM |
fsm
It specifies finite state machine used by this regular. |
java.lang.String |
latexFile
Name of the file to store the latex output after consistency call The output will be : file_name + "call number" + ".tex" |
IntVar[] |
list
Array of the variables of the graph levels |
boolean |
listRepresentation
It specifies if the edges should have a list of values associated with them. |
boolean |
oneSupport
It specifies if the support functionality should be used. |
boolean |
optimizedMDD
It specifies if the translation of FSM into optimized MDD should take place so minimal layered graph can be obtained. |
static boolean |
saveAllToLatex
It specifies if constraint description should be saved to latex for later viewing. |
java.util.HashMap<java.lang.Integer,RegEdge>[] |
supports
It keeps for each variable value pair a current support. |
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. |
| Fields inherited from class JaCoP.constraints.Constraint |
|---|
atomicExecution, consistencyPruningEvents, earlyTerminationOK, id, increaseWeight, numberArgs, numberId |
| Fields inherited from class JaCoP.constraints.DecomposedConstraint |
|---|
queueIndex |
| Constructor Summary | |
|---|---|
Regular(FSM fsm,
IntVar[] list)
Constructor need Store to initialize the time-stamps |
|
| Method Summary | |
|---|---|
java.util.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. |
java.util.ArrayList<Constraint> |
decompose(Store store)
It returns an array list of constraint which are used to decompose this constraint. |
void |
disableState(int level,
int pos)
It marks state as being not active. |
int |
getConsistencyPruningEvent(Var var)
It retrieves the pruning event which causes reevaluation of the constraint. |
RegState |
getState(int level,
int id)
Find the state with the corresponding id. |
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 |
imposeDecomposition(Store store)
It imposes the decomposition of the given constraint in a given store. |
void |
increaseWeight()
It increases the weight of the variables in the constraint scope. |
void |
pruneArc(int varIndex)
Collects the damaged states, after pruning the domain of variable "var", and put these states in two separated sets. |
void |
queueVariable(int level,
Var var)
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)
Sweep the graph upon backtracking. |
boolean |
satisfied()
It checks if the constraint is satisfied. |
void |
saveLatexToFile(java.lang.String desc)
It saves the constraint latex description into file. |
void |
setLatexBaseFileName(java.lang.String filename)
It sets the filename for the file which is used to save latex descriptions. |
java.lang.String |
toLatex(java.lang.String addDescription)
It creates a latex description of the constraint state. |
java.lang.String |
toString()
It produces a string representation of a constraint state. |
int |
unreachBackwardLoop(int sucPrevLimit,
int level)
It does backward check to remove inactive edges and states. |
void |
unreachForwardLoop(int end,
int level)
Forward part deletes the outgoing edges of the damaged state and watch whether the successors are still active (in-degree > 0 ), otherwise we collect it and continue the loop. |
void |
uppendToLatexFile(java.lang.String desc,
java.lang.String fileName)
It appends latex description of the constraint current state to the specified filename. |
| Methods inherited from class JaCoP.constraints.Constraint |
|---|
cleanAfterFailure, getGuideConstraint, getGuideValue, getGuideVariable, impose, numberArgs, requiresMonotonicity, setConsistencyPruningEvent, supplyGuideFeedback |
| Methods inherited from class JaCoP.constraints.DecomposedConstraint |
|---|
auxiliaryVariables, imposeDecomposition |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean debugAll
public static final boolean saveAllToLatex
public final boolean optimizedMDD
public java.lang.String latexFile
public java.util.HashMap<java.lang.Integer,java.lang.String> dNames
public java.util.HashMap<java.lang.Integer,RegEdge>[] supports
public boolean listRepresentation
public boolean oneSupport
public FSM fsm
public IntVar[] list
public static java.lang.String[] xmlAttributes
| Constructor Detail |
|---|
public Regular(FSM fsm,
IntVar[] list)
fsm - (deterministic) finite automatonlist - variables which values have to be accepted by the automaton.| Method Detail |
|---|
public RegState getState(int level,
int id)
level - specifies the variable for which the state is seeked for.id - specifies the id of the state.
public void pruneArc(int varIndex)
varIndex - the index of the variable which have changed.
public int unreachBackwardLoop(int sucPrevLimit,
int level)
sucPrevLimit - previous number of states at a given level.level - level for which the backward sweep is computed.
public void unreachForwardLoop(int end,
int level)
end - the position of the last active state at a given level.level - level being examined.
public void disableState(int level,
int pos)
level - level at which the state is residing.pos - position of the state in the array of states.public java.util.ArrayList<Var> arguments()
Constraint
arguments in class Constraintpublic void removeLevel(int level)
Constraint
removeLevel in class Constraintlevel - the level which is being removed.public void removeLevelLate(int level)
removeLevelLate in class Constraintlevel - the level which is being removed.
public void queueVariable(int level,
Var var)
Constraint
queueVariable in class Constraintlevel - the level of the store at which the change has occurred.var - variable which has changed.public void consistency(Store store)
Constraint
consistency in class Constraintstore - constraint store within which the constraint consistency is being checked.public void impose(Store store)
Constraint
impose in class Constraintstore - the constraint store to which the constraint is imposed to.public boolean satisfied()
Constraint
satisfied in class Constraintpublic int getConsistencyPruningEvent(Var var)
Constraint
getConsistencyPruningEvent in class Constraintvar - variable for which pruning event is retrieved
public java.lang.String id()
Constraint
id in class Constraintpublic void removeConstraint()
Constraint
removeConstraint in class Constraintpublic java.lang.String toString()
Constraint
toString in class Constraintpublic void imposeDecomposition(Store store)
Constraint
imposeDecomposition in class Constraintstore - the constraint store to which the constraint is imposed to.public java.util.ArrayList<Constraint> decompose(Store store)
Constraint
decompose in class Constraintstore - the constraint store in which context the decomposition takes place.
public java.lang.String toLatex(java.lang.String addDescription)
addDescription - added description.
public void saveLatexToFile(java.lang.String desc)
desc - public void setLatexBaseFileName(java.lang.String filename)
filename -
public void uppendToLatexFile(java.lang.String desc,
java.lang.String fileName)
desc - appended description.fileName - filename where the description is appended.public void increaseWeight()
Constraint
increaseWeight in class Constraint
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||