Trait alcibiades::TtableEntry
[−]
[src]
pub trait TtableEntry: Copy + Send + 'static { fn new(value: Value, bound: BoundType, depth: Depth) -> Self; fn value(&self) -> Value; fn bound(&self) -> BoundType; fn depth(&self) -> Depth; fn set_move_digest(self, move_digest: MoveDigest) -> Self; fn move_digest(&self) -> MoveDigest; fn set_static_eval(self, static_eval: Value) -> Self { ... } fn static_eval(&self) -> Value { ... } fn importance(&self) -> i16 { ... } }
A trait for transposition table entries.
Required Methods
fn new(value: Value, bound: BoundType, depth: Depth) -> Self
Creates a new instance.
value
-- The value assigned to the position. Must be betweenVALUE_MIN
andVALUE_MAX
.bound
-- The accuracy of the assigned value.depth
-- The search depth for the assigned value. Must be betweenDEPTH_MIN
andDEPTH_MAX
.
fn value(&self) -> Value
Returns the value assigned to the position.
fn bound(&self) -> BoundType
Returns the accuracy of the assigned value.
fn depth(&self) -> Depth
Returns the search depth for the assigned value.
fn set_move_digest(self, move_digest: MoveDigest) -> Self
Consumes the instance and returns a new instance with updated best/refutation move digest.
fn move_digest(&self) -> MoveDigest
Returns the best/refutation move digest assigned to the
position, or MoveDigest::invalid()
if no move is available.
Provided Methods
fn set_static_eval(self, static_eval: Value) -> Self
Consumes the instance and returns a new instance with updated static evaluation.
Important note: This method will do nothing if the underlying memory structure has no field allotted for static evaluation.
fn static_eval(&self) -> Value
Returns the static evaluation assigned to the position, or
VALUE_UNKNOWN
.
fn importance(&self) -> i16
Returns the relative importance of the entry.
Transposition tables may use this method to improve their
record replacement strategy. Normally, when possible, entries
with lower importance
will be replaced before entries with
higher importance
. Therefore this method should try to
return higher values for entries that are move likely to save
CPU work in the future. For example, positions analyzed to a
higher depth are probably more "important" than those analyzed
to a lower depth.
Implementors
impl TtableEntry for StdTtableEntry