diff options
author | Andreas Kling <kling@serenityos.org> | 2021-01-09 13:44:11 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-09 14:03:06 +0100 |
commit | 9d6198b6834781666203dcbb61090344c29e08d6 (patch) | |
tree | 046de5163f29d6939b6ac3c7f605b90c73f483e6 /Services/ChessEngine | |
parent | 30ef10a5b9a668942a0807df39067a637fdb6552 (diff) | |
download | serenity-9d6198b6834781666203dcbb61090344c29e08d6.zip |
Everywhere: Colour => Color
The system language is US English. :^)
Diffstat (limited to 'Services/ChessEngine')
-rw-r--r-- | Services/ChessEngine/MCTSTree.cpp | 6 | ||||
-rw-r--r-- | Services/ChessEngine/MCTSTree.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Services/ChessEngine/MCTSTree.cpp b/Services/ChessEngine/MCTSTree.cpp index 1724f7acd8..dc195089fe 100644 --- a/Services/ChessEngine/MCTSTree.cpp +++ b/Services/ChessEngine/MCTSTree.cpp @@ -131,7 +131,7 @@ void MCTSTree::do_round() Chess::Move MCTSTree::best_move() const { - int score_multiplier = (m_board.turn() == Chess::Colour::White) ? 1 : -1; + int score_multiplier = (m_board.turn() == Chess::Color::White) ? 1 : -1; Chess::Move best_move = { { 0, 0 }, { 0, 0 } }; double best_score = -double(INFINITY); @@ -156,13 +156,13 @@ double MCTSTree::expected_value() const return double(m_white_points) / m_simulations; } -double MCTSTree::uct(Chess::Colour colour) const +double MCTSTree::uct(Chess::Color color) const { // UCT: Upper Confidence Bound Applied to Trees. // Kocsis, Levente; Szepesvári, Csaba (2006). "Bandit based Monte-Carlo Planning" // Fun fact: Szepesvári was my data structures professor. - double expected = expected_value() * ((colour == Chess::Colour::White) ? 1 : -1); + double expected = expected_value() * ((color == Chess::Color::White) ? 1 : -1); return expected + m_exploration_parameter * sqrt(log(m_parent->m_simulations) / m_simulations); } diff --git a/Services/ChessEngine/MCTSTree.h b/Services/ChessEngine/MCTSTree.h index 857a4c4110..0ae68eae8f 100644 --- a/Services/ChessEngine/MCTSTree.h +++ b/Services/ChessEngine/MCTSTree.h @@ -49,7 +49,7 @@ public: Chess::Move best_move() const; double expected_value() const; - double uct(Chess::Colour colour) const; + double uct(Chess::Color color) const; bool expanded() const; EvalMethod eval_method() const { return m_eval_method; } |