public class TraceGenerator<T extends Var> extends Object implements SelectChoicePoint<T>, ConsistencyListener, ExitChildListener<T>, ExitListener
| Modifier and Type | Field and Description |
|---|---|
ArrayList<Var> |
tracedVar
It specifies the list of variables that are being traced.
|
String |
treeFilename
The file containing information about tree for CPviz format.
|
HashMap<Var,Integer> |
varIndex |
String |
visFilename
The file containing visualisation information.
|
| Constructor and Description |
|---|
TraceGenerator(Search<T> search,
SelectChoicePoint<T> select)
It creates a CPviz trace generator around proper select choice point object.
|
TraceGenerator(Search<T> search,
SelectChoicePoint<T> select,
String treeFilename,
String visFilename)
It creates a CPviz trace generator around proper select choice point object.
|
TraceGenerator(Search<T> search,
SelectChoicePoint<T> select,
Var[] vars)
It creates a CPviz trace generator around proper select choice point object.
|
TraceGenerator(Search<T> search,
SelectChoicePoint<T> select,
Var[] vars,
String treeFilename,
String visFilename)
It creates a CPviz trace generator around proper select choice point object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTracedVar(Var v) |
boolean |
executeAfterConsistency(boolean consistent)
It is executed right after consistency of the current search node.
|
void |
executedAtExit(Store store,
int solutionsNo)
It is executed right after time out is determined.
|
PrimitiveConstraint |
getChoiceConstraint(int index)
It returns the constraint which is the base of the choice point.
|
int |
getChoiceValue()
It returns a value which is the base of the next choice point.
|
T |
getChoiceVariable(int index)
It returns the variable which is the base on the next choice point.
|
int |
getIndex()
It returns the current index.
|
IdentityHashMap<T,Integer> |
getVariablesMapping()
It specifies the position of variables as given when variables of this
select object were supplied.
|
boolean |
leftChild(PrimitiveConstraint choice,
boolean status)
It is executed after exiting the left child.
|
boolean |
leftChild(T var,
int value,
boolean status)
It is executed after exiting the left child.
|
void |
rightChild(PrimitiveConstraint choice,
boolean status)
It is executed after exiting the right child.
|
void |
rightChild(T var,
int value,
boolean status)
It is executed after exiting the right child.
|
void |
setChildrenListeners(ConsistencyListener child)
Setting one child listener.
|
void |
setChildrenListeners(ConsistencyListener[] children)
Each of the child listeners will be called and the return code from them
will be combined (taken into account) by a parent).
|
void |
setChildrenListeners(ExitChildListener<T> child)
It adds one child listener.
|
void |
setChildrenListeners(ExitChildListener<T>[] children)
It sets the children listeners for the current listener.
|
void |
setChildrenListeners(ExitListener child)
It sets one child listener.
|
void |
setChildrenListeners(ExitListener[] children)
It sets the children of this exit listener.
|
String |
toString() |
public final String treeFilename
public final String visFilename
public TraceGenerator(Search<T> search, SelectChoicePoint<T> select)
search - it specifies search method used for depth-first-search.select - it specifies how the select choice points are being generated.public TraceGenerator(Search<T> search, SelectChoicePoint<T> select, String treeFilename, String visFilename)
search - it specifies search method used for depth-first-search.select - it specifies how the select choice points are being generated.treeFilename - it specifies the file name for search tree trace (default tree.xml).visFilename - it specifies the file name for variable trace (default vis.xml).public TraceGenerator(Search<T> search, SelectChoicePoint<T> select, Var[] vars)
search - it specifies search method used for depth-first-search.select - it specifies how the select choice points are being generated.vars - it specifies variables which are being traced.public TraceGenerator(Search<T> search, SelectChoicePoint<T> select, Var[] vars, String treeFilename, String visFilename)
search - it specifies search method used for depth-first-search.select - it specifies how the select choice points are being generated.vars - it specifies variables which are being traced.treeFilename - it specifies the file name for search tree trace (default tree.xml).visFilename - it specifies the file name for variable trace (default vis.xml).public T getChoiceVariable(int index)
SelectChoicePointgetChoiceVariable in interface SelectChoicePoint<T extends Var>index - the position of the last variable in selection choice point heuristic.public int getChoiceValue()
SelectChoicePointgetChoiceValue in interface SelectChoicePoint<T extends Var>public PrimitiveConstraint getChoiceConstraint(int index)
SelectChoicePointgetChoiceConstraint in interface SelectChoicePoint<T extends Var>index - the position of the last variable returned by selection choice point heuristic.public IdentityHashMap<T,Integer> getVariablesMapping()
SelectChoicePointgetVariablesMapping in interface SelectChoicePoint<T extends Var>public int getIndex()
SelectChoicePointgetIndex in interface SelectChoicePoint<T extends Var>public void setChildrenListeners(ConsistencyListener[] children)
ConsistencyListenersetChildrenListeners in interface ConsistencyListenerchildren - the children listeners attached to this listener.public void setChildrenListeners(ConsistencyListener child)
ConsistencyListenersetChildrenListeners in interface ConsistencyListenerchild - the only child listener added to this consistency listener.public boolean executeAfterConsistency(boolean consistent)
ConsistencyListenerexecuteAfterConsistency in interface ConsistencyListenerconsistent - specifies if the consistency call returned true or false.public void setChildrenListeners(ExitChildListener<T>[] children)
ExitChildListenersetChildrenListeners in interface ExitChildListener<T extends Var>children - array containing children listeners.public void setChildrenListeners(ExitListener[] children)
ExitListenersetChildrenListeners in interface ExitListenerchildren - an array containing the children.public boolean leftChild(T var, int value, boolean status)
ExitChildListenerleftChild in interface ExitChildListener<T extends Var>var - variable used in the choice point.value - value used in the choice point.status - true if the solution was found in the child subtree, false otherwise.public boolean leftChild(PrimitiveConstraint choice, boolean status)
ExitChildListenerleftChild in interface ExitChildListener<T extends Var>choice - primitive constraint used as the base of the choice point.status - true if the solution was found in the child subtree, false otherwise.public void rightChild(T var, int value, boolean status)
ExitChildListenerrightChild in interface ExitChildListener<T extends Var>var - variable used in the choice point.value - value used in the choice point.status - true if the solution was found in the child subtree, false otherwise.
exit the current node with falsepublic void rightChild(PrimitiveConstraint choice, boolean status)
ExitChildListenerrightChild in interface ExitChildListener<T extends Var>choice - primitive constraint used as the base of the choice point.status - true if the solution was found in the child subtree, false otherwise.
exit the current node with falsepublic void setChildrenListeners(ExitChildListener<T> child)
ExitChildListenersetChildrenListeners in interface ExitChildListener<T extends Var>child - added child listener.public void setChildrenListeners(ExitListener child)
ExitListenersetChildrenListeners in interface ExitListenerchild - the only child listener used by this listener.public void executedAtExit(Store store, int solutionsNo)
ExitListenerexecutedAtExit in interface ExitListenerstore - store in the context of which the search took place.solutionsNo - the number of solutions found.public void addTracedVar(Var v)
Copyright © 2016. All rights reserved.