Learn R Programming

adana (version 1.1.0)

monprogress: Monitor Fitness Value Progress

Description

Monprogress function performs by creating a line plot of the best fitness value found across generations.

Usage

monprogress(g, genfits, objective, ...)

Arguments

g

Generation number

genfits

A matrix for fitness values

objective

Type of optimization. "min" or "max"

Further arguments passed to or from other methods.

Value

No return value, called for the side effect of drawing a plot.

See Also

show

Examples

Run this code
# NOT RUN {
n = 100
genfits = matrix(NA, nrow=n, ncol=5)
genfits[1,3] = 50
objective = "max"
for(i in 1:(n-1)){
  g=i
  monprogress(g=g, genfits=genfits, objective=objective)
  genfits[g+1, 3] = genfits[g, 3] + runif(1, -2, 5)
}
# }

Run the code above in your browser using DataLab