search

fun search(determinize: () -> State, legal: List<Move>, viewer: Actor, rolloutHorizon: Int, elapsedMillis: () -> Long): SearchNode<Move>

Runs the search and returns the populated root node (one child per element of legal, plus whatever the tree expanded into). determinize supplies one fresh determinized State per iteration; a thrown exception from it is treated as a free retry (does not consume an iteration) — the caller is expected to advance its own RNG before rethrowing, mirroring a failed-sample retry. elapsedMillis is polled against SearchBudget.maxMillis.