T
- type of variable being used in the Search.public class PrioritySearch<T extends Var> extends DepthFirstSearch<T>
childSearches, consistencyListener, costValue, costValueFloat, costVariable, currentChildSearch, einAinleftTree, exitChildListener, id, initializeListener, masterSearch, respectSolutionListenerAdvice, solutionListener, store, timeOutOccured
Constructor and Description |
---|
PrioritySearch(T[] priority,
ComparatorVariable<T> comparator,
DepthFirstSearch<T>[] dfs)
It constructs a PrioritySearch variable ordering.
|
Modifier and Type | Method and Description |
---|---|
void |
addRestartCalculator(DepthFirstSearch s,
Calculator calc) |
int |
getBacktracks()
It returns number of backtracks performed by the search.
|
int |
getDecisions()
It returns number of decisions performed by the search.
|
int |
getMaximumDepth()
It returns the maximum depth reached by a search.
|
int |
getNodes()
It returns number of search nodes explored by the search.
|
DepthFirstSearch[] |
getSearchSeq() |
void |
getStatistics() |
T[] |
getVariables(PrioritySearch ps) |
int |
getWrongDecisions()
It returns number of wrong decisions performed by the search.
|
boolean |
label(int n)
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) |
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.
|
boolean |
labeling(Store store,
Var costVar) |
int |
noSolutions() |
void |
setCostVariable(Var cost) |
void |
setSolutionLimit(int no) |
String |
toString() |
addChildSearch, assignSolution, assignSolution, getConsistencyListener, getCostValue, getCostValueFloat, getCostVariable, getExitChildListener, getExitListener, getInitializeListener, getSolution, getSolution, getSolutionListener, getTimeOutListener, getVariables, id, printAllSolutions, setAssignSolution, setBacktracksOut, setChildSearch, setConsistencyListener, setCostVar, setDecisionsOut, setExitChildListener, setExitListener, setID, setInitializeListener, setMasterSearch, setNodesOut, setOptimize, setPrintInfo, setSelectChoicePoint, setSolutionListener, setStore, setTimeOut, setTimeOutListener, setTimeOutMilliseconds, setWrongDecisionsOut, toStringFull
public PrioritySearch(T[] priority, ComparatorVariable<T> comparator, DepthFirstSearch<T>[] dfs)
priority
- prority variables used to select a sub-vector of vars (row)dfs
- vector of depth first searches to be selected from; they must have SelectChoicePoint set.comparator
- the variable comparator to choose the proper sub.search.
// * @param indomain variable ordering value to be used to determine value for a given variable.public boolean labeling(Store store, SelectChoicePoint<T> select)
Search
public boolean labeling(Store store)
public boolean labeling(Store store, SelectChoicePoint<T> select, Var costVar)
Search
labeling
in interface Search<T extends Var>
labeling
in class DepthFirstSearch<T extends Var>
store
- constraint store which will be used by labeling.select
- the selection choice point heuristic.costVar
- variable to specify cost.public boolean labeling()
DepthFirstSearch
public boolean label(int n)
DepthFirstSearch
public int getNodes()
DepthFirstSearch
public int getDecisions()
DepthFirstSearch
getDecisions
in interface Search<T extends Var>
getDecisions
in class DepthFirstSearch<T extends Var>
public int getWrongDecisions()
DepthFirstSearch
getWrongDecisions
in interface Search<T extends Var>
getWrongDecisions
in class DepthFirstSearch<T extends Var>
public int getBacktracks()
DepthFirstSearch
getBacktracks
in interface Search<T extends Var>
getBacktracks
in class DepthFirstSearch<T extends Var>
public int getMaximumDepth()
DepthFirstSearch
getMaximumDepth
in interface Search<T extends Var>
getMaximumDepth
in class DepthFirstSearch<T extends Var>
public void getStatistics()
public void setCostVariable(Var cost)
public T[] getVariables(PrioritySearch ps)
public void addRestartCalculator(DepthFirstSearch s, Calculator calc)
public void setSolutionLimit(int no)
public DepthFirstSearch[] getSearchSeq()
public String toString()
public int noSolutions()
Copyright © 2022. All rights reserved.