Skip to content

Commit

Permalink
better log format
Browse files Browse the repository at this point in the history
  • Loading branch information
RedContritio committed Dec 21, 2021
1 parent e6eed2f commit da9a07c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ def saveOperations(self):
print(self.operations)
with open(os.path.join('log', 'scores.txt'), 'a') as f:
print(timestr, file=f)
print(f'{self.seed} {self.bird_world_xmid, self.bird_world_position[1]}', file=f)
print(f'reward {self.reward} = {self.bird_world_position[0] / 180} + {self.score} - {self.bird_y_diff_to_next_pipe / self.window_size[1]}', file=f)
print([p.x for p in self.pipes], file=f)
print(f'{self.seed} ({self.bird_world_xmid:.3e}, {self.bird_world_position[1]:.3e}) to ({self.next_pipe.x:.3e}, {self.next_pipe.ymid:.3e})', file=f)
print(f'reward {self.reward:.3e} = {self.bird_world_position[0] / 180:.3e} + {self.score:.3e} - {self.bird_y_diff_to_next_pipe / self.window_size[1]:.3e}', file=f)
# print([p.x for p in self.pipes], file=f)

@property
def bird_y_diff_to_next_pipe(self):
Expand Down

0 comments on commit da9a07c

Please sign in to comment.