This function reads the contents of the the ‘BestParameterSet.txt’ output file, which stores the best parameter set and its corresponding goodness-of-fit value found during the optimisation
character, name (including path) of the output file with the best parameter set and its corresponding best fitness value found during the optimisation
logical, if TRUE, progress messages are printed
Mauricio Zambrano-Bigiarini, firstname.lastname@example.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
## Not run: # Setting the user home directory as working directory setwd("~") # Number of dimensions to be optimised D <- 4 # Boundaries of the search space (Sphere test function) lower <- rep(-100, D) upper <- rep(100, D) # Setting the seed set.seed(100) # Runing PSO with the 'Sphere' test function, writting the results to text files hydroPSO(fn=sphere, lower=lower, upper=upper, control=list(maxit=100, write2disk=TRUE, plot=TRUE) ) # Reading the best parameter set and its corresponsing gof found by hydroPSO setwd("PSO.out") read_best() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.