Skip to main content

Module rollout

Module rollout 

Source
Expand description

A rollout bot over any Determinize game: flat Monte Carlo.

Rollout tries each of a few good-looking commands many times on copies of the game where the luck and the hidden things are redrawn (Determinize), plays each copy on a little way with simple players (Playout), and picks the command whose copies ended best (Evaluate). It searches one level, its own next command, so it suits games that branch too much for a tree of every side’s replies.

Everything is in integers: the scores, their means and the softmax that picks (base 2, the temperature in points). It thinks in work units, never time: a unit is one command applied to a copy. Its own randomness comes from its seed, drawn only at a decision’s start and its end, so how the work is sliced (RolloutSearch::advance) never changes the command (ADR-0027).

Structs§

Rollout
A computer player that plans on copies of the game: flat Monte Carlo (the module’s docs).
RolloutSearch
A decision of a Rollout bot under way: its loop state in a value, so the work can be split over many calls (frames, later).
RolloutSettings
How a Rollout bot thinks: data, so a persona’s settings can be a file. Build it with RolloutSettings::new (ADR-0039).
Unordered
The legal commands as the game lists them.

Enums§

Horizon
When a playout stops, short of the game’s end.

Traits§

Order
The game’s list of candidates, from the real state’s legal_commands: it may drop commands (ones the game never wants tried) and puts the most promising first. It returns only commands from the list it is given.
Playout
How a copy is played on after the candidate, for whichever side is to move: a game matches on side_to_move to use its baseline for one side and its enemy mind for another.

Functions§

exp2_q16
2^x in 16.16 fixed point (1 << 16 is 1), for x in 16.16 at most 0; a positive x counts as 0. The whole part is a shift, the fraction comes from a 16-entry table, read straight between its entries. More than 32 halvings down is 0.