118
Recherche arborescente Monte-Carlo
5.9.6 RAVE
class NoeudRave {
public :
fl oat sommeScore [Taille + 2) [Taille + 2];
int nbPlayoutsCoup [Taille + 2) [Taille + 2];
unsigned long long hash ;
int abscisse , ordonnee ;
NoeudRave * fi ls [Taille + 2) [Taille + 2];
fi o a t sommeScoreAMAF [ Ta i 11 e + 2] [ Ta il 1 e + 2] ;
int nbPlayoutsCoupAMAF [Taille + 2 ) [Taille + 2) ;
void in i t () {
abscisse = O;
ordonnee = 0;
}
for ( i n t i = 0 ; i <= T a i 11 e ; i + +)
for (int j = O; j <= Taille ; j++) {
somme Score [ i ] [ j ] = 0;
nbPlayoutsCoup [ i] [ j] = 0;
}
fi ls [i] [j ] = NULL ;
sommeScoreAMAF [ i ] [ j ] = 0;
nbPlayoutsCoupAMAF [ i] [ j ] = 0;
fl oat moyenne ( int profondeur) {
int nb = 0;
fi o a t somme = 0 . 0 ;
for (int i = O; i <= Taille ; i++)
for (int j = O; j <= Taille ; j++)
if (profondeur == 0) {
}
nb += nbPlayoutsCoup [ i] [ j];
somme += sommeScore [ i ] [ j ] ;
else {
}
if (fils [i] [j ] != NUL L) {
int nbPlayoutFils =
}
fi ls [i] ( j)- >nbPlayouts (pr ofondeur - l);
n b += n b P 1 a y o u t Fi 1 s ;
somme += n b P 1 a y ou t Fi 1 s *
( 1.0 -
fils [i] [j]->moyenne (profondeur - l));
if ( nb == 0)
return 0.0;
Recherche arborescente Monte-Carlo
5.9.6 RAVE
class NoeudRave {
public :
fl oat sommeScore [Taille + 2) [Taille + 2];
int nbPlayoutsCoup [Taille + 2) [Taille + 2];
unsigned long long hash ;
int abscisse , ordonnee ;
NoeudRave * fi ls [Taille + 2) [Taille + 2];
fi o a t sommeScoreAMAF [ Ta i 11 e + 2] [ Ta il 1 e + 2] ;
int nbPlayoutsCoupAMAF [Taille + 2 ) [Taille + 2) ;
void in i t () {
abscisse = O;
ordonnee = 0;
}
for ( i n t i = 0 ; i <= T a i 11 e ; i + +)
for (int j = O; j <= Taille ; j++) {
somme Score [ i ] [ j ] = 0;
nbPlayoutsCoup [ i] [ j] = 0;
}
fi ls [i] [j ] = NULL ;
sommeScoreAMAF [ i ] [ j ] = 0;
nbPlayoutsCoupAMAF [ i] [ j ] = 0;
fl oat moyenne ( int profondeur) {
int nb = 0;
fi o a t somme = 0 . 0 ;
for (int i = O; i <= Taille ; i++)
for (int j = O; j <= Taille ; j++)
if (profondeur == 0) {
}
nb += nbPlayoutsCoup [ i] [ j];
somme += sommeScore [ i ] [ j ] ;
else {
}
if (fils [i] [j ] != NUL L) {
int nbPlayoutFils =
}
fi ls [i] ( j)- >nbPlayouts (pr ofondeur - l);
n b += n b P 1 a y o u t Fi 1 s ;
somme += n b P 1 a y ou t Fi 1 s *
( 1.0 -
fils [i] [j]->moyenne (profondeur - l));
if ( nb == 0)
return 0.0;
