| xegaBestInPopulation {xegaPopulation} | R Documentation |
Best solution in the population.
Description
BestInPopulation() extracts the best
individual of a population and
reports fitness, value, genotype, and phenotype:
-
fitness: The fitness value of the genetic algorithm. -
value: The function value of the problem environment. -
genotype: The gene representation. -
phenotype: The problem representation. E.g. a parameter list, a program, ...
We report one of the best solutions.
Usage
xegaBestInPopulation(pop, fit, lF, allsolutions = FALSE)
Arguments
pop |
Population of genes. |
fit |
Vector of fitness values of |
lF |
Local function configuration. |
allsolutions |
If TRUE, also return a list of all solutions. |
Value
Named list with the following elements:
-
$name: The name of the problem environment. -
$fitness: The fitness value of the best solution. -
$val: The evaluted best gene. -
$numberOfSolutions: The number of solutions. -
$genotype: The best gene. -
$phenotype: The parameters of the solution (the decoded gene). -
$phenotypeValue: The value of the function of the parameters of the solution (the decoded gene). -
$allgenotypes: The genotypes of all best solutions. (allsolutions==TRUE) -
$allphenotypes: The phenotypes of all best solutions. (allsolutions==TRUE)
See Also
Other Population Layer:
xegaBestGeneInPopulation(),
xegaEvalPopulation(),
xegaInitPopulation(),
xegaLogEvalsPopulation(),
xegaNextPopulation(),
xegaObservePopulation(),
xegaSummaryPopulation()
Examples
pop10<-xegaInitPopulation(10, lFxegaGaGene)
epop10<-xegaEvalPopulation(pop10, lFxegaGaGene)
xegaBestInPopulation(epop10$pop, epop10$fit, lFxegaGaGene)