Learn R Programming

xegaPopulation (version 1.0.0.11)

xegaBestInPopulation: Best solution in the population.

Description

xegaBestInPopulation() extracts the best individual of a population and reports fitness, value, genotype, and phenotype:

  1. fitness: The fitness value of the genetic algorithm.

  2. value: The function value of the problem environment.

  3. genotype: The gene representation.

  4. 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)

Value

Named list with the following elements:

  • $name: The name of the problem environment.

  • $fitness: The fitness value of the best solution.

  • $value: The evaluated 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)

Arguments

pop

Population of genes.

fit

Vector of fitness values of pop.

lF

Local function configuration.

allsolutions

If TRUE, also return a list of all solutions.

See Also

Other Population Layer: xegaBestGeneInPopulation(), xegaEvalPopulation(), xegaInitPopulation(), xegaLogEvalsPopulation(), xegaNextPopulation(), xegaObservePopulation(), xegaRepEvalPopulation(), xegaSummaryPopulation()

Examples

Run this code
pop10<-xegaInitPopulation(10, lFxegaGaGene)
epop10<-xegaEvalPopulation(pop10, lFxegaGaGene)
xegaBestInPopulation(epop10$pop, epop10$fit, lFxegaGaGene)

Run the code above in your browser using DataLab