selectMixed | R Documentation |
This function combines elite selection and tournament selection to select individuals from a population. It first selects a specified percentage of top-performing individuals (elite) and then fills the remaining percentage with randomly selected individuals (tournament).
selectMixed(evaluation, percentage_elite, percentage_tournoi)
evaluation |
A numeric vector of evaluation scores for each individual in the population, with higher values indicating better performance. |
percentage_elite |
A numeric value representing the percentage of individuals to select based on elite selection (top performers). |
percentage_tournoi |
A numeric value representing the percentage of individuals to select based on tournament selection (random selection). |
The function calculates the total number of individuals to select ('perc') based on 'percentage_elite' and 'percentage_tournoi'. It then uses 'selectElite' to select the top-performing individuals as elites, filling 'perc_elite' slots. Afterward, it uses 'selectTournoi' to fill the remaining 'perc_tournoi' slots by selecting randomly from the remaining individuals.
This mixed selection approach ensures that high-quality solutions are retained while also introducing diversity through random selection.
A vector of indices representing the selected individuals, combining elite and tournament selections.
## Not run:
evaluation <- c(0.9, 0.85, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05)
selected_indices <- selectMixed(evaluation, percentage_elite = 30, percentage_tournoi = 20)
print(selected_indices) # Returns indices selected via elite and tournament strategies
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.