mjx-project / mjx

Mjx: A framework for Mahjong AI research
https://colab.research.google.com/drive/1m1wOT_K2YFtuV6IO7VgWk4ilVhTKqRFU?usp=sharing
MIT License
171 stars 19 forks source link

IsGameOverがtrueを返すのに、jsonに終局とセットされていない半荘が生成されたりする #428

Open sotetsuk opened 4 years ago

sotetsuk commented 4 years ago
{"playerIds":["agent01","agent02","agent03","agent04"],"initScore":{"round":7,"ten":[17000,36400,11900,34700]},"doras":[126],"eventHistory":{"events":[{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_NORTH","tile":130},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":119},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":117},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":34},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":133},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":114},{"type":"EVENT_TYPE_PON","who":"ABSOLUTE_POS_INIT_NORTH","open":43529},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":33},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":135},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_SOUTH","tile":121},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":69},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":17},{},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","tile":22},{"type":"EVENT_TYPE_CHI","who":"ABSOLUTE_POS_INIT_SOUTH","open":11535},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":112},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_WEST","tile":127},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":104},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":68},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":24},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":91},{"type":"EVENT_TYPE_CHI","who":"ABSOLUTE_POS_INIT_NORTH","open":53487},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":102},{},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","tile":19},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":103},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_WEST","tile":31},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_NORTH","tile":111},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":57},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_SOUTH","tile":99},{"type":"EVENT_TYPE_CHI","who":"ABSOLUTE_POS_INIT_WEST","open":61759},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":107},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":58},{},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","tile":36},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_SOUTH","tile":118},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":97},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_NORTH","tile":108},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":51},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_SOUTH","tile":120},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_WEST","tile":95},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_NORTH","tile":109},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":48},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":20},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":76},{"type":"EVENT_TYPE_RON","who":"ABSOLUTE_POS_INIT_NORTH","tile":76}]},"wall":[68,119,61,10,16,66,13,103,101,74,52,73,86,33,64,17,2,57,135,114,65,70,24,117,42,106,44,69,102,83,43,115,4,11,82,87,3,7,59,72,18,107,34,21,133,113,104,58,78,112,63,85,130,51,49,91,47,89,60,121,97,93,22,127,39,1,75,76,19,20,31,111,48,99,67,36,118,37,108,0,120,95,109,77,80,56,6,9,81,94,5,90,12,8,129,123,105,35,15,128,92,38,62,79,124,30,45,28,40,88,29,84,46,54,25,98,132,110,122,50,26,32,14,96,134,71,131,100,53,23,126,116,55,125,27,41],"uraDoras":[116],"privateInfos":[{"initHand":[68,119,61,10,2,57,135,114,4,11,82,87,78],"draws":[51,89,60,22,1,19,48,36,0,77]},{"who":"ABSOLUTE_POS_INIT_SOUTH","initHand":[16,66,13,103,65,70,24,117,3,7,59,72,112],"draws":[49,121,75,20,99,118,120,80]},{"who":"ABSOLUTE_POS_INIT_WEST","initHand":[101,74,52,73,42,106,44,69,18,107,34,21,63],"draws":[91,97,127,76,31,37,95,56]},{"who":"ABSOLUTE_POS_INIT_NORTH","initHand":[86,33,64,17,102,83,43,115,133,113,104,58,85],"draws":[130,47,93,39,111,67,108,109]}],"terminal":{"finalScore":{"round":7,"ten":[17000,36400,10400,36200]},"wins":[{"who":"ABSOLUTE_POS_INIT_NORTH","fromWho":"ABSOLUTE_POS_INIT_WEST","closedTiles":[39,43,47,64,67,76,83,86],"opens":[53487,43529],"winTile":76,"fu":30,"ten":1500,"tenChanges":[0,0,-1500,1500],"yakus":[15],"fans":[1]}]}}

トップと200点差の負けなので、続くはずだが。。。

別のときにも出てない

