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 implementsIAdversarialSearchand 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 classIterativeDeepening.TimerUtility class representing an in-game timer
-
Constructor Summary
Constructors Constructor Description IterativeDeepening(TablutGame game, int utilMin, int utilMax, int time)Creates anIterativeDeepeninginstance for aTablutGamewith a given timeout and utility values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCurrDepthLimit()Returns the current depth limit reached by the searchMetricsgetMetrics()Returns the metrics object set within the classIterativeDeepening.TimergetTimer()Returns the timer in the currentIterativeDeepeninginstanceintgetUtilMax()Returns the maximum value the heuristic function can reachintgetUtilMin()Returns the minimum value the heuristic function can reachIActionmakeDecision(IState state)Returns the action which appears to be the best at the given statevoidsetGameState(IState state)Sets the game state to the value passed as inputvoidupdateMetrics(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 anIterativeDeepeninginstance for aTablutGamewith 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:
makeDecisionin 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 theIterativeDeepeningclass- 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 currentIterativeDeepeninginstance- Returns:
- the timer in the current
IterativeDeepeninginstance
-
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:
getMetricsin 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
-
-