diff --git a/single-agent.py b/single-agent.py index 1fe2f2f..aec3e7a 100644 --- a/single-agent.py +++ b/single-agent.py @@ -21,7 +21,7 @@ figure_file = 'plots/score_sp.png' game = Game() -agent_list = [0] +agent_list = [game.level.player_sprites[0].agent] score_history = np.zeros(shape=(game.max_num_players, n_episodes)) best_score = np.zeros(game.max_num_players) @@ -32,12 +32,12 @@ for i in tqdm(range(n_episodes)): if i != 0: game.level.__init__(reset=True) # TODO: Make game.level.reset_map() so we don't pull out and load the agent every time (There is -definitevly- a better way) - for player in game.level.player_sprites: - player.stats.exp = score_history[player.player_id][i-1] - player.agent = agent_list[0] + for player in game.level.player_sprites: + player.stats.exp = score_history[player.player_id][i-1] + player.agent = agent_list[0] - agent_list = [0] + agent_list = [game.level.player_sprites[0].agent] for j in range(game_len): if not game.level.done: