Last data update: 2014.03.03
|
R: Genetic Algorithm plot
plot.GAReal | R Documentation |
Genetic Algorithm plot
Description
A quick way to visualize the GA results.
Usage
## S3 method for class 'GAReal'
plot(x, xlab = "Generation",
ylab = "Fitness", main = "GA optimization",
bestcol = "steelblue", meancol = "tomato", lwd = 2,
legend.pos = c("bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", "center"),
...)
Arguments
x |
An object of class GAReal .
|
xlab |
The label for the x-axis.
|
ylab |
The label for the y-axis.
|
main |
The plot title.
|
bestcol |
The color for the best fitness evolution
line
|
meancol |
The color for the mean fitness evolution
line
|
lwd |
The line width.
|
legend.pos |
The legend position, as a character
vector.
|
... |
Other parameters (will be ignored).
|
Examples
ga = GAReal(function(x) sum(x), rep(0, 5), rep(10, 5))
ga$evolve(200)
plot(ga)
Results
|