Description Usage Arguments Value
Function to sample items with a genetic algorithm maximizing some measure of fitness (e.g., average inter-item dissimilarity) as measured by an inter-item distance matrix.
1 2 3 4 | sampleItems(distance_mat, sample_size, fitness = fitnessFunction,
lower_tri_funciton = sumHeight, n_suggestions = 500,
maxiter = 1e+06, run = 200, required_items = NULL, seed = NULL,
suggest_maxmin = TRUE)
|
distance_mat |
a population inter-item distance matrix |
sample_size |
the number of items to sample |
fitness |
a fitness function to pass to ga() |
lower_tri_funciton |
the specific function to assess fitness of the lower triangle of the sample distance matrix |
n_suggestions |
number of suggestions to initialise the GA with |
maxiter |
maximum number of iterations to run GA |
required_items |
character vector of any items required to be included in the solution |
seed |
seed for GA |
suggest_maxmin |
logical denoting whether to include greedy search for the items that maximise minimum inter item distance in the initial suggestions |
a list containing the final items and a GA object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.