plot_ParamsPerIter(params,...)## S3 method for class 'default':
plot_ParamsPerIter(params, param.names=colnames(params),
main=NULL, xlab="Number of evaluations", nrows="auto", cex=0.5,
cex.main=1.2,cex.axis=1.7,cex.lab=1.5, col=rainbow(ncol(params)),
lty=3, verbose=TRUE, ..., do.png=FALSE, png.width=1500,
png.height=900, png.res=90, png.fname="Params_ValuePerRun.png" )
## S3 method for class 'matrix':
plot_ParamsPerIter(params, param.names=colnames(params),
main=NULL, xlab="Number of evaluations", nrows="auto", cex=0.5,
cex.main=1.2,cex.axis=1.7,cex.lab=1.5, col=rainbow(ncol(params)),
lty=3, verbose=TRUE, ..., do.png=FALSE, png.width=1500,
png.height=900, png.res=90, png.fname="Params_ValuePerRun.png" )
## S3 method for class 'data.frame':
plot_ParamsPerIter(params, param.names=colnames(params),
main=NULL, xlab="Number of evaluations", nrows="auto", cex=0.5,
cex.main=1.2,cex.axis=1.7,cex.lab=1.5, col=rainbow(ncol(params)),
lty=3, verbose=TRUE, ..., do.png=FALSE, png.width=1500,
png.height=900, png.res=90, png.fname="Params_ValuePerRun.png" )
params
(by default its column names)plot
nrows
is set to auto, the number of rows is automatically computed depending on the number of columns of params
par
cex
. See par
cex
. See par
cex
. See par
par
par
plot
function or from other methods.do.png=TRUE
numeric with the width of the device. See png
do.png=TRUE
numeric with the height of the device. See png
do.png=TRUE
numeric with the 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, with the filename used to store the PNG fileplot_results
, plot_2parOF
, plot_NparOF
, plot_GofPerParticle
# Number of dimensions to be optimised
D <- 5
# Boundaries of the search space (Griewank test function)
lower <- rep(-600, D)
upper <- rep(600, D)
# Setting the user's home directory as working directory
setwd("~")
# Setting the seed
set.seed(100)
# Running PSO with the 'griewank' test function, writing the results to text files
hydroPSO(fn=griewank, lower=lower, upper=upper,
control=list(use.IW = TRUE, IW.type= "linear", IW.w= c(1.0, 0.4),
write2disk=TRUE) )
# reading the 'Particles.txt' output file of PSO
setwd("PSO.out")
particles <- read_particles(plot=FALSE)
# plotting the value of each parameter and the objective function against the
# iteration number
plot_ParamsPerIter(particles[["part.params"]])
Run the code above in your browser using DataLab