Add model training with graphs and current stats, improve model with better rewarding system

This commit is contained in:
csd4ni3l
2025-11-15 18:54:37 +01:00
parent 32477def6a
commit 05f568a457
10 changed files with 204 additions and 92 deletions

View File

@@ -33,7 +33,7 @@ class Player(arcade.Sprite): # Not actually the player
def update(self, model: PPO, enemies, bullets, width, height):
if enemies:
nearest_enemy = min(enemies, key=lambda e: abs(e.center_y - self.center_y) + abs(e.center_x - self.center_x))
nearest_enemy = min(enemies, key=lambda e: abs(e.center_x - self.center_x))
enemy_x = (nearest_enemy.center_x - self.center_x) / width
enemy_y = (nearest_enemy.center_y - self.center_y) / height
else: