read_convergence(file="ConvergenceMeasures.txt", MinMax=NULL, beh.thr=NA,
verbose=TRUE, plot=TRUE, col=c("black", "darkolivegreen"), lty=c(1,3),
lwd=c(2,2), main="Global Optimum & Normalized Swarm Radius vs Iteration Number",
xlab="Iteration Number", ylab=c("Global Optimum", expression(delta[norm])),
pch=c(15, 18), cex=1, cex.main=1.4, cex.axis=1.2, cex.lab=1.2,
legend.pos="topright", ..., do.png=FALSE, png.width=1500, png.height=900,
png.res=90,png.fname="ConvergenceMeasures.png")
plot_convergence(x, verbose=TRUE, col=c("black", "darkolivegreen"), lty=c(1,3),
lwd=c(2,2), main="Global Optimum & Normalized Swarm Radius vs Iteration Number",
xlab="Iteration Number", ylab=c("Global Optimum", expression(delta[norm])),
pch=c(15, 18), cex=1, cex.main=1.4, cex.axis=1.2, cex.lab=1.2,
legend.pos="topright", ..., do.png=FALSE, png.width=1500, png.height=900,
png.res=90, png.fname="ConvergenceMeasures.png")
read_convergence
.params
corresponds to the minimum or maximum of the the objective function. Valid values are in: c('min', 'max')
beh.th
, depending on the value of MinMax
.
It is only used for drawing a horizontal line used for seplot=TRUE
character, colour to be used for drawing the linesplot=TRUE
numeric, line type to be usedplot=TRUE
numeric, line widthplot=TRUE
character, label for the 'x' axisplot=TRUE
character, label for the 'y' axisplot=TRUE
character, title for the plotplot=TRUE
numeric, type of symbol for drawing the points of the dotty plots (e.g., 1: white circle)plot=TRUE
numeric, values controlling the size of text and points with respect to the defaultplot=TRUE
numeric, magnification to be used for main titles relative to the current setting of cex
plot=TRUE
numeric, magnification to be used for axis annotation relative to the current setting of cex
plot=TRUE
numeric, magnification to be used for x and y labels relative to the current setting of cex
plot=TRUE
character, position of the legend. Valid values are in c("bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", "center")
. See
plot=TRUE
further arguments passed to the plot command or from other methodsdo.png=TRUE
numeric, width of the device. See png
do.png=TRUE
numeric, height of the device. See png
do.png=TRUE
numeric, nominal resolution in ppi which will be recorded in the PNG file, if a positive integer of the device. See png
do.png=TRUE
character, name of the output PNG file. See png
read_results
, plot_results
# Setting the user home directory as working directory
setwd("~")
# Number of dimensions to be optimised
nparam <- 4
# Setting the seed
set.seed(100)
# Runing PSO with the 'sphere' test function, writting the results to text files
hydroPSO(
fn= sphere, lower=rep(-100, nparam), upper=rep(100, nparam),
control=list(MinMax="min", write2disk=TRUE, plot=TRUE)
)
# Reading the convergence measures got by running hydroPSO
setwd("PSO.out")
read_convergence()
Run the code above in your browser using DataLab