pub struct Rollout<O, P, E> { /* private fields */ }Expand description
A computer player that plans on copies of the game: flat Monte Carlo (the module’s docs).
A decision does at most candidates × samples × (commands + 1) units
of work, a unit being one command applied to a copy.
Implementations§
Source§impl<O, P, E> Rollout<O, P, E>
impl<O, P, E> Rollout<O, P, E>
Sourcepub fn new(
order: O,
playout: P,
eval: E,
settings: RolloutSettings,
seed: u64,
) -> Self
pub fn new( order: O, playout: P, eval: E, settings: RolloutSettings, seed: u64, ) -> Self
A rollout bot whose candidates come from order, played out by
playout and scored by eval, thinking as settings says. Its
choices follow from seed.
Sourcepub fn settings(&self) -> RolloutSettings
pub fn settings(&self) -> RolloutSettings
How it thinks.
Sourcepub fn search<R>(&mut self, rules: &R) -> RolloutSearch<'_, R, O, P, E>
pub fn search<R>(&mut self, rules: &R) -> RolloutSearch<'_, R, O, P, E>
Starts a decision in rules, which is not over: its candidates are
listed and its seeds drawn. RolloutSearch::advance does the
work.
§Panics
If the game lists no legal command, or the order drops them all.
Trait Implementations§
Source§impl<R, O, P, E> Bot<R> for Rollout<O, P, E>
impl<R, O, P, E> Bot<R> for Rollout<O, P, E>
Source§fn choose(&mut self, rules: &R) -> R::Command
fn choose(&mut self, rules: &R) -> R::Command
The command whose playouts ended best (or, at a temperature, one picked by the softmax).
§Panics
As Rollout::search and RolloutSearch::advance do.
Auto Trait Implementations§
impl<O, P, E> Freeze for Rollout<O, P, E>
impl<O, P, E> RefUnwindSafe for Rollout<O, P, E>
impl<O, P, E> Send for Rollout<O, P, E>
impl<O, P, E> Sync for Rollout<O, P, E>
impl<O, P, E> Unpin for Rollout<O, P, E>
impl<O, P, E> UnsafeUnpin for Rollout<O, P, E>
impl<O, P, E> UnwindSafe for Rollout<O, P, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more