[computer-go] libgoboard v0.97 released
Łukasz Lew
lukasz.lew at gmail.com
Mon Jan 22 09:47:33 PST 2007
Hi,
Few interesting things has happened so I decided to announce new version:
- bug-fix: komi was too big (1 point) so program as white tended to
loose by 0.5 point
- improve portability (if just "make" is not enough for You, please tell me)
- simple_playout::run is a simplest playout loop (80% performance)
You can use it as a starting point/tutorial for Your Monte-Carlo Go.
(I dare to paste the code at the end of the message)
- more convenient printing functions
- column coordinates around the board printed as letters (was numbers)
- faster RNG + more accurate performance measurement
- performance
43 kpps on 1.4 GHz
70 kpps on 2.2 GHz
will anybody send me info about 3.2 GHz?
- no more darcs repository, will publish mercurial repository soon.
Best Regards,
Łukasz Lew
---- Code of simple playout loop ---
player::t run (board_t* board, player::t first_player) {
v::t v;
bool was_pass[player::cnt];
uint move_no;
player::t act_player;
act_player = first_player;
player_for_each (pl)
was_pass [pl] = false;
move_no = 0;
do {
v = play_one (board, act_player);
was_pass [act_player] = (v == v::pass);
act_player = player::other (act_player);
move_no++;
if ((was_pass [player::black] & was_pass [player::white]) |
(move_no > max_playout_length)) break;
} while (true);
return board->winner ();
}
v::t play_one (board_t* board, player::t player) {
v::t v;
uint start;
// find random place in vector of empty vertices
start = pm::rand_int (board->empty_v_cnt);
// search for a move in start ... board->empty_v_cnt-1 interval
for (uint ev_i = start; ev_i != board->empty_v_cnt; ev_i++) {
v = board->empty_v [ev_i];
if (!board->is_eyelike (player, v) &&
board->play (player, v) != board_t::play_ss_suicide) return v;
}
// search for a move in 0 ... start interval
for (uint ev_i = 0; ev_i != start; ev_i++) {
v = board->empty_v [ev_i];
if (!board->is_eyelike (player, v) &&
board->play (player, v) != board_t::play_ss_suicide) return v;
}
board->check_no_more_legal (player); // powerfull check
return v::pass;
}
More information about the computer-go
mailing list