Skip to main content

Module plan

Module plan 

Source
Expand description

A turn planner over any Determinize game: a beam search over its own side’s commands.

TurnPlan is for games whose side issues several commands a turn (each of its pieces acts, cards are played one after another). It weighs short sequences of its own commands, so a first command that only pays off with a second (“weaken it, then finish it”; a card that draws, then the card it drew) is chosen for what the sequence does, not judged alone. It plays each partial turn on copies of the game where the luck and the hidden things are redrawn (Determinize), scores where each copy got to (Evaluate), and keeps the best few at each depth to extend by the game’s next candidates (Order). It never searches the other sides’ replies: their danger is the game’s Evaluate to see, as a player would.

Every partial turn is played on the same copies, one per seed. A copy stops where it refuses a command (a piece fell there), where its side’s turn ends, or where the game ends, and is scored there. A partial turn’s candidates are the order of its first copy still playing. A first command is worth the best partial turn that starts with it, itself included.

It returns the first command of the best plan and plans again for the next command, keeping nothing between decisions but its random number generator. Its integers, its softmax and its work units are the rollout bot’s: a unit is one command applied to a copy, and its own randomness is drawn only at a decision’s start and its end, so how the work is sliced (PlanSearch::advance) never changes the command (ADR-0027, ADR-0029).

Structs§

PlanSearch
A decision of a TurnPlan bot under way: its loop state in a value, so the work can be split over many calls (frames, later).
PlanSettings
How a TurnPlan bot thinks: data, so a persona’s settings can be a file.
TurnPlan
A computer player that plans its side’s turn on copies of the game: a beam search over its own commands (the module’s docs).