diff --git a/cpp/src/model/ais/v1_simple.cpp b/cpp/src/model/ais/v1_simple.cpp index 52342b5..74944a3 100644 --- a/cpp/src/model/ais/v1_simple.cpp +++ b/cpp/src/model/ais/v1_simple.cpp @@ -1,30 +1,23 @@ #include "../pieces/piece.hpp" -#include "../utils/threadpool.hpp" #include "ai.hpp" -#include static int INFINITY = std::numeric_limits::max(); int position_counter; Move ai::v1_simple::_search(const Board& b) { - ThreadPool pool(std::thread::hardware_concurrency()); - std::vector moves = b.all_legal_moves(); - std::map> futures; - for (const Move& move : moves) { - Board tmp_board = b.make_move(move); - futures.insert({move, pool.enqueue([&, tmp_board]() { - return _search(tmp_board, 3); - })}); - } + position_counter = 0; Move best_move; int best_eval = -INFINITY; - for (auto& [move, future] : futures) { - int eval = future.get(); + int counter = 0; + for (const auto& move : moves) { + Board tmp_board = b.make_move(move); + int eval = _search(tmp_board, 3); + counter++; if (!am_white) eval *= -1; if (eval > best_eval) {