Class BstarSquaredDB
java.lang.Object
algorithm.BstarSquaredDB
- All Implemented Interfaces:
SearchAlgorithm
A B*² implementation which uses Disprove-Best B* at the first-level search only.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBstarSquaredDB.L1Position<P extends IGamePosition<P>>Nested classes/interfaces inherited from interface algorithm.SearchAlgorithm
SearchAlgorithm.Limits, SearchAlgorithm.SearchResult<N extends GameTreeNode<N,P>, P extends IGamePosition<P>>, SearchAlgorithm.SearchWithTable, SearchAlgorithm.SearchWithTree -
Constructor Summary
ConstructorsConstructorDescriptionBstarSquaredDB(double effort_ratio, StrategyFunction L1_strategyFunction) Uses the defaultStrategyFunction.PROVEBESTstrategy function for L2 search.BstarSquaredDB(double effort_ratio, StrategyFunction... strategyFunctions) The first evaluation function provided corresponds to the function used by the first-level search. -
Method Summary
Modifier and TypeMethodDescriptionvoidexpectIncorrectBounds(boolean set) defaults tofalse<P extends IGamePosition<P>>
SearchAlgorithm.SearchResult<?, P> search(P root, Duration time_limit, SearchAlgorithm.Limits space_limit, MetricKeeper... metrics) Initiates the search of the provided game tree with a given time limit and spatial limit.(package private) voidsetLevel(int newLevel) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface algorithm.SearchAlgorithm
search, search, search
-
Constructor Details
-
BstarSquaredDB
The first evaluation function provided corresponds to the function used by the first-level search. The number of strategy functions provided corresponds to the number of levels of search, with a minimum of two.- Parameters:
effort_ratio- The effort ratio of the Disprove-Best B* engine at the first-level search. Typically set between 1 and 2 divided by the branching factor of the tree.strategyFunctions- The list of strategy functions to apply at the root of a leveled search, including the first-level search.
-
BstarSquaredDB
Uses the defaultStrategyFunction.PROVEBESTstrategy function for L2 search.- Parameters:
L1_strategyFunction- The strategy function to be used for L1 search.
-
-
Method Details
-
expectIncorrectBounds
public void expectIncorrectBounds(boolean set) defaults tofalse- Parameters:
set-
-
setLevel
void setLevel(int newLevel) -
search
public <P extends IGamePosition<P>> SearchAlgorithm.SearchResult<?,P> search(P root, Duration time_limit, SearchAlgorithm.Limits space_limit, MetricKeeper... metrics) Description copied from interface:SearchAlgorithmInitiates the search of the provided game tree with a given time limit and spatial limit.- Specified by:
searchin interfaceSearchAlgorithm- Type Parameters:
P- The type ofIGamePositionwhich represents the type of game to be searched- Parameters:
root- root of the tree to be searchedtime_limit- maximum time spent in the algorithmspace_limit- maximum node expansions, evaluations, and nodes saved in memory used by the algorithmmetrics- an array ofMetricKeeperobjects to keep track of evaluations, expansions, and node storage performed during the search, can be empty- Returns:
- result from the search
-