Updated single-agent.py
This commit is contained in:
parent
e7f1c2f884
commit
d0098af801
1 changed files with 2 additions and 6 deletions
|
@ -21,7 +21,7 @@ figure_file = 'plots/score_sp.png'
|
|||
|
||||
game = Game()
|
||||
|
||||
agent_list = [game.level.player_sprites[0].agent]
|
||||
agent = 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)
|
||||
|
@ -35,9 +35,7 @@ for i in tqdm(range(n_episodes)):
|
|||
|
||||
for player in game.level.player_sprites:
|
||||
player.stats.exp = score_history[player.player_id][i-1]
|
||||
player.agent = agent_list[0]
|
||||
|
||||
agent_list = [game.level.player_sprites[0].agent]
|
||||
player.agent = agent
|
||||
|
||||
for j in range(game_len):
|
||||
if not game.level.done:
|
||||
|
@ -54,8 +52,6 @@ for i in tqdm(range(n_episodes)):
|
|||
# for enemy in game.level.enemy_sprites:
|
||||
# player.stats.exp *= .95
|
||||
|
||||
agent_list[0] = game.level.player_sprites[0].agent
|
||||
|
||||
for player in game.level.player_sprites:
|
||||
exp_points = player.stats.exp
|
||||
score_history[player.player_id][i] = exp_points
|
||||
|
|
Loading…
Reference in a new issue