gochatai/pachi_py/pachi/uct/uct.c
/* Kindof like uct_genmove() but just find the best candidates */
Kindof like uct_genmove() but just find the best candidates
Kindof like uct_genmove () but just find the best candidates
static void
uct_best_moves(struct engine *e, struct board *b, enum stone color)
{
	struct time_info ti = { .period = TT_NULL };
	double start_time = time_now();
	struct uct *u = e->data;
	uct_pondering_stop(u);
	if (u->t)
		reset_state(u);
	uct_genmove_setup(u, b, color);
	int base_playouts = u->t->root->u.playouts;
	int played_games = uct_search(u, b, &ti, color, u->t, false);
	coord_t best_coord;
	uct_search_result(u, b, color, u->pass_all_alive, played_games, base_playouts, &best_coord);
	if (UDEBUGL(2)) {
		double time = time_now() - start_time + 0.000001; 
		fprintf(stderr, "genmove in %0.2fs (%d games/s, %d games/s/thread)\n",
			time, (int)(played_games/time), (int)(played_games/time/u->threads));
	}
	uct_progress_status(u, u->t, color, played_games, &best_coord);
	reset_state(u);
}
static void uct_best_moves ( struct engine * e , struct board * b , enum stone color ) { struct time_info ti = { . period = TT_NULL } ; double start_time = time_now ( ) ; struct uct * u = e -> data ; uct_pondering_stop ( u ) ; if ( u -> t ) reset_state ( u ) ; uct_genmove_setup ( u , b , color ) ; int base_playouts = u -> t -> root -> u . playouts ; int played_games = uct_search ( u , b , & ti , color , u -> t , false ) ; coord_t best_coord ; uct_search_result ( u , b , color , u -> pass_all_alive , played_games , base_playouts , & best_coord ) ; if ( UDEBUGL ( 2 ) ) { double time = time_now ( ) - start_time + 0.000001 ; fprintf ( stderr , " \n " , time , ( int ) ( played_games / time ) , ( int ) ( played_games / time / u -> threads ) ) ; } uct_progress_status ( u , u -> t , color , played_games , & best_coord ) ; reset_state ( u ) ; }
Kindof like uct_genmove() but just find the best candidates
Kindof like uct_genmove () but just find the best candidates
/* Start the Monte Carlo Tree Search! */ /* avoid divide by zero */