Interface IGame

  • All Known Implementing Classes:
    TablutGame

    public interface IGame
    Defines a standard interface for a game.
    Author:
    Alessandro Buldini, Alessandro Pomponio, Federico Zanini
    See Also:
    Aima Java
    • Method Summary

      All Methods Instance Methods Abstract 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 game
      it.unibo.ai.didattica.competition.tablut.domain.State.Turn getPlayer​(IState state)
      Returns the player who has to play at this stage of the game
      IState getResult​(IState state, IAction action)
      Returns the state of the game after performing the input action
      int getUtility​(IState state, it.unibo.ai.didattica.competition.tablut.domain.State.Turn player)
      Returns the heuristic value for the given state and player
      boolean isTerminal​(IState state)
      Returns a boolean whether the current state is a terminal one
    • Method Detail

      • getPlayer

        it.unibo.ai.didattica.competition.tablut.domain.State.Turn getPlayer​(IState state)
        Returns the player who has to play at this stage of the game
        Parameters:
        state - represents the current state of the game
        Returns:
        the player who has to move
        See Also:
        IState
      • getActions

        java.util.List<IAction> getActions​(IState state)
        Returns all the possible actions a player can do at this stage of the game
        Parameters:
        state - represents the current state of the game
        Returns:
        a list containing all possible actions
        See Also:
        IState
      • getResult

        IState getResult​(IState state,
                         IAction action)
        Returns the state of the game after performing the input action
        Parameters:
        state - current state of the game
        action - action to perform
        Returns:
        IState after the move has been performed
        See Also:
        IState, IAction
      • isTerminal

        boolean isTerminal​(IState state)
        Returns a boolean whether the current state is a terminal one
        Parameters:
        state - IState to be evaluated
        Returns:
        true if the current state is a terminal one
        See Also:
        IState
      • getUtility

        int getUtility​(IState state,
                       it.unibo.ai.didattica.competition.tablut.domain.State.Turn player)
        Returns the heuristic value for the given state and player
        Parameters:
        state - state of the game that needs to be evaluated
        player - player for which the heuristic function should be evaluated
        Returns:
        the heuristic value of the input state
        See Also:
        IState, State.Turn