gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] interfacing to gnugo


From: Bjørn Magnus Mathisen
Subject: [gnugo-devel] interfacing to gnugo
Date: Sun, 15 Apr 2007 04:32:11 -0400

hi

I'm writing a program that interfaces against gnugo, it does this by including gnugo.h. this is a neuroevolution program that plays ANNs against gnugo, so i want the games to as fast as possible and to be deterministic in one run. My program
is also written in c++ so i'm loading gnugo.h as a extern..

Currently i initialize the engine in this way:
    init_gnugo(mem,1);
    gnugo_clear_board(bsize);
    set_level(lvl);

i generate moves from gnugo in this way:
      int resign;
      float move_value;
      int move = genmove(to_move, &move_value, &resign);
      allowed = is_allowed_move(move, to_move);
      if(!allowed || resign || is_pass(move) ){
        setPass(first);
        return;
      }else{
        gnugo_play_move(move, to_move);
}

the way the network puts a stone:
    int move = POS(pos[0],pos[1]);

if(is_allowed_move(move, to_move) && move!= NO_MOVE && !is_pass (move)){
      gnugo_play_move(move, to_move);
    }else
      return false;

etc..

I also reset between games using gnugo_clear_board() .
I resently had some assertion failures with version 3.6, so I upgraded
to 3.7(CVS), which resulted in me having to reprogram my interfacing,
as the functions have changed. Looking at play_ascii.c helped in alot there :)

My questions however is: Is gnugo deterministic intra run with my static seed, and is it
deterministic across runs?
And is there a way i can calculate the maximum and minimum output of the gnugo_estimate_score function so that i can normalize it? :) It also gives the score for white, so in my case where my networks mostly plays as black i currently subtract the output from some bigger number
to get a bigger number when white is at a disadvantage.
Also, do you have any tips as to make my code namespace separate from gnugo's ? As i would
not want my variable names and or asignments to influence gnugo :)
I'm really not used to the c way of programming, a OO-programmer by upbringing :)
Finally, is my method of resetting between games sufficient ? :)


This is part of my master thesis in AI, please feel free to send me questions if you are interested in more details,
but the thesis will (hopefully) be published this spring :)

Sorry for the long email. thanks in advance!

regards
Bjørn Magnus Mathisen





reply via email to

[Prev in Thread] Current Thread [Next in Thread]