Interface BattleEvaluationModule

All Known Implementing Classes:
BoardControlEvaluationModule, FlexibilityEvaluationModule, MatchUpEvaluationModule, ResourceEvaluationModule, RiskEvaluationModule, StatusEvaluationModule

public interface BattleEvaluationModule
Represents a single scoring component used by the battle AI when evaluating a battle state.

Evaluation modules are intentionally small, focused units of logic. Each module is responsible for scoring one aspect of the current battle, such as resources, matchup pressure, board control, status conditions, or flexibility. The final battle evaluation can then combine the scores from multiple modules.

Implementations are datapack-serializable through their registered BattleEvaluationModuleType. The CODEC dispatches on the module type registered in PixelmonRegistry.getBattleEvaluationModuleTypeRegistry(), allowing different module implementations to define their own configuration codecs.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<BattleEvaluationModule>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Evaluates the current battle state from the perspective provided by the context.
    default String
    key()
    Gets the registry key for this evaluation module's type.
    Gets the registered type for this evaluation module.
  • Field Details

  • Method Details

    • type

      Gets the registered type for this evaluation module.
      Returns:
      the module type that provides this module's codec and registry identity
    • key

      default String key()
      Gets the registry key for this evaluation module's type.
      Returns:
      the string representation of this module type's registry key
    • evaluate

      double evaluate(BattleEvaluationContext context)
      Evaluates the current battle state from the perspective provided by the context.

      Positive scores should generally represent favourable outcomes for the evaluated team, while negative scores should represent unfavourable outcomes. The exact scale is defined by the module implementation and its configuration.

      Parameters:
      context - the battle evaluation context containing the battle state and team perspective
      Returns:
      the score contributed by this module for the current battle state