aa
This commit is contained in:
@@ -13,7 +13,7 @@ pub struct ComplexAgent {
|
||||
impl ComplexAgent {
|
||||
pub const fn new(color: Piece) -> Self {
|
||||
const CONFIG: FutureMoveConfig = FutureMoveConfig {
|
||||
max_depth: 9,
|
||||
max_depth: 10,
|
||||
start_pruning_at_minus: 4,
|
||||
top_k_children: 2,
|
||||
up_to_mod: 4,
|
||||
|
||||
@@ -263,14 +263,16 @@ impl FutureMoves {
|
||||
/// Returns a boolean, `true` if the operation was successful, false if not
|
||||
#[must_use = "You must check if the root was properly set"]
|
||||
pub fn update_root_coord(&mut self, i: usize, j: usize) -> bool {
|
||||
// check to make sure current_root is some so we dont
|
||||
// have to do that in the iterator
|
||||
if self.current_root.is_none() {
|
||||
return false;
|
||||
}
|
||||
|
||||
self.arena
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find(|(_, node)| {
|
||||
node.parent == self.current_root
|
||||
&& self.current_root.is_some()
|
||||
&& node.coords() == (i, j)
|
||||
})
|
||||
.find(|(_, node)| node.parent == self.current_root && node.coords() == (i, j))
|
||||
.map(|x| x.0)
|
||||
// do raw set so we can prune it on the next move (in `update`)
|
||||
.inspect(|&root| self.update_root_idx_raw(root))
|
||||
|
||||
@@ -54,7 +54,6 @@ impl Move {
|
||||
self_value: 0,
|
||||
};
|
||||
m.self_value = m.compute_self_value(agent_color);
|
||||
m.value = Some(m.self_value as i128);
|
||||
m
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ pub mod repr;
|
||||
fn main() {
|
||||
let player1 = complexagent::ComplexAgent::new(Piece::Black);
|
||||
// let player2 = complexagent::ComplexAgent::new(Piece::White);
|
||||
// let player2 = agent::ManualAgent::new(Piece::White);
|
||||
let player2 = agent::RandomAgent::new(Piece::White);
|
||||
let player2 = agent::ManualAgent::new(Piece::White);
|
||||
// let player2 = agent::RandomAgent::new(Piece::White);
|
||||
let mut game = Game::new(Box::new(player1), Box::new(player2));
|
||||
game.game_loop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user