All Known Implementing Classes:
ThreatBasedHeuristic
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Heuristic
A heuristic is a function that takes a game state and returns a score from the given player's point of view.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    getScore(GameContext context, int playerId)
    A scoring function mapping from game state to a double representing the strength of that game state.
  • Method Details

    • getScore

      double getScore(GameContext context, int playerId)
      A scoring function mapping from game state to a double representing the strength of that game state.
      Parameters:
      context - The game context. Use its GameContext.getGameState() to evaluate its game state, do not mutate it here.
      playerId - The player whose point of view should be used to calculate this score.
      Returns:
      A possibly negative score.