get_IndividualToBeMutated: Retrieve Individuals Marked for Mutation

View source: R/terga2.lib.R

get_IndividualToBeMutatedR Documentation

Retrieve Individuals Marked for Mutation

Description

This function identifies and returns the indices of individuals in the population who are marked for mutation, as indicated by the 'toBeMutated' attribute.

Usage

get_IndividualToBeMutated(pop)

Arguments

pop

A list representing the population, where each individual has a 'toBeMutated' attribute indicating if they are marked for mutation.

Details

The function uses 'populationGet_X' to retrieve individuals with the 'toBeMutated' attribute set to 'TRUE'. It returns the indices of these individuals, allowing them to be processed for mutation in subsequent evolutionary steps.

Value

A vector of indices corresponding to individuals in the population who are marked for mutation.

Examples

## Not run: 
pop <- list(
  list(fit_ = 0.9, toBeMutated = TRUE),
  list(fit_ = 0.8, toBeMutated = FALSE),
  list(fit_ = 0.7, toBeMutated = TRUE)
)
toBeMutated <- get_IndividualToBeMutated(pop)
print(toBeMutated) # Should return indices of individuals marked for mutation

## End(Not run)


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