Class OnnxStrategy
java.lang.Object
com.fortemate.dicechess.bot.OnnxStrategy
- All Implemented Interfaces:
Strategy, Function<lv.id.jc.dicechess.runtime.TurnContext, List<String>>
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
ConstructorsConstructorDescriptionOnnxStrategy(OnnxEvaluator evaluator) Constructs a new ONNX strategy instance backed by the given evaluator. -
Method Summary
Modifier and TypeMethodDescriptionchooseMoves(lv.id.jc.dicechess.runtime.TurnContext context) Choose the best list of move notations (micro-moves forming a turn) for the given TurnContext.
-
Constructor Details
-
OnnxStrategy
Constructs a new ONNX strategy instance backed by the given evaluator.- Parameters:
evaluator- position evaluator instance (ONNX-backed or engine fallback)
-
-
Method Details
-
chooseMoves
Description copied from interface:StrategyChoose the best list of move notations (micro-moves forming a turn) for the given TurnContext.- Specified by:
chooseMovesin interfaceStrategy- 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.
-