Exemple #1
0
 def get_new_public_info(self, game_state, action):
     playerlist = [
         DummyPlayer(favorite_mode=action, favorite_cards=[action]),
         DummyPlayer(favorite_mode=action, favorite_cards=[action]),
         DummyPlayer(favorite_mode=action, favorite_cards=[action]),
         DummyPlayer(favorite_mode=action, favorite_cards=[action])
     ]
     game = Game(game_state=deepcopy(game_state), players=playerlist)
     game.next_action()
     return game.get_public_info()
Exemple #2
0
def example_public_info():
    game_state = sample_game_states[0]
    players = [
        DummyPlayer(favorite_cards=[(OBER, HEARTS), (TEN, BELLS)]),
        DummyPlayer(favorite_cards=[(OBER, ACORNS), (KING, BELLS)]),
        DummyPlayer(favorite_cards=[(SEVEN, HEARTS), (ACE, BELLS)]),
        DummyPlayer(favorite_cards=[(ACE, HEARTS), (EIGHT, BELLS)])
    ]
    game = Game(players=players, game_state=game_state)
    for _ in range(8):
        game.next_action()
    return game.get_public_info()
Exemple #3
0
def main():
    game = Game(game_state=game_state_after_bidding, players=playerlist)
    public_info = game.get_public_info()
    curr_player = game.trick_game.get_current_player()

    start_time = time.time()

    print('Start !')

    actions = curr_player.isuct_search(public_info=public_info)
    end_time = time.time()

    print("possible actions : ", game.get_possible_actions())
    print("Best action", actions)
    print("Simulation took {} seconds".format(end_time - start_time))