A configurable two- or three-ply expectimax bot whose leaf evaluator is an externally-trained model (LightGBM, via ONNX).
ExpectimaxSearch supplies the lookahead and OnnxEvalSearch supplies the value function, evaluated in batches at leaf decision nodes. The default two-ply tree sees the opponent's reply; searchDepth = 3 also sees our next rolled reply and therefore resolves exchanges that otherwise end on the opponent's capture.
A positive-weight rootRescore wires a second ONNX session as ExpectimaxSearch's root rescorer — see RootRescoreModel. A zero-weight configuration is treated exactly like None, including session ownership.
preRankWithModel, when true, uses this bot's own already-loaded model (batched) to pre-rank root candidates instead of material — no second session, since the model already scoring the chance-node leaves is exactly the "opinion" candidate selection should defer to. See ExpectimaxSearch's preRank parameter for why: widening candidateLimit only compensates for a crude (material) pre-ranker; a sharper one attacks the actual bottleneck.
preRankModel wires a dedicated session for candidate ordering instead — see PreRankModel for why ranking and valuing are different jobs, and why its cost is bounded by the feature schema rather than by the candidate limit. It is an alternative to preRankWithModel, not a companion: configuring both is rejected.
chanceCollapse wires a model in place of the chance-node expansion itself — the layer that costs hundreds to thousands of leaf evaluations per candidate. It is a third, independent session, and with it searchDepth, the transposition table and Star pruning have nothing left to do at the root: see ChanceCollapse.
statsSink is forwarded to the underlying ExpectimaxSearch — one RootSearchStats per move, so a production host can log how many candidates its deadline really allowed (the difference between the configured limit and the width actually searched on slow hardware).
Owns its ONNX session(s) — the main model's, the rescorer's when configured with positive weight, and the chance-collapse model's when configured; call close when done. Not safe for concurrent calls, matching every other bot here.
Attributes
- Companion
- object
- Source
- OnnxExpectimaxSearch.scala
- Graph
-
- Supertypes
-
trait AutoCloseabletrait TimeBudgetedSearchtrait SearchAlgorithmclass Objecttrait Matchableclass Any