Package b2p.search.aima.minmax
Class IterativeDeepening
- java.lang.Object
-
- b2p.search.aima.minmax.IterativeDeepening
-
- All Implemented Interfaces:
IAdversarialSearch
public class IterativeDeepening extends java.lang.Object implements IAdversarialSearch
This class implementsIAdversarialSearch
and defines the Iterative Deepening Minimax algorithm with alpha-beta pruning.- Author:
- Alessandro Buldini, Alessandro Pomponio, Federico Zanini
- See Also:
- AIMA Java
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
IterativeDeepening.Timer
Utility class representing an in-game timer
-
Constructor Summary
Constructors Constructor Description IterativeDeepening(TablutGame game, int utilMin, int utilMax, int time)
Creates anIterativeDeepening
instance for aTablutGame
with a given timeout and utility values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCurrDepthLimit()
Returns the current depth limit reached by the searchMetrics
getMetrics()
Returns the metrics object set within the classIterativeDeepening.Timer
getTimer()
Returns the timer in the currentIterativeDeepening
instanceint
getUtilMax()
Returns the maximum value the heuristic function can reachint
getUtilMin()
Returns the minimum value the heuristic function can reachIAction
makeDecision(IState state)
Returns the action which appears to be the best at the given statevoid
setGameState(IState state)
Sets the game state to the value passed as inputvoid
updateMetrics(int depth)
Given a depth value, updates the metrics object set within the class
-
-
-
Constructor Detail
-
IterativeDeepening
public IterativeDeepening(TablutGame game, int utilMin, int utilMax, int time)
Creates anIterativeDeepening
instance for aTablutGame
with a given timeout and utility values.- Parameters:
game
- instance of the TablutGame classutilMin
- minimum value the heuristic function can reachutilMax
- maximum value the heuristic function can reachtime
- timeout for the search strategy
-
-
Method Detail
-
makeDecision
public IAction makeDecision(IState state)
Returns the action which appears to be the best at the given state- Specified by:
makeDecision
in interfaceIAdversarialSearch
- Parameters:
state
- state of the game on which the decision should be made- Returns:
- the best action to perform for the input state
- See Also:
IState
-
setGameState
public void setGameState(IState state)
Sets the game state to the value passed as input- Parameters:
state
- state to be set within theIterativeDeepening
class- See Also:
IState
-
getUtilMin
public int getUtilMin()
Returns the minimum value the heuristic function can reach- Returns:
- the minimum value the heuristic function can reach
-
getUtilMax
public int getUtilMax()
Returns the maximum value the heuristic function can reach- Returns:
- the maximum value the heuristic function can reach
-
getTimer
public IterativeDeepening.Timer getTimer()
Returns the timer in the currentIterativeDeepening
instance- Returns:
- the timer in the current
IterativeDeepening
instance
-
getCurrDepthLimit
public int getCurrDepthLimit()
Returns the current depth limit reached by the search- Returns:
- the current depth limit reached by the search
-
getMetrics
public Metrics getMetrics()
Returns the metrics object set within the class- Specified by:
getMetrics
in interfaceIAdversarialSearch
- Returns:
- the metrics object set within the class
-
updateMetrics
public void updateMetrics(int depth)
Given a depth value, updates the metrics object set within the class- Parameters:
depth
- depth reached at the current state of the search
-
-