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/MCTSTree.cpp | |
parent | 30ef10a5b9a668942a0807df39067a637fdb6552 (diff) | |
download | serenity-9d6198b6834781666203dcbb61090344c29e08d6.zip |
Everywhere: Colour => Color
The system language is US English. :^)
Diffstat (limited to 'Services/ChessEngine/MCTSTree.cpp')
-rw-r--r-- | Services/ChessEngine/MCTSTree.cpp | 6 |
1 files changed, 3 insertions, 3 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); } |