| get_Parents | R Documentation | 
This function identifies and returns the indices of individuals in the population who are marked as selected, which can be used as parents in evolutionary processes.
get_Parents(pop)
| pop | A list representing the population, where each individual has a 'selected' attribute indicating if they are selected. | 
The function uses 'populationGet_X' to retrieve individuals with the 'selected' attribute set to 'TRUE'. It returns the indices of these individuals, allowing them to be used as parents in subsequent evolutionary steps.
A vector of indices corresponding to individuals in the population who are marked as selected.
## Not run: 
pop <- list(
  list(fit_ = 0.9, selected = TRUE),
  list(fit_ = 0.8, selected = FALSE),
  list(fit_ = 0.7, selected = TRUE)
)
parents <- get_Parents(pop)
print(parents) # Should return indices of selected individuals
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.