Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • francesco-bariatti/pingouins
  • Samuel.Felton/pingouins
  • Lucas.Clement/pingouins
3 results
Show changes
Showing
with 10 additions and 10 deletions
File moved
File moved
File moved
File moved
#include "mcts_two_players.hpp"
#include "test_mcts_two_players.hpp"
#include "connect4.hpp"
#include <iostream>
#include <iomanip>
#include <map>
......@@ -131,7 +130,7 @@ namespace mcts
// c4.set_state(state);
// openings_.update(c4, moves, v);
// c4.set_state(state);
// for (uint16_t m : moves)
// for (uint16_t m : moves)
// {
// c4.play(m);
// v = -v;
......@@ -150,10 +149,10 @@ namespace mcts
// }
// cout << "number of learning examples: " << learning_examples.size() << endl;
// ofstream output("learning_examples.txt");
// for (const auto& example : learning_examples)
// for (const auto& example : learning_examples)
// {
// output << example.second.second;
// for (int index : example.first)
// for (int index : example.first)
// {
// output << " " << index << ":" << 1;
// }
......
......@@ -3,6 +3,7 @@
#include "openings.hpp"
#include "mcts_two_players.hpp"
#include "MCTS_SETTINGS.hpp"
#include <string>
#include <iostream>
#include <map>
......@@ -21,10 +22,10 @@ namespace mcts
void self_play(Game g);
void self_play(Game g, int n, bool with_openings = false);
void self_play_learn_openings(Game g, int n);
void test_openings(Game g, int nb_learning, int nb_testing);
void test_openings(Game g, int nb_learning, int nb_testing);
int select_move(Game& game);
public:
test_mcts_two_players(const Game& g);
test_mcts_two_players(const Game& g);
};
template <typename Game>
......@@ -69,7 +70,7 @@ namespace mcts
void test_mcts_two_players<Game>::play(Game g)
{
// ProfilerStart("theturk.prof");
auto the_turk = make_mcts_two_players(g, 5000, 0.3, 4);
auto the_turk = make_mcts_two_players(g, MCTS_TURN_TIME, 0.4, 8);
std::cout << "play one game" << std::endl;
std::cout << "who's first? (h)uman/(c)omputer ";
std::string ans;
......@@ -155,7 +156,7 @@ namespace mcts
g.set_state(state);
openings_.update(g, moves, v);
g.set_state(state);
for (std::uint16_t m : moves)
for (std::uint16_t m : moves)
{
g.play(m);
v = -v;
......@@ -174,10 +175,10 @@ namespace mcts
}
std::cout << "number of learning examples: " << learning_examples.size() << std::endl;
std::ofstream output("learning_examples.txt");
for (const auto& example : learning_examples)
for (const auto& example : learning_examples)
{
output << example.second.second;
for (int index : example.first)
for (int index : example.first)
{
output << " " << index << ":" << 1;
}
......
File moved
File moved
File moved
File moved
File moved
File moved