[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnubg] Re: Identical dices in GNU
From: |
Olivier Baur |
Subject: |
Re: [Bug-gnubg] Re: Identical dices in GNU |
Date: |
Mon, 7 Jul 2003 11:38:03 +0200 |
Le samedi, 28 juin 2003, à 00:06 Europe/Paris, Øystein Johansen a écrit
:
Peter O Lura wrote:
When I play against GNU, sometimes 2 games in a row got identical
dices. Is
there something I can do with my settings to avoid this?
If the dice generator is already set to Mersenne Twister, this is a
bug! And I'm very sorry, I can't explain this bug. Somehow the seed
gets set back to the same value after a game. How is that possible?
The problem appears when you perform rollouts before starting a new
game -- perhaps, as I do, when analysing a match just played against
gnubg, and rolling out some moves afterwards. When you start your next
game against gnubg, and if you have performed n 36-game rollouts while
analysing your previous match, your RNG state for the next match will
be: <rollout-starting-seed> + 36*<n> steps; and you will get the same
dice as in any previous game that you would have played after having
performed n rollouts before...
The solution I have found: re-init the RNG with a random seed after
each rollout, in rollout.c: RolloutGeneral ().
(I've added InitRNG there rather than in "New Game / Match / Session",
as the user might want to rollout some moves while playing)
Changes committed to the CVS.
-- Olivier
PS: BTW, when I commited the changes, here the output I got from cvs:
Checking in Makefile.in;
/cvsroot/gnubg/gnubg/Makefile.in,v <-- Makefile.in
new revision: 1.115; previous revision: 1.114
done
Checking in configure;
/cvsroot/gnubg/gnubg/configure,v <-- configure
new revision: 1.98; previous revision: 1.97
done
Checking in rollout.c;
/cvsroot/gnubg/gnubg/rollout.c,v <-- rollout.c
new revision: 1.106; previous revision: 1.105
done
How come Makefile.in and configure are committed to the CVS too, as
they are created during the build process?
- Re: [Bug-gnubg] Re: Identical dices in GNU,
Olivier Baur <=