pre commit

This commit is contained in:
Ahmet Kaan GÜMÜŞ 2024-11-20 00:20:40 +03:00
parent dc5c855dd7
commit d694cea4a5
3 changed files with 76 additions and 58 deletions

View file

@ -57,6 +57,14 @@ impl FoodSource {
}
food_sources
}
pub fn find_best_food_source(food_sources: &Vec<FoodSource>) -> FoodSource {
food_sources
.iter()
.max_by(|x, y| x.fitness_calculation.total_cmp(&y.fitness_calculation))
.unwrap()
.clone()
}
}
impl fmt::Display for FoodSource {