def train(self, player): # create new a new bot shares the same strategy player2 = Player(player.name + "COPY") player2.bot = EasyBot(player.bot.name + "_COPY") player2.bot.strategy = player.bot.strategy for _ in range(self._TRAIN_ITER): self.headsup_simulate(player, player2)
#imports from bots.pseudo_bot import PseudoBot from bots.easy_bot import EasyBot from bots.trainer import Trainer from engine.dealer import Dealer from engine.player import Player #constants #n/a #functions #n/a # valerie = Dealer() #print("valerie will be our dealer.") matt_damon = Player("Matt") ed_norton = Player("Ed") trainer = Trainer() matt_damon.bot = EasyBot("MattBot") ed_norton.bot = PseudoBot("EdBot") # each iteration took about 1 min, default is 100 iters # trainer = Trainer() # trainer.train(matt_damon) valerie.start_game(matt_damon, ed_norton) #c = "To play a hand, run ``valerie.play_hand()``\n" valerie.play_hand();