#[non_exhaustive]pub struct HeuristicConfig {
pub moon_defense: u8,
pub void_weight: u8,
pub heart_weight: u8,
pub spade_guards: u8,
pub two_of_clubs_bonus: u8,
pub queen_insurance: u8,
}Expand description
Tuning knobs for HeuristicBot
Like hearts::Rules, the struct is non-exhaustive: start from
HeuristicConfig::default and adjust fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.moon_defense: u8Take a trick to kill a suspected moon once a single opponent has
swept this many points; u8::MAX effectively disables the defense
void_weight: u8Weight of the void bonus when scoring passes
Zero passes purely on card danger; the default is 1.
heart_weight: u8Extra pass-score weight per rank for hearts, atop the base rank
Zero, the default, prices hearts like any other card: high hearts are duckable on demand, unlike a caught Q♠.
spade_guards: u8High-spade pass bonuses apply while holding fewer than this many spades below the queen; the default is 4
two_of_clubs_bonus: u8Extra pass score for the 2♣ alone
Its holder must lead it at the first trick, so the card carries no choice worth keeping — the cheapest thing in the deck to give away — yet it scores bare rank 2 and is otherwise all but unpassable. Zero, the default, leaves it at bare rank.
queen_insurance: u8Pass-score malus for a spade below the queen while the hand lacks her; zero disables it
After the exchange such a spade guards against the queen arriving. The default, 4, already saturates: larger values change no more passes.
Implementations§
Source§impl HeuristicConfig
impl HeuristicConfig
Sourcepub const fn new() -> Self
pub const fn new() -> Self
The shipped tuning, in a const context
Default delegates here, as hearts::Rules does: a const fn
constructor — MonteCarloBot::new —
cannot call a trait method.
Trait Implementations§
Source§impl Clone for HeuristicConfig
impl Clone for HeuristicConfig
impl Copy for HeuristicConfig
Source§impl Debug for HeuristicConfig
impl Debug for HeuristicConfig
Source§impl Default for HeuristicConfig
impl Default for HeuristicConfig
impl Eq for HeuristicConfig
Source§impl PartialEq for HeuristicConfig
impl PartialEq for HeuristicConfig
impl StructuralPartialEq for HeuristicConfig
Auto Trait Implementations§
impl Freeze for HeuristicConfig
impl RefUnwindSafe for HeuristicConfig
impl Send for HeuristicConfig
impl Sync for HeuristicConfig
impl Unpin for HeuristicConfig
impl UnsafeUnpin for HeuristicConfig
impl UnwindSafe for HeuristicConfig
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
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> ⓘ
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> ⓘ
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