mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
ChessEngine: Don't throw away useful branches from last tree
Computation from last turn might have produced some nodes that are still accurate. Keeping them should make the engine a bit smarter.
This commit is contained in:
parent
351fc0cce2
commit
d5979516b4
4 changed files with 52 additions and 7 deletions
|
@ -20,6 +20,7 @@ public:
|
|||
};
|
||||
|
||||
MCTSTree(Chess::Board const& board, MCTSTree* parent = nullptr);
|
||||
MCTSTree(MCTSTree&&);
|
||||
|
||||
MCTSTree& select_leaf();
|
||||
MCTSTree& expand();
|
||||
|
@ -28,7 +29,11 @@ public:
|
|||
void apply_result(int game_score);
|
||||
void do_round();
|
||||
|
||||
Chess::Move best_move() const;
|
||||
Optional<MCTSTree&> child_with_move(Chess::Move);
|
||||
|
||||
MCTSTree& best_node();
|
||||
|
||||
Chess::Move last_move() const;
|
||||
double expected_value() const;
|
||||
double uct(Chess::Color color) const;
|
||||
bool expanded() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue