T
- type of variables used in this search.public interface Search<T extends Var>
Modifier and Type | Method and Description |
---|---|
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 int variable for the best solution.
|
double |
getCostValueFloat()
It returns the value of the cost float variable for the best solution.
|
Var |
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.
|
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 performs search, first by setting up the internal items/attributes of search,
followed later by a call to labeling function with argument specifying the index
of the first not grounded variable.
|
boolean |
labeling(Store store,
SelectChoicePoint<T> select)
It performs search using supplied choice point selection heuristic.
|
boolean |
labeling(Store store,
SelectChoicePoint<T> select,
Var 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(Var 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 |
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 |
setTimeOutMilliseconds(long out)
It turns on the timeout.
|
void |
setWrongDecisionsOut(long out)
It turns on the wrong decisions out.
|
String |
toString() |
void setChildSearch(Search<? extends Var>[] child)
child
- the array containing all children searches.void addChildSearch(Search<? extends Var> child)
child
- the search which is being added as child search.int getBacktracks()
Var getCostVariable()
int getCostValue()
double getCostValueFloat()
void setOptimize(boolean value)
value
- true if the search should optimize, false otherwise.int getDecisions()
int getMaximumDepth()
int getNodes()
int getWrongDecisions()
Domain[] getSolution()
Domain[] getSolution(int no)
no
- the solution we are interested in.T[] getVariables()
boolean label(int firstVariable)
firstVariable
- the index to the first variable which has not been grounded yet.boolean labeling()
boolean labeling(Store store, SelectChoicePoint<T> select)
store
- the store within which the search is conducted.select
- the selection choice point heuristic.boolean labeling(Store store, SelectChoicePoint<T> select, Var costVar)
store
- constraint store which will be used by labeling.select
- the selection choice point heuristic.costVar
- variable to specify cost.void setAssignSolution(boolean value)
value
- defines if solution is assigned.void setBacktracksOut(long out)
out
- defines how many backtracks are performed before the search
exits.void setDecisionsOut(long out)
out
- defines how many decisions are made before the search exits.void setNodesOut(long out)
out
- defines how many nodes are visited before the search exits.void setPrintInfo(boolean value)
value
- defines if info is printed to standard output.void setTimeOut(long out)
out
- defines how many seconds before the search exits.void setTimeOutMilliseconds(long out)
out
- defines how many miliseconds before the search exits.void setWrongDecisionsOut(long out)
out
- defines how many wrong decisions are made before the search
exits.SolutionListener<T> getSolutionListener()
ConsistencyListener getConsistencyListener()
ExitChildListener<T> getExitChildListener()
ExitListener getExitListener()
TimeOutListener getTimeOutListener()
InitializeListener getInitializeListener()
void setSolutionListener(SolutionListener<T> listener)
listener
- the root of the SolutionListener.void setConsistencyListener(ConsistencyListener listener)
listener
- the new root.void setExitChildListener(ExitChildListener<T> listener)
listener
- the new root.void setExitListener(ExitListener listener)
listener
- the new root.void setTimeOutListener(TimeOutListener listener)
listener
- the new root.void setInitializeListener(InitializeListener listener)
listener
- the new root.void setSelectChoicePoint(SelectChoicePoint<T> select)
select
- the choice point heuristic used by search.void setStore(Store store)
store
- the store in which context the search operates.void setCostVar(Var cost)
cost
- variable used as a cost metric.void setMasterSearch(Search<? extends Var> master)
master
- master search which will be/is calling that slave search.String id()
boolean assignSolution(int no)
no
- the solution number which we want to enforce in the store.boolean assignSolution()
void printAllSolutions()
Copyright © 2022. All rights reserved.