Skip to content

Commit

Permalink
Clamp selection size in exploitation phase
Browse files Browse the repository at this point in the history
  • Loading branch information
reinterpretcat committed Oct 20, 2024
1 parent ae98950 commit 939ea81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rosomaxa/src/population/rosomaxa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ where
}
}
RosomaxaPhases::Exploitation { selection_size: old_selection_size } => {
*old_selection_size = selection_size;
// NOTE as we exploit elite only, limit how many solutions are exploited simultaneously
*old_selection_size = ((*old_selection_size as f64 / 2.).round() as usize).clamp(2, 4)
}
}
}
Expand Down

0 comments on commit 939ea81

Please sign in to comment.