Class OnnxStrategy

java.lang.Object
com.fortemate.dicechess.bot.OnnxStrategy
All Implemented Interfaces:
Strategy, com.fortemate.dicechess.runtime.BotStrategy, Function<com.fortemate.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 Summary

    Constructors
    Constructor
    Description
    Constructs a new ONNX strategy instance backed by the given evaluator.
  • Method Summary

    Modifier and Type
    Method
    Description
    chooseMoves(com.fortemate.dicechess.runtime.TurnContext context)
    Choose the best list of move notations (micro-moves forming a turn) for the given TurnContext.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.fortemate.dicechess.runtime.BotStrategy

    onDoubleDecision, onDoubleOpportunity, onDrawDecision

    Methods inherited from interface Function

    andThen, compose

    Methods inherited from interface Strategy

    apply, onTurn
  • 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(com.fortemate.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.