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).
- Rollout
Search - A decision of a
Rolloutbot under way: its loop state in a value, so the work can be split over many calls (frames, later). - Rollout
Settings - How a
Rolloutbot thinks: data, so a persona’s settings can be a file. Build it withRolloutSettings::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_moveto use its baseline for one side and its enemy mind for another.
Functions§
- exp2_
q16 2^xin 16.16 fixed point (1 << 16is 1), forxin 16.16 at most 0; a positivexcounts 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.