read_best: Reading the 'BestParameterSet.txt' output file

View source: R/read_best.R

read_bestR Documentation

Reading the 'BestParameterSet.txt' output file

Description

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

Usage

read_best(file="BestParameterSet.txt", verbose=TRUE)

Arguments

file

character, name (including path) of the output file with the best parameter set and its corresponding best fitness value found during the optimisation

verbose

logical, if TRUE, progress messages are printed

Author(s)

Mauricio Zambrano-Bigiarini, mzb.devel@gmail.com

See Also

read_results, plot_results

Examples

## 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)

hzambran/hydroPSO documentation built on Feb. 3, 2024, 4:39 p.m.