Interface Strategy

All Superinterfaces:
com.fortemate.dicechess.runtime.BotStrategy, Function<com.fortemate.dicechess.runtime.TurnContext, List<String>>
All Known Implementing Classes:
OnnxStrategy
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Strategy extends com.fortemate.dicechess.runtime.BotStrategy, Function<com.fortemate.dicechess.runtime.TurnContext, List<String>>
Common functional interface for Java bot strategies mapping a TurnContext to move notations. Extends BotStrategy to provide decision-oriented runtime integration while allowing simple functional implementations of chooseMoves(TurnContext).
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<String>
    apply(com.fortemate.dicechess.runtime.TurnContext context)
     
    chooseMoves(com.fortemate.dicechess.runtime.TurnContext context)
    Choose the best list of move notations (micro-moves forming a turn) for the given TurnContext.
    default com.fortemate.dicechess.runtime.TurnAction
    onTurn(com.fortemate.dicechess.runtime.TurnContext context)
     

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

    onDoubleDecision, onDoubleOpportunity, onDrawDecision

    Methods inherited from interface Function

    andThen, compose
  • Method Details

    • chooseMoves

      List<String> chooseMoves(com.fortemate.dicechess.runtime.TurnContext context)
      Choose the best list of move notations (micro-moves forming a turn) for the given TurnContext.
      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.
    • onTurn

      default com.fortemate.dicechess.runtime.TurnAction onTurn(com.fortemate.dicechess.runtime.TurnContext context)
      Specified by:
      onTurn in interface com.fortemate.dicechess.runtime.BotStrategy
    • apply

      default List<String> apply(com.fortemate.dicechess.runtime.TurnContext context)
      Specified by:
      apply in interface Function<com.fortemate.dicechess.runtime.TurnContext, List<String>>