Class OnnxStrategy

java.lang.Object
com.fortemate.dicechess.bot.OnnxStrategy
All Implemented Interfaces:
Strategy, Function<lv.id.jc.dicechess.runtime.TurnContext, List<String>>

public class OnnxStrategy extends Object implements Strategy
Strategy implementation using an ONNX value model (or fallback engine evaluation) over every legal full turn available from the current position, via the engine's JvmApi facade.

TurnContext.legalMoves() is not consulted here: scoring a candidate turn needs the resulting board position, not just its UCI tokens, so the engine's own enumeration (JvmApi.legalTurns(GameState)) has to run regardless of whether the platform's inline tree was present.

  • Constructor Details

    • OnnxStrategy

      public OnnxStrategy(OnnxEvaluator evaluator)
      Constructs a new ONNX strategy instance backed by the given evaluator.
      Parameters:
      evaluator - position evaluator instance (ONNX-backed or engine fallback)
  • Method Details

    • chooseMoves

      public List<String> chooseMoves(lv.id.jc.dicechess.runtime.TurnContext context)
      Description copied from interface: Strategy
      Choose the best list of move notations (micro-moves forming a turn) for the given TurnContext.
      Specified by:
      chooseMoves in interface Strategy
      Parameters:
      context - turn context containing DFEN, remaining time, increment, etc.
      Returns:
      list of move notations (e.g. ["e2e4", "g1f3"]). Returns empty list if no moves are available or an error occurs.