pre commit
This commit is contained in:
parent
dc5c855dd7
commit
d694cea4a5
3 changed files with 76 additions and 58 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue