Beispiel #1
0
def test_sl1338hc_vs_challenge(sl1338_hc_model_path):
    players = [
        SLPlayer1338hc(name='SLPlayer1', game_model_path=sl1338_hc_model_path),
        ChallengePlayer(name='ChallengePlayer1'),
        SLPlayer1338hc(name='SLPlayer2', game_model_path=sl1338_hc_model_path),
        ChallengePlayer(name='ChallengePlayer2')
    ]
    get_function_name()
    run_game(players)
Beispiel #2
0
def test_sl1338hc_vs_greedy(sl1338_hc_model_path):
    players = [
        SLPlayer1338hc(name='SLPlayer1', game_model_path=sl1338_hc_model_path),
        GreedyPlayer(name='Greedy1'),
        SLPlayer1338hc(name='SLPlayer1', game_model_path=sl1338_hc_model_path),
        GreedyPlayer(name='Greedy2')
    ]
    get_function_name()
    run_game(players)
Beispiel #3
0
def test_sl1338hc_vs_random(sl1338_hc_model_path):
    players = [
        SLPlayer1338hc(name='SLPlayer1', game_model_path=sl1338_hc_model_path),
        RandomPlayer(name='Track'),
        SLPlayer1338hc(name='SLPlayer2', game_model_path=sl1338_hc_model_path),
        RandomPlayer(name='Trick')
    ]
    get_function_name()
    run_game(players)
Beispiel #4
0
def test_sl1338hc_vs_rl(sl1338_hc_model_path, rl_models_directory):
    rl_model_path = rl_models_directory + 'rl1_model.h5'
    players = [
        SLPlayer1338hc(name='SLPlayer1', game_model_path=sl1338_hc_model_path),
        RLPlayer(name='RLPlayer1', model_path=rl_model_path),
        SLPlayer1338hc(name='SLPlayer2', game_model_path=sl1338_hc_model_path),
        RLPlayer(name='RLPlayer2', model_path=rl_model_path)
    ]
    get_function_name()
    run_game(players)
Beispiel #5
0
def test_sl222_vs_sl1338hc(sl222_model_path, sl1338_hc_model_path):
    players = [
        SLPlayer222(name='SLPlayer222_1', game_model_path=sl222_model_path),
        SLPlayer1338hc(name='SLPlayer1338hc_1',
                       game_model_path=sl1338_hc_model_path),
        SLPlayer222(name='SLPlayer222_2', game_model_path=sl222_model_path),
        SLPlayer1338hc(name='SLPlayer1338hc_2',
                       game_model_path=sl1338_hc_model_path)
    ]
    get_function_name()
    run_game(players)
Beispiel #6
0
def test_sl1338_vs_sl1338hc(sl1338_big_nn_model_path, sl1338_hc_model_path):
    players = [
        SLPlayer1338(name='SLPlayer1338_1',
                     game_model_path=sl1338_big_nn_model_path),
        SLPlayer1338hc(name='SLPlayer1338hc_1',
                       game_model_path=sl1338_hc_model_path),
        SLPlayer1338hc(name='SLPlayer1338hc_2',
                       game_model_path=sl1338_hc_model_path),
        SLPlayer1338hc(name='SLPlayer1338hc_3',
                       game_model_path=sl1338_hc_model_path)
    ]
    get_function_name()
    run_game(players)
Beispiel #7
0
def test_sl1338hc_vs_random_with_trumpfnetwork(sl1338_hc_model_path,
                                               sl37_trumpf_model_path):
    players = [
        SLPlayer1338hc(name='SLPlayer1',
                       game_model_path=sl1338_hc_model_path,
                       trumpf_model_path=sl37_trumpf_model_path),
        RandomPlayer(name='Tick'),
        SLPlayer1338hc(name='SLPlayer2',
                       game_model_path=sl1338_hc_model_path,
                       trumpf_model_path=sl37_trumpf_model_path),
        RandomPlayer(name='Track')
    ]
    get_function_name()
    run_game(players)
Beispiel #8
0
def run(log_dir, episodes, rounds):
    save_model_path = log_dir + '/sl1_model.h5'
    trumpf_model_path = log_dir + '/trumpf_network_model_final__2018-06-18_112248.h5'
    game_model_path = log_dir + '/game_network_model_155__2018-09-19_101942.h5'
    sl_player = SLPlayer1338hc(name='SL1',
                               game_model_path=game_model_path,
                               trumpf_model_path=trumpf_model_path,
                               rounds=rounds)
    players = [
        sl_player,
        ChallengePlayer(name='Tick'),
        ChallengePlayer(name='Trick'),
        ChallengePlayer(name='Track')
    ]
    # players = [sl_player, GreedyPlayer(name='Tick'), ChallengePlayer(name='Trick'), GreedyPlayer(name='Track')]
    sum_won = 0
    for e in range(episodes):
        tournament = Tournament()
        [tournament.register_player(player) for player in players]
        tournament.play(rounds=rounds, use_counting_factor=False)
        sum_won += sl_player.won[0]
        print_stats_winning(sl_player.won_stich, sl_player.won, e, sum_won)
        sl_player.reset_stats()