min_arena_depth_sub -> min_arena_depth
This commit is contained in:
parent
19b5b856db
commit
ed739c7f64
@ -7,7 +7,7 @@ use othello::{
|
|||||||
fn extend_layers_no_pruning(depth: usize, arena_size: usize) -> usize {
|
fn extend_layers_no_pruning(depth: usize, arena_size: usize) -> usize {
|
||||||
let config = FutureMoveConfig {
|
let config = FutureMoveConfig {
|
||||||
max_depth: depth,
|
max_depth: depth,
|
||||||
min_arena_depth_sub: 0,
|
min_arena_depth: 0,
|
||||||
top_k_children: 5,
|
top_k_children: 5,
|
||||||
up_to_minus: 4,
|
up_to_minus: 4,
|
||||||
max_arena_size: arena_size,
|
max_arena_size: arena_size,
|
||||||
|
|||||||
@ -26,10 +26,8 @@ pub struct FutureMoveConfig {
|
|||||||
/// Max depth of that we should try and traverse
|
/// Max depth of that we should try and traverse
|
||||||
pub max_depth: usize,
|
pub max_depth: usize,
|
||||||
|
|
||||||
/// subtract this value from FutureMove.max_depth
|
/// the min depth an arena should fill for pruning to happen
|
||||||
/// and that would be the min depth an arena should fill for
|
pub min_arena_depth: usize,
|
||||||
/// pruning to happen
|
|
||||||
pub min_arena_depth_sub: usize,
|
|
||||||
|
|
||||||
/// when pruning, keep the top_k # of children
|
/// when pruning, keep the top_k # of children
|
||||||
pub top_k_children: usize,
|
pub top_k_children: usize,
|
||||||
@ -357,9 +355,7 @@ impl FutureMoves {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn prune_bad_children(&mut self) {
|
fn prune_bad_children(&mut self) {
|
||||||
if self.config.max_depth > (self.current_depth + self.config.min_arena_depth_sub)
|
if self.current_depth < self.config.min_arena_depth || self.config.do_not_prune {
|
||||||
|| self.config.do_not_prune
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,7 +462,7 @@ mod tests {
|
|||||||
|
|
||||||
const FUTURE_MOVES_CONFIG: FutureMoveConfig = FutureMoveConfig {
|
const FUTURE_MOVES_CONFIG: FutureMoveConfig = FutureMoveConfig {
|
||||||
max_depth: 3, // we want great-grand children for traversing moves
|
max_depth: 3, // we want great-grand children for traversing moves
|
||||||
min_arena_depth_sub: 0,
|
min_arena_depth: 0,
|
||||||
top_k_children: 1,
|
top_k_children: 1,
|
||||||
up_to_minus: 0,
|
up_to_minus: 0,
|
||||||
max_arena_size: 100,
|
max_arena_size: 100,
|
||||||
|
|||||||
@ -14,7 +14,7 @@ fn main() {
|
|||||||
Piece::Black,
|
Piece::Black,
|
||||||
FutureMoveConfig {
|
FutureMoveConfig {
|
||||||
max_depth: 20,
|
max_depth: 20,
|
||||||
min_arena_depth_sub: 14,
|
min_arena_depth: 14,
|
||||||
top_k_children: 2,
|
top_k_children: 2,
|
||||||
up_to_minus: 10,
|
up_to_minus: 10,
|
||||||
max_arena_size: 50_000_000,
|
max_arena_size: 50_000_000,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user