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

1
2
## S4 method for signature '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.

Details

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

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.

Author(s)

Luca Scrucca

See Also

gaisl, gaisl-class.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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())

## End(Not run)