Record Class SearchSettings
- Record Components:
depth- the number of turns to simulate, including the current turn being selectedterminalWinScore- the score returned when the searched state is a win for the evaluated teamterminalLossScore- the score returned when the searched state is a loss for the evaluated teamterminalDrawScore- the score returned when the searched state is a drawsimulationStepLimit- the maximum turn logic passes allowed while simulating a single turn before the simulated battle is considered stuck
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 byKingfisherAI-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SearchSettings> static final SearchSettingsDefault search settings used by the tests. -
Constructor Summary
ConstructorsConstructorDescriptionSearchSettings(int depth, double terminalWinScore, double terminalLossScore, double terminalDrawScore, int simulationStepLimit) Creates an instance of aSearchSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thesimulationStepLimitrecord component.doubleReturns the value of theterminalDrawScorerecord component.doubleReturns the value of theterminalLossScorerecord component.doubleReturns the value of theterminalWinScorerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
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 aSearchSettingsrecord class.- Parameters:
depth- the value for thedepthrecord componentterminalWinScore- the value for theterminalWinScorerecord componentterminalLossScore- the value for theterminalLossScorerecord componentterminalDrawScore- the value for theterminalDrawScorerecord componentsimulationStepLimit- the value for thesimulationStepLimitrecord component
-
-
Method Details
-
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. -
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. -
equals
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 '=='. -
depth
public int depth()Returns the value of thedepthrecord component.- Returns:
- the value of the
depthrecord component
-
terminalWinScore
public double terminalWinScore()Returns the value of theterminalWinScorerecord component.- Returns:
- the value of the
terminalWinScorerecord component
-
terminalLossScore
public double terminalLossScore()Returns the value of theterminalLossScorerecord component.- Returns:
- the value of the
terminalLossScorerecord component
-
terminalDrawScore
public double terminalDrawScore()Returns the value of theterminalDrawScorerecord component.- Returns:
- the value of the
terminalDrawScorerecord component
-
simulationStepLimit
public int simulationStepLimit()Returns the value of thesimulationStepLimitrecord component.- Returns:
- the value of the
simulationStepLimitrecord component
-