Skip to content
Snippets Groups Projects
Commit 304d3fb5 authored by Pizon Antoine's avatar Pizon Antoine
Browse files

Changes to movement freedom heuristic

parent 910ba2b9
No related branches found
No related tags found
No related merge requests found
ai_vs_ai=1
ai_think_time=5000
ai_vs_ai_game_count=100
heuristic_ai_1=direction_freedom
heuristic_ai_1=movement_freedom
heuristic_ai_2=default
send_game_to_gui=1
......@@ -15,7 +15,7 @@ namespace mcts
std::shared_ptr<game::penguin> played = game::copy(game);
//TEST SOLUTION 1 (MARCHE ?)
/*
played->play(move);
game::penguin_state state = played->get_state();
......@@ -31,7 +31,7 @@ namespace mcts
float res = -(nb_moves_r - nb_moves_b)/MAX_NB_MOVES;
return res;
*/
//TEST SOLUTION 2 (MARCHE ?)
/*
......@@ -55,34 +55,48 @@ namespace mcts
return res;
*/
//TEST SOLUTION 3 (MARCHE PAS, DONNE NB MOVES DU BLEU)
//TEST SOLUTION 3 (MARCHE ?)
/*
played->play(move);
float nb_moves = (float)played->number_of_moves();
game::penguin_state state = played->get_state();
uint32_t* penguins = state.peng_red;
float nb_moves = 0;
for(int i=0; i< 4; i++) {
nb_moves += PENGUIN_TOT_MOVES(penguins[i]);
}
float res = 2.0f*nb_moves / MAX_NB_MOVES - 1.0f;
float res = -(2.0f*nb_moves / MAX_NB_MOVES - 1.0f);
return res;
*/
//TEST SOLUTION 4 (MARCHE PAS)
//TEST SOLUTION 4 (MARCHE PAS, METHODES PRIVATE)
/*
played->play(move);
game::penguin_state state = played->get_state();
uint64_t obstacles = played->create_obstacles_bitboard();
uint32_t* penguins = state.peng_red;
float nb_moves = 0;
for(int i=0; i< 4; i++) {
nb_moves += PENGUIN_TOT_MOVES(penguins[i]);
}
float res = 2.0f*nb_moves / MAX_NB_MOVES - 1.0f;
for(int i = 0; i < 4; i++)
nb_moves += played->update_penguin_moves(&penguins[i], obstacles);
float res = -(2.0f*nb_moves / MAX_NB_MOVES - 1.0f);
return res;
*/
//TEST SOLUTION 5 (MARCHE PAS, DONNE NB MOVES DU BLEU)
/*
played->play(move);
float nb_moves = (float)played->number_of_moves();
float res = -(2.0f*nb_moves / MAX_NB_MOVES - 1.0f);
return res;
*/
}
int movement_freedom_heuristic::get_count(const game::penguin& game, uint8_t move) const
{
return 100000000;
return 50;
}
}
......@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
const mcts::penguin_heuristic& h1 = *(c.get_heuristic(1));
const mcts::penguin_heuristic& h2 = *(c.get_heuristic(2));
std::cout << "COUCOU" << std::endl;
mcts::run_test_mcts_two_players(game::penguin(true),h1,h2);
mcts::run_test_mcts_two_players(game::penguin(),h1,h2);
return 0;
}
#ifndef __MCTS_SETTINGS_HPP__
#define __MCTS_SETTINGS_HPP__
// Allocated memory for the mcts. If not enough the program may crash
#define MCTS_ALLOCATOR_SIZE 10000000U
#define MCTS_ALLOCATOR_SIZE 100000000U
// Reflection time for every turn of the mcts (in ms)
#define MCTS_TURN_TIME 5000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment