java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.battles.controller.ai.evaluation.settings.SearchSettings
Record Components:
depth - the number of turns to simulate, including the current turn being selected
terminalWinScore - the score returned when the searched state is a win for the evaluated team
terminalLossScore - the score returned when the searched state is a loss for the evaluated team
terminalDrawScore - the score returned when the searched state is a draw
simulationStepLimit - the maximum turn logic passes allowed while simulating a single turn before the simulated battle is considered stuck

public record SearchSettings(int depth, double terminalWinScore, double terminalLossScore, double terminalDrawScore, int simulationStepLimit) extends Record
Configuration for the depth and terminal scoring behaviour of the Kingfisher search.

The search depth controls how many turns the AI simulates when evaluating each candidate action. The current turn is always included in the search. Any remaining depth is used to look further ahead after the immediate result of the current choice.

In practice, this means the AI evaluates the current turn plus depth - 1 additional future turns. A depth of 1 only evaluates the immediate impact of selecting the current move. A depth of 2 evaluates the current turn, then one further turn from the resulting battle state. Higher values continue this pattern.

Terminal scores are used when the simulated battle reaches a decisive end state, allowing wins, losses, and draws to override normal board evaluation scores.

Used by KingfisherAI
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<SearchSettings> CODEC
    • DEFAULT

      public static final SearchSettings DEFAULT
      Default search settings used by the tests.

      The terminal score values are intentionally simple sentinel-style scores. They are not carefully tuned evaluation weights; they only ensure that terminal wins and losses strongly outweigh normal board evaluation scores.

  • Constructor Details

    • SearchSettings

      public SearchSettings(int depth, double terminalWinScore, double terminalLossScore, double terminalDrawScore, int simulationStepLimit)
      Creates an instance of a SearchSettings record class.
      Parameters:
      depth - the value for the depth record component
      terminalWinScore - the value for the terminalWinScore record component
      terminalLossScore - the value for the terminalLossScore record component
      terminalDrawScore - the value for the terminalDrawScore record component
      simulationStepLimit - the value for the simulationStepLimit record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • depth

      public int depth()
      Returns the value of the depth record component.
      Returns:
      the value of the depth record component
    • terminalWinScore

      public double terminalWinScore()
      Returns the value of the terminalWinScore record component.
      Returns:
      the value of the terminalWinScore record component
    • terminalLossScore

      public double terminalLossScore()
      Returns the value of the terminalLossScore record component.
      Returns:
      the value of the terminalLossScore record component
    • terminalDrawScore

      public double terminalDrawScore()
      Returns the value of the terminalDrawScore record component.
      Returns:
      the value of the terminalDrawScore record component
    • simulationStepLimit

      public int simulationStepLimit()
      Returns the value of the simulationStepLimit record component.
      Returns:
      the value of the simulationStepLimit record component