202
Méthodes de Monte-Carlo pour le s jeux à un joueur
}
}
}
}
Problem p = pb;
p. playMove ( nestedMoves [ n] [ i ]) ;
scoreRollout = nestedRollout (p, n - 1);
if ( scoreRollout > bestScore) {
}
bestScore = scoreRollout;
bestMove = nestedMoves [ n] [ i ] ;
scoreBestRollout [n] = bestScore;
IengthBestRollout [n] = p. IengthVariation;
for (int i = O; i < p. lengthVariation; i++)
bestRollout [n] [i] =p . variation [i] ;
if (n > 0) {
}
for (int t = O;
< n - 1; t++)
cout << "\ t";
cout << "n._.= .... .. " << n << ",._.progres .... ..
= .... .. " <<
pb . lengthVariation << ",._.le ngth._.= .... .. " <<
IengthBestRollout [n] << ",._.score._.= .... .. " <<
scoreBestRollout [n] << ",._.nbMoves .... ..
= .... .. " <<
pb . nbMoves << "\ n";
pb . playMove ( bestMove );
pb . findMoves (ta bu );
for (int i = O; i < pb . nbMoves; i++)
nestedMoves [ n] [ i] = moves [ i ] ;
return pb . score;
int main ( int argc , char ** argv ) {
Jo ad (20 , "problems . tx t");
}
for ( int pb = 0; pb < 20; pb++ ) {
Problem p = problem [ pb ];
nestedRollout (p , 2);
}
cout << end!;
if (p. color [ MaxSize * MaxSize - MaxSize ] -- 9)
cout << "cleared !\ n";
cout << "score._.(" << pb << ") .... ..
= .... .. " <<
p. score << "\ n\n";
Précédent

- 216/256

Suivant