deal in probability, not in repetition
This commit is contained in:
parent
452769a918
commit
12316a9238
3 changed files with 97 additions and 136 deletions
|
|
@ -29,6 +29,7 @@ class DeceptionGame(object):
|
||||||
self.n_players = len(player_array)
|
self.n_players = len(player_array)
|
||||||
self.n_good = len([x for x in player_array if x[1] is True])
|
self.n_good = len([x for x in player_array if x[1] is True])
|
||||||
self.trace = None
|
self.trace = None
|
||||||
|
self.trace_score = 0.0
|
||||||
self.observations = []
|
self.observations = []
|
||||||
self.seen = []
|
self.seen = []
|
||||||
self.tid = 0
|
self.tid = 0
|
||||||
|
|
@ -63,7 +64,7 @@ class DeceptionGame(object):
|
||||||
|
|
||||||
def obs(deal):
|
def obs(deal):
|
||||||
if self.player_is_good(deal, player_id, None) == is_good:
|
if self.player_is_good(deal, player_id, None) == is_good:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
transaction.append(obs)
|
transaction.append(obs)
|
||||||
|
|
@ -80,7 +81,7 @@ class DeceptionGame(object):
|
||||||
rnd = round - 1
|
rnd = round - 1
|
||||||
|
|
||||||
def obs(deal):
|
def obs(deal):
|
||||||
return True
|
return 1.0
|
||||||
|
|
||||||
self.lancelots_switch_at.append(rnd)
|
self.lancelots_switch_at.append(rnd)
|
||||||
|
|
||||||
|
|
@ -96,7 +97,7 @@ class DeceptionGame(object):
|
||||||
|
|
||||||
def obs(deal):
|
def obs(deal):
|
||||||
if self.player_role(deal, player_id) == role_str:
|
if self.player_role(deal, player_id) == role_str:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
transaction.append(obs)
|
transaction.append(obs)
|
||||||
|
|
@ -200,47 +201,29 @@ class DeceptionGame(object):
|
||||||
deck = self.quick_permutations[:]
|
deck = self.quick_permutations[:]
|
||||||
else:
|
else:
|
||||||
deck = self.all_permutations[:]
|
deck = self.all_permutations[:]
|
||||||
new_deck = []
|
|
||||||
trace = {}
|
trace = {}
|
||||||
progress = progressbar.ProgressBar(
|
progress = progressbar.ProgressBar(
|
||||||
widgets=["Simulating games: ",
|
widgets=["Simulating games: ",
|
||||||
progressbar.Bar(marker="*"),
|
progressbar.Bar(marker="*"),
|
||||||
" ", progressbar.ETA()])
|
" ", progressbar.ETA()])
|
||||||
for i in progress(range(length)):
|
f_list = []
|
||||||
falses = 0
|
for obs in self.observations:
|
||||||
trues = 0
|
for tid in obs:
|
||||||
nones = 0
|
f_list.append(tid)
|
||||||
for deal in deck:
|
total_score = 0.0
|
||||||
f_list = []
|
for deal in progress(deck):
|
||||||
for obs in self.observations:
|
this_score = 1.0
|
||||||
for tid in obs:
|
for f in f_list:
|
||||||
f_list.append(tid)
|
score = f(deal)
|
||||||
is_bad = False
|
if score is None:
|
||||||
dont_copy = False
|
this_score = 0.0
|
||||||
for f in f_list:
|
break
|
||||||
out = f(deal)
|
this_score = this_score * score
|
||||||
if out is None:
|
total_score += this_score
|
||||||
is_bad = True
|
trace[deal] = this_score
|
||||||
dont_copy = True
|
|
||||||
nones += 1
|
|
||||||
break
|
|
||||||
if out is True:
|
|
||||||
trues += 1
|
|
||||||
continue
|
|
||||||
if out is False:
|
|
||||||
is_bad = True
|
|
||||||
falses += 1
|
|
||||||
break
|
|
||||||
if not is_bad:
|
|
||||||
if deal not in trace:
|
|
||||||
trace[deal] = 1
|
|
||||||
trace[deal] += 1
|
|
||||||
if not dont_copy:
|
|
||||||
new_deck.append(deal)
|
|
||||||
deck = new_deck
|
|
||||||
new_deck = []
|
|
||||||
|
|
||||||
self.trace = trace
|
self.trace = trace
|
||||||
|
self.trace_score = total_score
|
||||||
|
|
||||||
def report(self):
|
def report(self):
|
||||||
return self.get_player_data()
|
return self.get_player_data()
|
||||||
|
|
@ -251,24 +234,22 @@ class DeceptionGame(object):
|
||||||
out.append({})
|
out.append({})
|
||||||
out[i]["role"] = dd(float)
|
out[i]["role"] = dd(float)
|
||||||
out[i]["side"] = dd(float)
|
out[i]["side"] = dd(float)
|
||||||
|
top_k = [(0.0, None)] * 5
|
||||||
size = sum(self.trace.values()) * 1.0
|
|
||||||
for deal, score in self.trace.items():
|
for deal, score in self.trace.items():
|
||||||
|
weighted_score = score / self.trace_score
|
||||||
for i, card in enumerate(deal):
|
for i, card in enumerate(deal):
|
||||||
role, side = card
|
role, side = card
|
||||||
out[i]["role"][role] += (score * 1.0) / size
|
out[i]["role"][role] += weighted_score
|
||||||
out[i]["side"][side] += (score * 1.0) / size
|
out[i]["side"][side] += weighted_score
|
||||||
|
if weighted_score > top_k[-1][0]:
|
||||||
|
top_k.append((weighted_score, deal))
|
||||||
|
top_k = sorted(top_k, reverse=True)[:-1]
|
||||||
|
|
||||||
for i in range(self.n_players):
|
for i in range(self.n_players):
|
||||||
out[i]["role"] = dict(out[i]["role"])
|
out[i]["role"] = dict(out[i]["role"])
|
||||||
out[i]["side"] = dict(out[i]["side"])
|
out[i]["side"] = dict(out[i]["side"])
|
||||||
return out
|
|
||||||
|
|
||||||
def _aggregate(self, l, i):
|
return out, top_k
|
||||||
out = dd(float)
|
|
||||||
size = len(l) * 1.0
|
|
||||||
for deal in l:
|
|
||||||
out[deal[i]] += 1 / size
|
|
||||||
return dict(out)
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%d Player Game (%d constraints)" % (self.n_players,
|
return "%d Player Game (%d constraints)" % (self.n_players,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
from util import Bernoulli
|
|
||||||
|
|
||||||
|
|
||||||
# Models work like this; feel free to inherit from BaseModel to get the
|
# Models work like this; feel free to inherit from BaseModel to get the
|
||||||
# necessary helpful things.
|
# necessary helpful things.
|
||||||
#
|
#
|
||||||
|
|
@ -21,6 +18,7 @@ from util import Bernoulli
|
||||||
# * None -- This set of statements could NEVER happen, please remove them from
|
# * None -- This set of statements could NEVER happen, please remove them from
|
||||||
# consideration.
|
# consideration.
|
||||||
|
|
||||||
|
|
||||||
class BaseModel(object):
|
class BaseModel(object):
|
||||||
def __init__(self, game):
|
def __init__(self, game):
|
||||||
self.game = game
|
self.game = game
|
||||||
|
|
@ -61,39 +59,26 @@ class DefaultModel(BaseModel):
|
||||||
def __init__(self, game):
|
def __init__(self, game):
|
||||||
super(DefaultModel, self).__init__(game)
|
super(DefaultModel, self).__init__(game)
|
||||||
|
|
||||||
self.lady_will_duck = Bernoulli(0.7)
|
self.lady_will_duck = 0.7
|
||||||
self.mission_ducks_on_round = [None] * 5
|
self.mission_ducks_on_round = [0.5, 0.5, 0.5, 0.0, 0.0]
|
||||||
self.mission_ducks_on_round[0] = Bernoulli(0.5)
|
self.early_spy_duck = 0.3
|
||||||
self.mission_ducks_on_round[1] = Bernoulli(0.5)
|
self.multiple_spy_one_duck = 0.15
|
||||||
self.mission_ducks_on_round[2] = Bernoulli(0.5)
|
self.ignorance_on_round = [0.9, 0.7, 0.5, 0.3, 0.3]
|
||||||
self.early_spy_duck = Bernoulli(0.3)
|
self.spy_vote_duck_on_round = [0.9, 0.7, 0.5, 0.3, 0.3]
|
||||||
self.multiple_spy_one_duck = Bernoulli(0.15)
|
self.multiple_spy_vote_duck = 0.75
|
||||||
self.ignorance_on_round = [None] * 5
|
self.merlin_ignorance = 0.2
|
||||||
self.ignorance_on_round[0] = Bernoulli(0.9)
|
|
||||||
self.ignorance_on_round[1] = Bernoulli(0.7)
|
|
||||||
self.ignorance_on_round[2] = Bernoulli(0.5)
|
|
||||||
self.ignorance_on_round[3] = Bernoulli(0.3)
|
|
||||||
self.ignorance_on_round[4] = Bernoulli(0.3)
|
|
||||||
self.spy_vote_duck_on_round = [None] * 5
|
|
||||||
self.spy_vote_duck_on_round[0] = Bernoulli(0.9)
|
|
||||||
self.spy_vote_duck_on_round[1] = Bernoulli(0.7)
|
|
||||||
self.spy_vote_duck_on_round[2] = Bernoulli(0.5)
|
|
||||||
self.spy_vote_duck_on_round[3] = Bernoulli(0.3)
|
|
||||||
self.spy_vote_duck_on_round[4] = Bernoulli(0.3)
|
|
||||||
self.multiple_spy_vote_duck = Bernoulli(0.75)
|
|
||||||
self.merlin_ignorance = Bernoulli(0.2)
|
|
||||||
|
|
||||||
def player_sees_player_and_claims(self, p1, p2, claim, rnd):
|
def player_sees_player_and_claims(self, p1, p2, claim, rnd):
|
||||||
if self.is_good(p1, rnd) or self.is_role(p1, "Mordred"):
|
if self.is_good(p1, rnd) or self.is_role(p1, "Mordred"):
|
||||||
if self.is_good(p2, rnd) == claim:
|
if self.is_good(p2, rnd) == claim:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
if claim is True:
|
if claim is True:
|
||||||
return self.lady_will_duck.rand()
|
return self.lady_will_duck
|
||||||
if claim is False:
|
if claim is False:
|
||||||
return not self.lady_will_duck.rand()
|
return (1.0 - self.lady_will_duck)
|
||||||
|
|
||||||
def mission(self, team, fails, must_fail, rnd):
|
def mission(self, team, fails, must_fail, rnd):
|
||||||
n_actually_good_people = sum(
|
n_actually_good_people = sum(
|
||||||
|
|
@ -106,7 +91,7 @@ class DefaultModel(BaseModel):
|
||||||
if fails != 0:
|
if fails != 0:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
# There's at least one spy.
|
# There's at least one spy.
|
||||||
if fails == 0:
|
if fails == 0:
|
||||||
|
|
@ -114,12 +99,12 @@ class DefaultModel(BaseModel):
|
||||||
if must_fail:
|
if must_fail:
|
||||||
return None
|
return None
|
||||||
if n_spies > 1:
|
if n_spies > 1:
|
||||||
return not self.multiple_spy_one_duck.rand()
|
return not self.multiple_spy_one_duck
|
||||||
if rnd >= 0 and rnd < 3:
|
if rnd >= 0 and rnd < 3:
|
||||||
return self.mission_ducks_on_round[rnd].rand()
|
return self.mission_ducks_on_round[rnd]
|
||||||
elif rnd == 3:
|
elif rnd == 3:
|
||||||
# They always duck on 4
|
# They always duck on 4
|
||||||
return True
|
return 1.0
|
||||||
elif rnd == 4:
|
elif rnd == 4:
|
||||||
# They never duck on 5
|
# They never duck on 5
|
||||||
return None
|
return None
|
||||||
|
|
@ -127,23 +112,23 @@ class DefaultModel(BaseModel):
|
||||||
# One fail, one spy.
|
# One fail, one spy.
|
||||||
spy = spy_names[0]
|
spy = spy_names[0]
|
||||||
if rnd >= 0 and rnd < 3:
|
if rnd >= 0 and rnd < 3:
|
||||||
return self.mission_ducks_on_round[rnd].rand()
|
return self.mission_ducks_on_round[rnd]
|
||||||
elif rnd == 3:
|
elif rnd == 3:
|
||||||
if spy == "Oberon":
|
if spy == "Oberon":
|
||||||
return True
|
return 1.0
|
||||||
if spy == "GLance":
|
if spy == "GLance":
|
||||||
return True
|
return 1.0
|
||||||
return False
|
return 0.0
|
||||||
elif rnd == 4:
|
elif rnd == 4:
|
||||||
return True
|
return 1.0
|
||||||
elif fails < n_spies:
|
elif fails < n_spies:
|
||||||
return self.multiple_spy_one_duck.rand()
|
return self.multiple_spy_one_duck
|
||||||
elif fails > 1:
|
elif fails > 1:
|
||||||
# collision!
|
# collision!
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
return True
|
return 1.0
|
||||||
return True
|
return 1.0
|
||||||
|
|
||||||
def votes(self, team, votes, fail_req, rnd):
|
def votes(self, team, votes, fail_req, rnd):
|
||||||
for player, vote in enumerate(votes):
|
for player, vote in enumerate(votes):
|
||||||
|
|
@ -153,14 +138,14 @@ class DefaultModel(BaseModel):
|
||||||
votes, fail_req, rnd):
|
votes, fail_req, rnd):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
return False
|
return 0.0
|
||||||
else:
|
else:
|
||||||
if default_vote(self, player, team, votes,
|
if default_vote(self, player, team, votes,
|
||||||
fail_req, rnd):
|
fail_req, rnd):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
return False
|
return 0.0
|
||||||
return True
|
return 1.0
|
||||||
|
|
||||||
|
|
||||||
def default_vote(game, player, team, votes, fail_req, rnd):
|
def default_vote(game, player, team, votes, fail_req, rnd):
|
||||||
|
|
@ -168,31 +153,31 @@ def default_vote(game, player, team, votes, fail_req, rnd):
|
||||||
[int(game.is_good(x, rnd)) for x in team])
|
[int(game.is_good(x, rnd)) for x in team])
|
||||||
n_spies = len(team) - n_actually_good_people
|
n_spies = len(team) - n_actually_good_people
|
||||||
if player in team:
|
if player in team:
|
||||||
return True
|
return 1.0
|
||||||
if game.is_good(player, rnd):
|
if game.is_good(player, rnd):
|
||||||
if n_spies > fail_req - 1:
|
if n_spies > fail_req - 1:
|
||||||
# Bad Team!
|
# Bad Team!
|
||||||
if votes[player] == 1:
|
if votes[player] == 1:
|
||||||
return game.ignorance_on_round[rnd].rand()
|
return game.ignorance_on_round[rnd]
|
||||||
else:
|
else:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
# Good Team!
|
# Good Team!
|
||||||
if votes[player] == 0:
|
if votes[player] == 0:
|
||||||
return game.ignorance_on_round[rnd].rand()
|
return game.ignorance_on_round[rnd]
|
||||||
else:
|
else:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
if n_spies < fail_req:
|
if n_spies < fail_req:
|
||||||
if votes[player] == 1:
|
if votes[player] == 1:
|
||||||
return not game.spy_vote_duck_on_round[rnd].rand()
|
return not game.spy_vote_duck_on_round[rnd]
|
||||||
else:
|
else:
|
||||||
return game.spy_vote_duck_on_round[rnd].rand()
|
return game.spy_vote_duck_on_round[rnd]
|
||||||
elif n_spies == fail_req:
|
elif n_spies == fail_req:
|
||||||
return True
|
return 1.0
|
||||||
elif n_spies > fail_req:
|
elif n_spies > fail_req:
|
||||||
return game.multiple_spy_vote_duck.rand()
|
return game.multiple_spy_vote_duck
|
||||||
return True
|
return 1.0
|
||||||
|
|
||||||
|
|
||||||
def merlin_vote(model, player_id, team, votes, fail_req, r):
|
def merlin_vote(model, player_id, team, votes, fail_req, r):
|
||||||
|
|
@ -204,32 +189,28 @@ def merlin_vote(model, player_id, team, votes, fail_req, r):
|
||||||
n_spies = n_spies - 1
|
n_spies = n_spies - 1
|
||||||
|
|
||||||
if player_id in team:
|
if player_id in team:
|
||||||
return True
|
return 1.0
|
||||||
# At this point, this is the number of spies Merlin counts
|
# At this point, this is the number of spies Merlin counts
|
||||||
if n_spies == 0:
|
if n_spies == 0:
|
||||||
if votes[player_id] == 0:
|
if votes[player_id] == 0:
|
||||||
# Voted down an apparently good team. Ignore this.
|
# Voted down an apparently good team. Ignore this.
|
||||||
return True
|
return 1.0
|
||||||
if votes[player_id] == 1:
|
if votes[player_id] == 1:
|
||||||
if model.merlin_ignorance.rand():
|
return (1.0 - model.merlin_ignorance)
|
||||||
return False
|
|
||||||
return True
|
|
||||||
elif n_spies == 1:
|
elif n_spies == 1:
|
||||||
# He'll either duck or vote it down. Either is fine
|
# He'll either duck or vote it down. Either is fine
|
||||||
return True
|
return 1.0
|
||||||
elif n_spies > 1 and fail_req == 1:
|
elif n_spies > 1 and fail_req == 1:
|
||||||
# Merlin wants spies to be butting heads.
|
# Merlin wants spies to be butting heads.
|
||||||
if votes[player_id] == 1:
|
if votes[player_id] == 1:
|
||||||
# Voted down an apparently good team. Ignore this.
|
# Voted down an apparently good team. Ignore this.
|
||||||
return True
|
return 1.0
|
||||||
if votes[player_id] == 0:
|
if votes[player_id] == 0:
|
||||||
if model.merlin_ignorance.rand():
|
return model.merlin_ignorance
|
||||||
return True
|
|
||||||
return False
|
|
||||||
elif n_spies > 1 and fail_req > 1:
|
elif n_spies > 1 and fail_req > 1:
|
||||||
# Ignore the vote here
|
# Ignore the vote here
|
||||||
return True
|
return 1.0
|
||||||
return True
|
return 1.0
|
||||||
|
|
||||||
|
|
||||||
def mordred_vote(game, player_id, team, votes, fail_req, r):
|
def mordred_vote(game, player_id, team, votes, fail_req, r):
|
||||||
|
|
@ -241,30 +222,25 @@ def mordred_vote(game, player_id, team, votes, fail_req, r):
|
||||||
n_spies = n_spies - 1
|
n_spies = n_spies - 1
|
||||||
|
|
||||||
if player_id in team:
|
if player_id in team:
|
||||||
return True
|
return 1.0
|
||||||
# At this point, this is the number of spies Mordred knows.
|
# At this point, this is the number of spies Mordred knows.
|
||||||
if n_spies == 0:
|
if n_spies == 0:
|
||||||
# The chance that merlin doesn't know Mordred is 1 - Merlin's ignorance
|
# The chance that merlin doesn't know Mordred is 1 - Merlin's ignorance
|
||||||
# Read this as "if Merlin is not ignorant of my role"
|
# Read this as "if Merlin is not ignorant of my role"
|
||||||
if not game.merlin_ignorance.rand():
|
if votes[player_id] == 1:
|
||||||
if votes[player_id] == 1:
|
return game.merlin_ignorance
|
||||||
return False
|
|
||||||
else:
|
|
||||||
return True
|
|
||||||
# Merlin is ignorant...
|
|
||||||
else:
|
else:
|
||||||
# Vote it up or down, doesn't matter, both could happen
|
return 1.0
|
||||||
return True
|
|
||||||
elif n_spies == 1:
|
elif n_spies == 1:
|
||||||
# He'll either duck or vote it down. Either is fine
|
# He'll either duck or vote it down. Either is fine
|
||||||
return True
|
return 1.0
|
||||||
elif n_spies > 1:
|
elif n_spies > 1:
|
||||||
# Never vote up a team of more than one spy, unless fail_req is high
|
# Never vote up a team of more than one spy, unless fail_req is high
|
||||||
if fail_req > 1:
|
if fail_req > 1:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
return False
|
return 0.0
|
||||||
return True
|
return 1.0
|
||||||
|
|
||||||
|
|
||||||
def guen_vote(game, player_id, team, votes, fail_req, rnd):
|
def guen_vote(game, player_id, team, votes, fail_req, rnd):
|
||||||
|
|
@ -274,9 +250,9 @@ def guen_vote(game, player_id, team, votes, fail_req, rnd):
|
||||||
return default_vote(game, player_id, team, votes, fail_req, rnd)
|
return default_vote(game, player_id, team, votes, fail_req, rnd)
|
||||||
if glance in team and elance in team:
|
if glance in team and elance in team:
|
||||||
if votes[player_id] == 1:
|
if votes[player_id] == 1:
|
||||||
return False
|
return 0.0
|
||||||
else:
|
else:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
return default_vote(game, player_id, team, votes, fail_req, rnd)
|
return default_vote(game, player_id, team, votes, fail_req, rnd)
|
||||||
|
|
||||||
|
|
@ -288,9 +264,9 @@ def percy_vote(game, player_id, team, votes, fail_req, rnd):
|
||||||
return default_vote(game, player_id, team, votes, fail_req, rnd)
|
return default_vote(game, player_id, team, votes, fail_req, rnd)
|
||||||
if merlin in team and morgana in team:
|
if merlin in team and morgana in team:
|
||||||
if votes[player_id] == 1:
|
if votes[player_id] == 1:
|
||||||
return False
|
return 0.0
|
||||||
else:
|
else:
|
||||||
return True
|
return 1.0
|
||||||
else:
|
else:
|
||||||
return default_vote(game, player_id, team, votes, fail_req, rnd)
|
return default_vote(game, player_id, team, votes, fail_req, rnd)
|
||||||
|
|
||||||
|
|
|
||||||
16
tim.py
16
tim.py
|
|
@ -9,8 +9,7 @@ from models.default_model import DefaultModel
|
||||||
from game_evaluator import DeceptionGame, AvalonGame
|
from game_evaluator import DeceptionGame, AvalonGame
|
||||||
|
|
||||||
|
|
||||||
|
def repl_report(report, top_k, namemap, ngood):
|
||||||
def repl_report(report, namemap, ngood):
|
|
||||||
sort_order = sorted(
|
sort_order = sorted(
|
||||||
[(report[i]["side"].get(True, 0.0), i)
|
[(report[i]["side"].get(True, 0.0), i)
|
||||||
for i in range(len(report))],
|
for i in range(len(report))],
|
||||||
|
|
@ -40,7 +39,9 @@ def repl_report(report, namemap, ngood):
|
||||||
print(row)
|
print(row)
|
||||||
|
|
||||||
still_good += 1
|
still_good += 1
|
||||||
|
for prob, deal in top_k:
|
||||||
|
print prob
|
||||||
|
print deal
|
||||||
|
|
||||||
def display_statement(statement, namemap):
|
def display_statement(statement, namemap):
|
||||||
out = ""
|
out = ""
|
||||||
|
|
@ -168,15 +169,18 @@ def main():
|
||||||
if len(command_list) > 1:
|
if len(command_list) > 1:
|
||||||
times = int(command_list[1])
|
times = int(command_list[1])
|
||||||
game.eval(times, quick=True)
|
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":
|
elif command == "fulleval":
|
||||||
times = 200 / (game.n_players - 4) * 2
|
times = 200 / (game.n_players - 4) * 2
|
||||||
if len(command_list) > 1:
|
if len(command_list) > 1:
|
||||||
times = int(command_list[1])
|
times = int(command_list[1])
|
||||||
game.eval(times)
|
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":
|
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":
|
elif command == "save":
|
||||||
if len(command_list) < 2:
|
if len(command_list) < 2:
|
||||||
print(Fore.RED + "Need an output file")
|
print(Fore.RED + "Need an output file")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue