|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectJaCoP.search.DepthFirstSearch<T>
T - type of variables used in this search.public class DepthFirstSearch<T extends Var>
Implements Depth First Search with number of possible plugins (listeners) to be attached to modify the search.
| Field Summary | |
|---|---|
Search<? extends Var>[] |
childSearches
It stores searches which will be executed when this one has assign all its variables. |
ConsistencyListener |
consistencyListener
It is invoked when consistency function has been executed. |
int |
costValue
It represents the cost value of currently best solution. |
IntVar |
costVariable
It represents the cost variable. |
int |
currentChildSearch
It remembers what child search has been already examined. |
boolean |
einAinleftTree
It specifies if for setVar based search the left branch should impose EinA constraint. |
ExitChildListener<T> |
exitChildListener
It is invoked when returning from left or right child. |
java.lang.String |
id
It specifies the id of the search. |
InitializeListener |
initializeListener
It is executed when search is started, before entering the search. |
Search<? extends Var> |
masterSearch
If this search is a sub-search then this pointer will point out to the master search (i.e. |
boolean |
respectSolutionLimitInOptimization
If it is set to true then the optimizing search will quit the search if this action is indicated by the solution listener. |
SolutionListener<T> |
solutionListener
It is executed when a solution is found. |
boolean |
timeOutOccured
It specifies that the time-out has occured |
| Constructor Summary | |
|---|---|
DepthFirstSearch()
It specifies current child search. |
|
| Method Summary | |
|---|---|
void |
addChildSearch(Search<? extends Var> child)
It adds another child search to this one. |
boolean |
assignSolution()
It assigns the last solution. |
boolean |
assignSolution(int no)
The first solution has index 0. |
int |
getBacktracks()
It returns number of backtracks performed by the search. |
ConsistencyListener |
getConsistencyListener()
It returns the root of the Consistency Listener. |
int |
getCostValue()
It returns the value of the cost variable for the best solution. |
IntVar |
getCostVariable()
It returns the cost variable. |
int |
getDecisions()
It returns number of decisions performed by the search. |
ExitChildListener<T> |
getExitChildListener()
It returns the root of the ExitChildListener. |
ExitListener |
getExitListener()
It returns the root of the ExitListener. |
InitializeListener |
getInitializeListener()
It returns the root of the InitializationListener. |
int |
getMaximumDepth()
It returns the maximum depth reached by a search. |
int |
getNodes()
It returns number of search nodes explored by the search. |
Domain[] |
getSolution()
It returns the solution (an assignment of values to variables). |
Domain[] |
getSolution(int no)
It returns the solution specified by the search. |
SolutionListener<T> |
getSolutionListener()
It returns the root Solution Listener. |
TimeOutListener |
getTimeOutListener()
It returns the root of the TimeOutListener. |
T[] |
getVariables()
It returns the order of variables used by functions returning a solution in terms of the values. |
int |
getWrongDecisions()
It returns number of wrong decisions performed by the search. |
java.lang.String |
id()
It returns the string id of the search. |
boolean |
label(int firstVariable)
This function is called recursively to assign variables one by one. |
boolean |
labeling()
It is a labeling function called if the search is a sub-search being called from the parent search. |
boolean |
labeling(Store store,
SelectChoicePoint<T> select)
It performs search using supplied choice point selection heuristic. |
boolean |
labeling(Store store,
SelectChoicePoint<T> select,
IntVar costVar)
It performs search using supplied choice point selection heuristic, as well as costVariable as aim at finding an optimal solution. |
void |
printAllSolutions()
It prints all solutions. |
void |
setAssignSolution(boolean value)
It decides if a solution is assigned to store after search exits. |
void |
setBacktracksOut(long out)
It turns on the backtrack out. |
void |
setChildSearch(Search<? extends Var>[] child)
It specifies the sub-searches for the current search. |
void |
setConsistencyListener(ConsistencyListener listener)
It sets the root of the Consistency Listener. |
void |
setCostVar(IntVar cost)
It sets the reference to the cost variable. |
void |
setDecisionsOut(long out)
It turns on the decisions out. |
void |
setExitChildListener(ExitChildListener<T> listener)
It sets the root of the ExitChild listener. |
void |
setExitListener(ExitListener listener)
It sets the root of the Exit Listener. |
void |
setID(java.lang.String name)
It sets the id of the store. |
void |
setInitializeListener(InitializeListener listener)
It sets the root of the InitializeListener. |
void |
setMasterSearch(Search<? extends Var> master)
If the search is called by a master search then the search may need to obtain some information about the master search. |
void |
setNodesOut(long out)
It turns on the nodes out. |
void |
setOptimize(boolean value)
It sets the optimization flag. |
void |
setPrintInfo(boolean value)
It decides if information about search is printed. |
void |
setSelectChoicePoint(SelectChoicePoint<T> select)
It sets the select choice point object. |
void |
setSolutionListener(SolutionListener<T> listener)
It returns the root of the SolutionListener. |
void |
setStore(Store store)
It sets the reference to the store in the context of which the search operates. |
void |
setTimeOut(long out)
It turns on the timeout. |
void |
setTimeOutListener(TimeOutListener listener)
It sets the root of the TimeOutListener. |
void |
setWrongDecisionsOut(long out)
It turns on the wrong decisions out. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean respectSolutionLimitInOptimization
public int costValue
public IntVar costVariable
public ExitChildListener<T extends Var> exitChildListener
public ConsistencyListener consistencyListener
public SolutionListener<T extends Var> solutionListener
public InitializeListener initializeListener
public Search<? extends Var>[] childSearches
public Search<? extends Var> masterSearch
public boolean timeOutOccured
public java.lang.String id
public boolean einAinleftTree
public int currentChildSearch
| Constructor Detail |
|---|
public DepthFirstSearch()
| Method Detail |
|---|
public void setID(java.lang.String name)
name - the id of the store object.public java.lang.String id()
Search
id in interface Search<T extends Var>public void setChildSearch(Search<? extends Var>[] child)
Search
setChildSearch in interface Search<T extends Var>child - the array containing all children searches.public void addChildSearch(Search<? extends Var> child)
Search
addChildSearch in interface Search<T extends Var>child - the search which is being added as child search.public void setSelectChoicePoint(SelectChoicePoint<T> select)
Search
setSelectChoicePoint in interface Search<T extends Var>select - the choice point heuristic used by search.public int getBacktracks()
getBacktracks in interface Search<T extends Var>public int getDecisions()
getDecisions in interface Search<T extends Var>public int getMaximumDepth()
getMaximumDepth in interface Search<T extends Var>public int getNodes()
getNodes in interface Search<T extends Var>public int getWrongDecisions()
getWrongDecisions in interface Search<T extends Var>public Domain[] getSolution()
Search
getSolution in interface Search<T extends Var>public Domain[] getSolution(int no)
Search
getSolution in interface Search<T extends Var>no - the solution we are interested in.
public T[] getVariables()
Search
getVariables in interface Search<T extends Var>public SolutionListener<T> getSolutionListener()
Search
getSolutionListener in interface Search<T extends Var>public boolean label(int firstVariable)
label in interface Search<T extends Var>firstVariable - the index to the first variable which has not been grounded yet.
public void setStore(Store store)
Search
setStore in interface Search<T extends Var>store - the store in which context the search operates.public void setCostVar(IntVar cost)
Search
setCostVar in interface Search<T extends Var>cost - variable used as a cost metric.public boolean labeling()
labeling in interface Search<T extends Var>
public boolean labeling(Store store,
SelectChoicePoint<T> select)
Search
labeling in interface Search<T extends Var>store - the store within which the search is conducted.select - the selection choice point heuristic.
public boolean labeling(Store store,
SelectChoicePoint<T> select,
IntVar costVar)
Search
labeling in interface Search<T extends Var>store - constraint store which will be used by labeling.select - the selection choice point heuristic.costVar - variable to specify cost.
public void setAssignSolution(boolean value)
setAssignSolution in interface Search<T extends Var>value - defines if solution is assigned.public void setBacktracksOut(long out)
setBacktracksOut in interface Search<T extends Var>out - defines how many backtracks are performed before the search
exits.public void setDecisionsOut(long out)
setDecisionsOut in interface Search<T extends Var>out - defines how many decisions are made before the search exits.public void setNodesOut(long out)
setNodesOut in interface Search<T extends Var>out - defines how many nodes are visited before the search exits.public void setPrintInfo(boolean value)
setPrintInfo in interface Search<T extends Var>value - defines if info is printed to standard output.public void setTimeOut(long out)
setTimeOut in interface Search<T extends Var>out - defines how many seconds before the search exits.public void setWrongDecisionsOut(long out)
setWrongDecisionsOut in interface Search<T extends Var>out - defines how many wrong decisions are made before the search
exits.public void setMasterSearch(Search<? extends Var> master)
Search
setMasterSearch in interface Search<T extends Var>master - master search which will be/is calling that slave search.public java.lang.String toString()
toString in interface Search<T extends Var>toString in class java.lang.Objectpublic boolean assignSolution()
Search
assignSolution in interface Search<T extends Var>public boolean assignSolution(int no)
Search
assignSolution in interface Search<T extends Var>no - the solution number which we want to enforce in the store.
public ConsistencyListener getConsistencyListener()
Search
getConsistencyListener in interface Search<T extends Var>public ExitChildListener<T> getExitChildListener()
Search
getExitChildListener in interface Search<T extends Var>public ExitListener getExitListener()
Search
getExitListener in interface Search<T extends Var>public TimeOutListener getTimeOutListener()
Search
getTimeOutListener in interface Search<T extends Var>public void setSolutionListener(SolutionListener<T> listener)
Search
setSolutionListener in interface Search<T extends Var>listener - the root of the SolutionListener.public void setConsistencyListener(ConsistencyListener listener)
Search
setConsistencyListener in interface Search<T extends Var>listener - the new root.public void setExitChildListener(ExitChildListener<T> listener)
Search
setExitChildListener in interface Search<T extends Var>listener - the new root.public void setExitListener(ExitListener listener)
Search
setExitListener in interface Search<T extends Var>listener - the new root.public void setTimeOutListener(TimeOutListener listener)
Search
setTimeOutListener in interface Search<T extends Var>listener - the new root.public InitializeListener getInitializeListener()
Search
getInitializeListener in interface Search<T extends Var>public void setInitializeListener(InitializeListener listener)
Search
setInitializeListener in interface Search<T extends Var>listener - the new root.public void printAllSolutions()
Search
printAllSolutions in interface Search<T extends Var>public IntVar getCostVariable()
Search
getCostVariable in interface Search<T extends Var>public int getCostValue()
Search
getCostValue in interface Search<T extends Var>public void setOptimize(boolean value)
Search
setOptimize in interface Search<T extends Var>value - true if the search should optimize, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||