diff --git a/ReinforcmentLearning/game.py b/ReinforcmentLearning/game.py index 65a9f2b..a8bccd0 100644 --- a/ReinforcmentLearning/game.py +++ b/ReinforcmentLearning/game.py @@ -117,15 +117,16 @@ def start_try(AMOUNT_RUNS, EPSILON, ALPHA, GAMMA, REWARD_ON_WIN, REWARD_ON_LOSE, cookies_per_run = [] iterations = [] for x in range(AMOUNT_RUNS): - # if show_game: - if x == AMOUNT_RUNS / 4: - print("1 / 4 done") + if show_game: + if x == AMOUNT_RUNS / 4: + print("1 / 4 done") - if x == AMOUNT_RUNS / 2: - print("2 / 4 done") + if x == AMOUNT_RUNS / 2: + print("2 / 4 done") - if x == (AMOUNT_RUNS / 2) + (AMOUNT_RUNS / 4): - print("3 / 4 done") + if x == (AMOUNT_RUNS / 2) + (AMOUNT_RUNS / 4): + print("3 / 4 done") + amount_cookies_ate, iterations_per_run = run_game(q_values, EPSILON, ALPHA, GAMMA, REWARD_ON_WIN, REWARD_ON_LOSE, show_game, screen) cookies_per_run.append(amount_cookies_ate) iterations.append(iterations_per_run) diff --git a/main.py b/main.py index d5300c7..cdb9b81 100644 --- a/main.py +++ b/main.py @@ -18,6 +18,11 @@ plot_result = False show_game = False +#! TMP +import os +os.environ['MPLBACKEND'] = 'Agg' + + # oneTry(EPSILON, ALPHA, GAMMA, AMOUNT_RUNS, REWARD_ON_WIN, REWARD_ON_LOSE, plot_result, show_game) #multipleTries(EPSILON, ALPHA, GAMMA,AMOUNT_TRIES, AMOUNT_RUNS, REWARD_ON_WIN, REWARD_ON_LOSE) gen_tuning_main(AMOUNT_TRIES, AMOUNT_RUNS, REWARD_ON_WIN, REWARD_ON_LOSE, EPSILON)