Moteur : chances de gagner le match (table de gnubg), export SGF d'un match entier
Commande mwc d'engine-cli et engine_match_chances_of : chances au score (getMEAtScore) et conversion d'une équité (eq2mwc), comparées à gnubg de bureau. Export d'un match entier en SGF, relu par gnubg (load match). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ee661661fd
commit
f9b8663afb
@@ -838,6 +838,32 @@ engine_match_after_game(const char *match_id, int winner, int points,
|
||||
return ENGINE_OK;
|
||||
}
|
||||
|
||||
/* --------------------------------------- Chances de gagner le match */
|
||||
|
||||
engine_status
|
||||
engine_match_chances_of(const char *match_id, float equity, engine_match_chances *chances)
|
||||
{
|
||||
engine_match m;
|
||||
cubeinfo cube;
|
||||
engine_status status;
|
||||
|
||||
if (engine_state != READY)
|
||||
return ENGINE_ERROR_NOT_INITIALISED;
|
||||
status = engine_decode_match(match_id, &m);
|
||||
if (status != ENGINE_OK)
|
||||
return status;
|
||||
if (m.match_length == 0
|
||||
|| SetCubeInfo(&cube, m.cube_value, m.cube_owner, m.player_on_roll, m.match_length,
|
||||
m.score, m.crawford, m.jacoby, DEFAULT_BEAVERS, VARIATION_STANDARD) != 0)
|
||||
return ENGINE_ERROR_MATCH_ID;
|
||||
chances->at_score = getMEAtScore(m.score[0], m.score[1], m.match_length, m.player_on_roll,
|
||||
m.crawford, aafMET, aafMETPostCrawford);
|
||||
chances->mwc = eq2mwc(equity, &cube);
|
||||
/* analysis.c, updateStatcontext : « eq2mwc(rSkill, &ci) - eq2mwc(0.0f, &ci) ». */
|
||||
chances->loss = eq2mwc(equity, &cube) - eq2mwc(0.0f, &cube);
|
||||
return ENGINE_OK;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- Analyse d'une décision de videau */
|
||||
|
||||
/* Le plus petit de deux nombres. */
|
||||
|
||||
Reference in New Issue
Block a user