s3games.ai

## Class Strategy

- java.lang.Object
- - s3games.ai.Strategy

- Direct Known Subclasses:
    AStarStrategy, BreadthFirstSearchStrategy, DepthFirstSearchStrategy, MiniMaxStochasticStrategy, MiniMaxStrategy, MonteCarloRatioStrategy, MonteCarloRatioStrategy2, MonteCarloStrategy, RandomGeneralStrategy

      public abstract class Strategy
      extends java.lang.Object

  An abstract class for all strategies, lists all available strategies and contains a constructor method for all strategy types.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Heuristic` | `heuristic` if the strategy needs a heuristic, it is stored here

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Strategy()` default constructor uses zero heuristic

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String[]` | `availableStrategies(java.lang.String gameName)` list of all strategies that can be used with the specified game - place for improvement...?
    `abstract Player` | `getPlayer(GameSpecification specs)` constructor method for the player of the respective strategy subclass
    `static Strategy` | `getStrategy(java.lang.String name, Heuristic h)` get a strategy instance of the specified name
    `abstract void` | `learn(Game game)` learn a strategy for the specified game
    `static boolean` | `learnable(java.lang.String strategyName)` determines if the specified strategy is learnable - place for improvement...
    `void` | `setHeuristic(Heuristic heuristic)` set a heuristic that this strategy should be using

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### heuristic

          protected Heuristic heuristic

      if the strategy needs a heuristic, it is stored here

  - ### Constructor Detail

    - #### Strategy

          public Strategy()

      default constructor uses zero heuristic

  - ### Method Detail

    - #### getPlayer

          public abstract Player getPlayer(GameSpecification specs)

      constructor method for the player of the respective strategy subclass

    - #### learn

          public abstract void learn(Game game)

      learn a strategy for the specified game

    - #### availableStrategies

          public static java.lang.String[] availableStrategies(java.lang.String gameName)

      list of all strategies that can be used with the specified game - place for improvement...?

    - #### learnable

          public static boolean learnable(java.lang.String strategyName)

      determines if the specified strategy is learnable - place for improvement...

    - #### setHeuristic

          public void setHeuristic(Heuristic heuristic)

      set a heuristic that this strategy should be using

    - #### getStrategy

          public static Strategy getStrategy(java.lang.String name,
                             Heuristic h)

      get a strategy instance of the specified name