optimize | R Documentation |
Optimization function on binary representations of decision variables Maximization of a fitness function using genetic algorithms (GAs). Using default binary representation to encode float and integer values
optimize(
opt_criteria,
opt_function,
features,
suggestions = NULL,
keepBest = TRUE,
parallel = FALSE,
monitor = TRUE,
...
)
opt_criteria |
<string> Fitness function criteria (minimise | maximise) |
opt_function |
<function> Fitness function |
features |
<list> List of features as decision variables Feature description feature = list( datatype = <type of data> (discrete | integer | float) min = <min value>, max = <max value>, nlevels = <number of levels>, levels = <levels> (optional: discrete type specific) ) |
suggestions |
<list> A matrix of solutions strings to be included in the initial population. If provided the number of columns must match the number of decision variables |
keepBest |
<boolean> A logical argument specifying if best solutions at each iteration should be saved in a slot called bestSol |
parallel |
<integer> An optional argument which allows to specify if the Genetic Algorithm should be run sequentially or in parallel |
monitor |
<function> A logical or an R function which takes as input the current state of the ga-class object and show the evolution of the search |
... |
Additional arguments to be passed to the fitness function. This allows to write fitness functions that keep some variables fixed during the search. Supported GA parameters popSize (default 50). The population size pcrossover (default 0.8). The probability of crossover between pairs of chromosomes pmutation (default 0.1). The probability of mutation in a parent chromosome. Usually mutation occurs elitism. The number of best fitness individuals to survive at each generation. By default the top 5 each iteration. maxiter (default 100). The maximum number of iterations to run before the DE search is halted stepsize.T he stepsize or weighting factor |
selection |
<function> An R function performing selection, i.e. a function which generates a new population of individuals from the current population probabilistically according to individual fitness |
popSize |
<integer> The population size |
maxiter |
<integer> The maximum number of iterations to run before the GA search is halted. |
elitism |
<integer> The number of best fitness individuals to survive at each generation |
pmutation |
<float> The probability of mutation in a parent chromosome |
<list> of optim solution for each decision variable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.