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.
Usage
set_crossover(
ids,
grid_ids,
uplimit = 300,
seed = NULL,
verbose = FALSE,
p_inject = NULL,
grid_xy = NULL,
visit = NULL,
p_spatial = NULL
)Arguments
- ids
Integer matrix with
nrows (turbines) and one column per parent- grid_ids
All valid grid cell IDs
- uplimit
Maximum number of children. Default is 300
- seed
Set a seed for comparability. Default is
NULL- verbose
If
TRUE, print the number of children- p_inject
Fraction of non-shared slots filled from unused grid cells. Default is
getOption("windfarmGA.crossover_inject")(0.25). At least one unused cell is injected when any are available.- grid_xy
Optional matrix/data.frame with columns
ID,X,Y. If given, a spatial half-plane crossover is used with probabilityp_spatial.- visit
Named visit counts per grid ID (undersampled cells preferred)
- p_spatial
Probability of spatial (vs set) crossover when
grid_xyis given. Default isgetOption("windfarmGA.spatial_crossover")(0.5)
See also
Other Genetic Algorithm Functions:
crossover(),
fitness(),
genetic_algorithm(),
init_population(),
mutation(),
selection(),
swap_mutation(),
trimton()