pub struct OptimalBot { /* private fields */ }Expand description
A Strategy that plays perfectly, backed by a Solver.
The default construction solves lazily: the first decision of a fresh
game triggers close to a full solve, which takes seconds in a release
build. Use presolved to pay that cost up front,
or from_solver to share a table you already
built.
Implementations§
Source§impl OptimalBot
impl OptimalBot
Sourcepub fn presolved() -> Self
pub fn presolved() -> Self
A bot with the whole game solved up front; see Solver::solve.
Sourcepub const fn from_solver(solver: Solver) -> Self
pub const fn from_solver(solver: Solver) -> Self
A bot backed by an existing solver, keeping its solved states.
Trait Implementations§
Source§impl Clone for OptimalBot
impl Clone for OptimalBot
Source§fn clone(&self) -> OptimalBot
fn clone(&self) -> OptimalBot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OptimalBot
impl Debug for OptimalBot
Source§impl Default for OptimalBot
impl Default for OptimalBot
Source§fn default() -> OptimalBot
fn default() -> OptimalBot
Returns the “default value” for a type. Read more
Source§impl Strategy for OptimalBot
impl Strategy for OptimalBot
Source§fn choose_action(&mut self, view: &View<'_>) -> TurnAction
fn choose_action(&mut self, view: &View<'_>) -> TurnAction
Decides with rolls remaining: hold and reroll, or score now.
Source§fn choose_category(&mut self, view: &View<'_>) -> Category
fn choose_category(&mut self, view: &View<'_>) -> Category
Decides after the final roll: which category to score.
Auto Trait Implementations§
impl Freeze for OptimalBot
impl RefUnwindSafe for OptimalBot
impl Send for OptimalBot
impl Sync for OptimalBot
impl Unpin for OptimalBot
impl UnsafeUnpin for OptimalBot
impl UnwindSafe for OptimalBot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more