Trait alcibiades::HashTableEntry
[−]
[src]
pub trait HashTableEntry: Copy + Send { fn new(value: Value,
bound: BoundType,
depth: Depth,
move_digest: MoveDigest)
-> Self; fn with_static_eval(value: Value,
bound: BoundType,
depth: Depth,
move_digest: MoveDigest,
static_eval: Value)
-> Self; fn value(&self) -> Value; fn bound(&self) -> BoundType; fn depth(&self) -> Depth; fn move_digest(&self) -> MoveDigest; fn static_eval(&self) -> Value; fn set_move_digest(&mut self, move_digest: MoveDigest); fn importance(&self) -> i16 { ... } }
A trait for transposition table entries.
Required Methods
fn new(value: Value,
bound: BoundType,
depth: Depth,
move_digest: MoveDigest)
-> Self
bound: BoundType,
depth: Depth,
move_digest: MoveDigest)
-> 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 depth of search. Must be betweenDEPTH_MIN
andDEPTH_MAX
.move_digest
-- Best or refutation move digest, orMoveDigest::invalid()
if no move is available.
fn with_static_eval(value: Value,
bound: BoundType,
depth: Depth,
move_digest: MoveDigest,
static_eval: Value)
-> Self
bound: BoundType,
depth: Depth,
move_digest: MoveDigest,
static_eval: Value)
-> Self
Creates a new instance.
The only difference between this function and new
is that
this function requires one additional parameter:
static_eval
-- Position's static evaluation, orVALUE_UNKNOWN
.
Important note: static_eval
will be ignored if there is
no field allotted for it in the underlying memory structure.
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 move_digest(&self) -> MoveDigest
Returns best or refutation move digest, or
MoveDigest::invalid()
if no move is available.
fn static_eval(&self) -> Value
Returns position's static evaluation, or VALUE_UNKNOWN
.
fn set_move_digest(&mut self, move_digest: MoveDigest)
Sets a new best or refutation move digest.
Transposition tables may use this method when they overwrite an old record for the same position, and want to keep the move from the old record.
Provided Methods
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 HashTableEntry for StdHashTableEntry