5.9 Corrigés des exercices
}
}
go . joue (inter , Noir );
fo r (int i = O; i < Taille + 2; i++) {
}
for (int j = O; j < Taille + 2; j++)
if (go.goban [j ] [i] == Exterieur )
else if (go.goban [j ] [i] -- Vide )
else if (go.goban [j ] [i] == Noir )
else cout << " ...., O" ;
cout << endl ;
do {
cout << "Votre...., coup...., : ...., ";
cin >> inter ._x >> inter ._y;
} while (!go.coupLegal (inter , Blanc ));
go . joue (in ter , Blanc );
int main () {
}
go . initHash ();
interface ();
S.9.3 UCB
cout
cout
cout
Intersection meilleurCoupUCB ( int couleur ) {
float sommeScore [Taille + 2) [Taille + 2] ;
int nbPiayoutsCoup [Taille + 2) [Taille + 2) ;
fo r (int i = O; i <= Taille ; i++)
for (int j = O; j <= Taille ; j++) {
sommeScore [ i ] [ j ] = 0;
nbPlayoutsCoup [ i] [j ] = O;
}
Intersection meilleurUCB (0 , 0);
for ( int p = O; p < nbPlayouts ; p++) {
fl oat meilleurScore = O;
for ( in t i = 1 ; i <= Ta i 11 e ; i + +)
for ( in t j = 1 ; j <= Ta i 11 e ; j + +) {
Intersection inter (i , j );
fl oat score = O;
if (go. coupLegal (inter , couleur ) &&
!go. oeil (inter , couleur )) {
i f ( n b P 1 a y outs Coup [ i ] [ j ] == 0)
score = 1000;
el se
score =
<<
<<
<<
Il
Il .
....,
'
+" .
....,
'
"'-'@Il;
109
sommeScore [i] [j ) / nbPlayoutsCoup [i] [j ] +
Précédent

- 123/256

Suivant