powered by
Apply a template algorithm file to an objective function
run.algorithm( algorithm_file, objective_function, input, output = NULL, options = NULL, work_dir = ".", trace = function(...) cat(paste0(..., "\n")), silent = FALSE, save_data = TRUE )
algorithm result (and algorithm object & files as attributes)
templated algorithm file
function to apply algorithm on
list of input arguments of function (eg. list(x1=list(min=0,max=1),x2=list(min=10,max=20)))
list of output names
algorithm options to overload default ones
working directory to run algorithm. will store output files, images, ..
display running info
quietness
enable (by default) saving of data (in .Rds) along algorithm iterations.
run.algorithm( system.file("Brent.R", package="templr"), function(x) sin(x)-0.75, list(x=list(min=0,max=pi/2)), work_dir=tempdir() )
Run the code above in your browser using DataLab