Package b2p.search.aima
Class TablutGame
- java.lang.Object
-
- b2p.search.aima.TablutGame
-
-
Constructor Summary
Constructors Constructor Description TablutGame(IState state)
Creates a TablutGame given anIState
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<IAction>
getActions(IState state)
Returns all the possible actions a player can do at this stage of the gameit.unibo.ai.didattica.competition.tablut.domain.State.Turn
getPlayer(IState state)
Defines which player has to play at this stage of the gameIState
getResult(IState state, IAction action)
Returns the state of the game after performing the input actionint
getUtility(IState state, it.unibo.ai.didattica.competition.tablut.domain.State.Turn turn)
Returns the heuristic value for the given state and playerboolean
isTerminal(IState state)
Returns a boolean whether the current state is a terminal onevoid
setState(IState state)
Sets the private variable state to the given value
-
-
-
Method Detail
-
setState
public void setState(IState state)
Sets the private variable state to the given value- Parameters:
state
- value that needs to be set
-
getPlayer
public it.unibo.ai.didattica.competition.tablut.domain.State.Turn getPlayer(IState state)
Defines which player has to play at this stage of the game
-
getActions
public java.util.List<IAction> getActions(IState state)
Returns all the possible actions a player can do at this stage of the game- Specified by:
getActions
in interfaceIGame
- Parameters:
state
- represents the current state of the game- Returns:
- a list containing all possible actions
- See Also:
IState
-
getResult
public IState getResult(IState state, IAction action)
Returns the state of the game after performing the input action
-
isTerminal
public boolean isTerminal(IState state)
Returns a boolean whether the current state is a terminal one- Specified by:
isTerminal
in interfaceIGame
- Parameters:
state
- IState to be evaluated- Returns:
true
if the current state is a terminal one- See Also:
IState
-
getUtility
public int getUtility(IState state, it.unibo.ai.didattica.competition.tablut.domain.State.Turn turn)
Returns the heuristic value for the given state and player- Specified by:
getUtility
in interfaceIGame
- Parameters:
state
- state of the game that needs to be evaluatedturn
- player for which the heuristic function should be evaluated- Returns:
- the heuristic value of the input state
- See Also:
IState
,State.Turn
-
-