Files
NowChessSystems/modules/official-bots/src/main/scala/de/nowchess/bot/BotController.scala
T
Janis 1df29cf3a6
Build & Test (NowChessSystems) TeamCity build finished
feat(official-bots): make HybridBot veto actionable and use it for expert
When classical and NNUE evals diverge above the veto threshold, HybridBot
now re-searches excluding the suspect move and switches to NNUE's preferred
alternative instead of merely logging. BotController maps the expert bot to
HybridBot so tournament auto-join uses it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 10:30:55 +02:00

24 lines
837 B
Scala

package de.nowchess.bot
import de.nowchess.bot.bots.{ClassicalBot, HybridBot}
import jakarta.enterprise.context.ApplicationScoped
import org.jboss.logging.Logger
object BotController:
private val log = Logger.getLogger(classOf[BotController])
private val bots: Map[String, Bot] = Map(
"easy" -> ClassicalBot(BotDifficulty.Easy),
"medium" -> ClassicalBot(BotDifficulty.Medium),
"hard" -> ClassicalBot(BotDifficulty.Hard),
"expert" -> HybridBot(BotDifficulty.Expert, vetoReporter = log.debug(_)),
)
def getBot(name: String): Option[Bot] = bots.get(name.toLowerCase)
def listBots: List[String] = bots.keys.toList.sorted
@ApplicationScoped
class BotController:
def getBot(name: String): Option[Bot] = BotController.getBot(name)
def listBots: List[String] = BotController.listBots