{"playerIds":["agent01","agent02","agent03","agent04"],"initScore":{"round":6,"ten":[35400,12900,28200,23500]},"doras":[57],"eventHistory":{"events":[{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":114},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":115},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":130},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":116},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_WEST","tile":108},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":109},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":106},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":36},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":118},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":127},{},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","tile":121},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":100},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":77},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_NORTH","tile":119},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":99},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_RIICHI","who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_SOUTH","tile":87},{"type":"EVENT_TYPE_RIICHI_SCORE_CHANGE","who":"ABSOLUTE_POS_INIT_SOUTH"},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_WEST","tile":76},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_NORTH","tile":75},{},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","tile":33},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_SOUTH","tile":48},{"type":"EVENT_TYPE_CHI","who":"ABSOLUTE_POS_INIT_WEST","open":29063},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_WEST","tile":69},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":7},{},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","tile":107},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_SOUTH","tile":38},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_WEST","tile":65},{"who":"ABSOLUTE_POS_INIT_NORTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_NORTH","tile":124},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":39},{"who":"ABSOLUTE_POS_INIT_SOUTH"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_SOUTH","tile":45},{"who":"ABSOLUTE_POS_INIT_WEST"},{"type":"EVENT_TYPE_DISCARD_DRAWN_TILE","who":"ABSOLUTE_POS_INIT_WEST","tile":93},{"type":"EVENT_TYPE_CHI","who":"ABSOLUTE_POS_INIT_NORTH","open":58767},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","who":"ABSOLUTE_POS_INIT_NORTH","tile":53},{},{"type":"EVENT_TYPE_DISCARD_FROM_HAND","tile":31},{"type":"EVENT_TYPE_RON","who":"ABSOLUTE_POS_INIT_SOUTH","tile":31}]},"wall":[135,56,130,60,87,85,100,80,52,2,11,77,35,26,105,41,22,99,84,10,24,64,21,78,3,44,92,118,94,29,53,127,46,132,47,106,90,12,116,36,114,16,101,14,25,109,42,103,83,15,69,115,63,86,31,88,108,7,8,70,97,23,121,13,55,119,39,62,76,75,33,48,96,107,38,65,124,134,45,93,50,67,102,4,40,34,72,89,74,71,104,20,58,110,79,17,32,19,122,68,113,112,1,73,61,128,49,66,37,117,5,18,0,111,27,126,54,91,82,59,123,133,81,131,6,43,95,120,9,125,57,98,51,28,30,129],"uraDoras":[98],"privateInfos":[{"initHand":[135,56,130,60,22,99,84,10,46,132,47,106,83],"draws":[31,8,121,39,33,107,134,50]},{"who":"ABSOLUTE_POS_INIT_SOUTH","initHand":[87,85,100,80,24,64,21,78,90,12,116,36,15],"draws":[88,70,13,62,48,38,45]},{"who":"ABSOLUTE_POS_INIT_WEST","initHand":[52,2,11,77,3,44,92,118,114,16,101,14,69],"draws":[63,108,97,55,76,65,93]},{"who":"ABSOLUTE_POS_INIT_NORTH","initHand":[35,26,105,41,94,29,53,127,25,109,42,103,115],"draws":[86,7,23,119,75,96,124]}],"terminal":{"finalScore":{"round":6,"ten":[30200,18100,28200,23500]},"wins":[{"who":"ABSOLUTE_POS_INIT_SOUTH","closedTiles":[12,13,15,21,24,31,62,64,70,78,80,85,88,90],"winTile":31,"fu":40,"ten":5200,"tenChanges":[-5200,6200,0,0],"yakus":[1,52,53,54],"fans":[1,1,0,1]}]}}
sotetsuk commented 4 years ago

まずはこれの調査。オーラスのmjprotoだけ出力してみて、例えば1000試合してみて、grep isGameOver | wc -l が1000になっているか?

sotetsuk commented 4 years ago

これはassertionを追加することにした。