deal in probability, not in repetition

This commit is contained in:
Barak Michener 2014-08-04 15:34:53 -04:00
parent 452769a918
commit 12316a9238
3 changed files with 97 additions and 136 deletions

16
tim.py
View file

@ -9,8 +9,7 @@ from models.default_model import DefaultModel
from game_evaluator import DeceptionGame, AvalonGame
def repl_report(report, namemap, ngood):
def repl_report(report, top_k, namemap, ngood):
sort_order = sorted(
[(report[i]["side"].get(True, 0.0), i)
for i in range(len(report))],
@ -40,7 +39,9 @@ def repl_report(report, namemap, ngood):
print(row)
still_good += 1
for prob, deal in top_k:
print prob
print deal
def display_statement(statement, namemap):
out = ""
@ -168,15 +169,18 @@ def main():
if len(command_list) > 1:
times = int(command_list[1])
game.eval(times, quick=True)
repl_report(game.report(), namemap, game.n_good)
players, top_k = game.report()
repl_report(players, top_k, namemap, game.n_good)
elif command == "fulleval":
times = 200 / (game.n_players - 4) * 2
if len(command_list) > 1:
times = int(command_list[1])
game.eval(times)
repl_report(game.report(), namemap, game.n_good)
players, top_k = game.report()
repl_report(players, top_k, namemap, game.n_good)
elif command == "report":
repl_report(game.report(), namemap, game.n_good)
players, top_k = game.report()
repl_report(players, top_k, namemap, game.n_good)
elif command == "save":
if len(command_list) < 2:
print(Fore.RED + "Need an output file")