Enum shakmaty_syzygy::Wdl
source · [−]#[repr(i32)]
pub enum Wdl {
Loss,
BlessedLoss,
Draw,
CursedWin,
Win,
}
Expand description
WDL50. 5-valued evaluation of a position in the context of the 50-move drawing rule.
Variants
Loss
Unconditional loss.
BlessedLoss
Loss that can be saved by the 50-move rule.
Draw
Unconditional draw.
CursedWin
Win that can be frustrated by the 50-move rule.
Win
Unconditional win.
Implementations
sourceimpl Wdl
impl Wdl
sourcepub fn from_outcome(outcome: Outcome, pov: Color) -> Wdl
pub fn from_outcome(outcome: Outcome, pov: Color) -> Wdl
Converts outcome
to a Wdl
from the given point of view.
sourcepub fn from_dtz_after_zeroing(dtz: MaybeRounded<Dtz>) -> Wdl
pub fn from_dtz_after_zeroing(dtz: MaybeRounded<Dtz>) -> Wdl
Converts dtz
to Wdl
.
In general the result would be
ambiguous for MaybeRounded::Rounded(Dtz(100))
and
MaybeRounded::Rounded(Dtz(-100))
.
This conversion assumes that such values were given
immediately after a capture or pawn move, in which case
the outcome is an unconditional win or loss.
Since playing the tablebase mainline preserves the game theoretical
outcome, this method may also be used on dtz.add_plies(plies)
if the mainline has been followed for plies
halfmoves since the last
capture or pawn move.
Trait Implementations
sourceimpl From<Wdl> for AmbiguousWdl
impl From<Wdl> for AmbiguousWdl
sourcefn from(wdl: Wdl) -> AmbiguousWdl
fn from(wdl: Wdl) -> AmbiguousWdl
Converts to this type from the input type.
sourceimpl Ord for Wdl
impl Ord for Wdl
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Wdl> for Wdl
impl PartialOrd<Wdl> for Wdl
sourcefn partial_cmp(&self, other: &Wdl) -> Option<Ordering>
fn partial_cmp(&self, other: &Wdl) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Wdl
impl Eq for Wdl
impl StructuralEq for Wdl
impl StructuralPartialEq for Wdl
Auto Trait Implementations
impl RefUnwindSafe for Wdl
impl Send for Wdl
impl Sync for Wdl
impl Unpin for Wdl
impl UnwindSafe for Wdl
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more