Interface Strategy

All Superinterfaces:
Function<lv.id.jc.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 Function<lv.id.jc.dicechess.runtime.TurnContext, List<String>>
Common functional interface for Java bot strategies mapping a TurnContext to move notations. Implementations must return a list of UCI move notations representing a complete turn.
  • Method Summary

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

    Methods inherited from interface Function

    andThen, compose
  • Method Details

    • chooseMoves

      List<String> chooseMoves(lv.id.jc.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.
    • apply

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