Struct inanis::evaluation::EvaluationResult
source · pub struct EvaluationResult {
pub opening_score: i16,
pub ending_score: i16,
}
Fields§
§opening_score: i16
§ending_score: i16
Implementations§
source§impl EvaluationResult
impl EvaluationResult
pub fn new(opening_score: i16, ending_score: i16) -> EvaluationResult
sourcepub fn taper_score(&self, game_phase: u8, max_game_phase: u8) -> i16
pub fn taper_score(&self, game_phase: u8, max_game_phase: u8) -> i16
Blends opening_score
and ending_score
with the ratio passed in game_phase
. The ratio is a number from 0 to max_game_phase
, where:
max_game_phase
represents a board with the initial state set (opening phase)- 0 represents a board without any piece (ending phase)
- every value between them represents a board state somewhere in the middle game
Trait Implementations§
source§impl Add<EvaluationResult> for EvaluationResult
impl Add<EvaluationResult> for EvaluationResult
§type Output = EvaluationResult
type Output = EvaluationResult
The resulting type after applying the
+
operator.source§fn add(self, rhs: EvaluationResult) -> EvaluationResult
fn add(self, rhs: EvaluationResult) -> EvaluationResult
Performs the
+
operation. Read moresource§impl Add<EvaluationResult> for i16
impl Add<EvaluationResult> for i16
§type Output = EvaluationResult
type Output = EvaluationResult
The resulting type after applying the
+
operator.source§fn add(self, rhs: EvaluationResult) -> EvaluationResult
fn add(self, rhs: EvaluationResult) -> EvaluationResult
Performs the
+
operation. Read moresource§impl Add<i16> for EvaluationResult
impl Add<i16> for EvaluationResult
§type Output = EvaluationResult
type Output = EvaluationResult
The resulting type after applying the
+
operator.source§impl Sub<EvaluationResult> for EvaluationResult
impl Sub<EvaluationResult> for EvaluationResult
§type Output = EvaluationResult
type Output = EvaluationResult
The resulting type after applying the
-
operator.source§fn sub(self, rhs: EvaluationResult) -> EvaluationResult
fn sub(self, rhs: EvaluationResult) -> EvaluationResult
Performs the
-
operation. Read moreAuto Trait Implementations§
impl RefUnwindSafe for EvaluationResult
impl Send for EvaluationResult
impl Sync for EvaluationResult
impl Unpin for EvaluationResult
impl UnwindSafe for EvaluationResult
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