GA (version 3.1.1)

plot.gaisl-method: Plot of Islands Genetic Algorithm search path

Description

The plot method for gaisl-class objects gives a plot of best fitness values found in each island during the GA iterations.

Usage

# S4 method for gaisl
plot(x, y, …)

Arguments

x

An object of class "gaisl".

y

Not used.

Further arguments passed to plot.default, such as ylim, ylab, etc., or to matplot, such as col, lty, and lwd.

Value

The method invisibly return a list with the following components:

iter

a vector of values specifying the interation.

summary

a matrix of best fitness values for each island along the columns.

Details

Plot best fitness values found in each island during the GA iterations.

See Also

gaisl, gaisl-class.

Examples

Run this code
# NOT RUN {
# See examples in help(gaisl)

# The following code shows how to obtain graphs using the 
# ggplot2 plotting system 
# }
# NOT RUN {
GA <- gaisl(...)
out <- plot(GA)
library(reshape2)
df <- melt(out, id.var = "iter")
library(ggplot2)
ggplot(df, aes(x = iter, y = value, group = variable, colour = variable)) +
  xlab("Generation") +  ylab("Fitness values") +
  geom_line(size = 0.8) +
  scale_colour_brewer(palette = "Paired") +
  theme_bw() +
  theme(legend.title = element_blank())
# }

Run the code above in your browser using DataCamp Workspace