| set_crossover | R Documentation |
Combine two layouts of n unique grid-cell IDs. Shared sites
are kept; remaining sites are sampled from the parents' exclusive cells
and, with rate p_inject, from grid cells that neither parent uses.
Identical parents still get unused cells injected so the search does not
freeze. Every child has exactly n turbines.
set_crossover(
ids,
grid_ids,
uplimit = 300,
seed = NULL,
verbose = FALSE,
p_inject = NULL,
grid_xy = NULL,
visit = NULL,
p_spatial = NULL
)
ids |
Integer matrix with |
grid_ids |
All valid grid cell IDs |
uplimit |
Maximum number of children. Default is 300 |
seed |
Set a seed for comparability. Default is |
verbose |
If |
p_inject |
Fraction of non-shared slots filled from unused grid cells.
Default is |
grid_xy |
Optional matrix/data.frame with columns |
visit |
Named visit counts per grid ID (undersampled cells preferred) |
p_spatial |
Probability of spatial (vs set) crossover when |
Integer matrix of unique grid IDs (n x children)
Other Genetic Algorithm Functions:
crossover(),
fitness(),
genetic_algorithm(),
init_population(),
mutation(),
selection(),
swap_mutation(),
trimton()
ids <- cbind(c(1, 3, 5, 7), c(1, 4, 5, 9))
set_crossover(ids, grid_ids = 1:20, uplimit = 4, seed = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.