Make --num control the number of play games, not just training
--num was declared as "Number of games to play" but the play() call used a hardcoded 10. Also give --num an int type so it works when passed on the CLI (range() would otherwise crash on the raw string), and make --verbose a store_true flag. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PQS7ZHqxQfy5DhKcz2gHau
This commit is contained in:
+3
-3
@@ -59,9 +59,9 @@ def play(player_provider: PlayerProvider, k_max=10000, with_debug=False):
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--verbose", default=False, help="Be verbose")
|
||||
parser.add_argument("--verbose", default=False, action='store_true', help="Be verbose")
|
||||
parser.add_argument("--train", default=False, help="Train before play")
|
||||
parser.add_argument("--num", default=5, help="Number of games to play")
|
||||
parser.add_argument("--num", default=5, type=int, help="Number of games to play")
|
||||
parser.add_argument("--human", default=False, help="X-player is human")
|
||||
parser.add_argument("--load", default=True, help="Load experience from previous trainings")
|
||||
args = parser.parse_args()
|
||||
@@ -104,5 +104,5 @@ if __name__ == '__main__':
|
||||
else:
|
||||
pp = PlayerProvider(p_mx, p_mo)
|
||||
|
||||
play(pp, 10, args.verbose)
|
||||
play(pp, N, args.verbose)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user