selectMixed: Select Individuals Using Mixed Elite and Tournament Selection

View source: R/terga1.lib.R

selectMixedR Documentation

Select Individuals Using Mixed Elite and Tournament Selection

Description

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).

Usage

selectMixed(evaluation, percentage_elite, percentage_tournoi)

Arguments

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).

Details

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.

Value

A vector of indices representing the selected individuals, combining elite and tournament selections.

Examples

## 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)


predomics/predomicspkg documentation built on Dec. 11, 2024, 11:06 a.m.