mirror of
https://github.com/csd4ni3l/fleet-commander.git
synced 2026-01-01 04:23:47 +01:00
Add model training with graphs and current stats, improve model with better rewarding system
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user