Use raw score for fitness

This commit is contained in:
Leonora Tindall 2023-04-03 22:55:59 -05:00
parent aebdbeb356
commit c8233134c3
1 changed files with 1 additions and 2 deletions

View File

@ -99,8 +99,7 @@ impl World {
self.over = true; self.over = true;
} }
} }
self.fitness = self.fitness = self.score;
(self.score / self.player.shots as f32).powi(2) * self.player.lifespan as f32;
self.asteroids.append(&mut to_add); self.asteroids.append(&mut to_add);
self.asteroids.retain(|asteroid| asteroid.alive); self.asteroids.retain(|asteroid| asteroid.alive);
// if self.asteroids.iter().fold(0, |acc, x| { // if self.asteroids.iter().fold(0, |acc, x| {