small fixes

This commit is contained in:
Barak Michener 2013-07-30 23:10:42 -04:00
parent 9c10d723a8
commit a455fd0248
2 changed files with 6 additions and 12 deletions

17
tim.py
View file

@ -49,7 +49,7 @@ class DeceptionGame(object):
self.observations = [] self.observations = []
self.seen = [] self.seen = []
self.tid = 0 self.tid = 0
self.lady_will_duck = Bernoulli(0.5) self.lady_will_duck = Bernoulli(0.7)
self.mission_ducks_on_round = [None] * 5 self.mission_ducks_on_round = [None] * 5
self.mission_ducks_on_round[0] = Bernoulli(0.5) self.mission_ducks_on_round[0] = Bernoulli(0.5)
self.mission_ducks_on_round[1] = Bernoulli(0.5) self.mission_ducks_on_round[1] = Bernoulli(0.5)
@ -114,16 +114,11 @@ class DeceptionGame(object):
else: else:
return None return None
else: else:
if self.lady_will_duck.rand(): if claim is True:
if self.player_is_good(deal, p2) == claim: return self.lady_will_duck.rand()
return True if claim is False:
else: return not self.lady_will_duck.rand()
return False
else:
if self.player_is_good(deal, p2) == claim:
return False
else:
return True
transaction.append(obs) transaction.append(obs)
self.observations.append(transaction) self.observations.append(transaction)
self.seen.append({"type": "lady", self.seen.append({"type": "lady",

View file

@ -31,7 +31,6 @@ def merlin_vote(game, player_id, team, votes, fail_req, r, deal):
return True return True
def mordred_vote(game, player_id, team, votes, fail_req, r, deal): def mordred_vote(game, player_id, team, votes, fail_req, r, deal):
n_actually_good_people = sum( n_actually_good_people = sum(
[int(game.player_is_good(deal, x)) for x in team]) [int(game.player_is_good(deal, x)) for x in team])