Example #1
0
def generate_game_sessions_with_all_parameters():
    path = _create_path(dir='virtual_players')
    make_directory(directory=path)
    params_ql, params_rl = prepare_params()
    for trial in params_ql:
        game = GameSession()
        model = Qlearning()
        player = VirtualPlayer(trial[0],
                               trial[1],
                               game_skeleton=game.game_skeleton,
                               model=model)
        game.play(player=player)
        file = tuple(map(str, round_number(trial[0]), round_number(trial[1])))
        path = _create_file_path(filename="QL_" + "_".join(file))
        game.save_results(path)
Example #2
0
def generate_game_sessions_with_real_player_parameters():
    path = _create_path(dir='virtual_players')
    make_directory(directory=path)
    df = pd.read_csv('/Users/karola/PycharmProjects/ZPI/data/RW_RP_params.csv')
    for index, row in df.iterrows():
        game = GameSession()
        model = RescorlaWagner()
        player = VirtualPlayer(row['T'],
                               row['alpha_gain'],
                               row['alpha_lose'],
                               game_skeleton=game.game_skeleton,
                               model=model)
        game.play(player=player)
        file = tuple(
            map(str, (round_number(row['T']), round_number(row['alpha_gain']),
                      round_number(row['alpha_lose']), row['name'])))
        path = _create_file_path(filename="RW_" + "_".join(file))
        game.save_results(path)