* using log directory 'd:/Rcompile/CRANpkg/local/2.13/irace.Rcheck' * using R version 2.13.2 (2011-09-30) * using platform: i386-pc-mingw32 (32-bit) * using session charset: ISO8859-1 * checking for file 'irace/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'irace' version '1.0' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... NOTE Packages suggested but not available for checking: multicore Rmpi * checking if this is a source package ... OK * checking whether package 'irace' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking for portable file names ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking for unstated dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... NOTE race.wrapper: no visible global function definition for 'mclapply' * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... ERROR Running examples in 'irace-Ex.R' failed The error most likely occurred in: > ### Name: irace-package > ### Title: The irace package > ### Aliases: irace-package irace > ### Keywords: package > > ### ** Examples > > ####################################################################### > # This example illustrates how to tune the parameters of the simulated > # annealing algorithm (SANN) provided by the optim() function in the > # R base package. The goal in this example is to optimize instances of > # the following family: > # f(x) = lambda * f_rastrigin(x) + (1 - lambda) * f_rosenbrock(x) > # where lambda follows a normal distribution whose mean is 0.9 and > # standard deviation is 0.02. f_rastrigin and f_rosenbrock are the > # well-known Rastrigin and Rosenbrock benchmark functions. In this > # scenario, different instances are given by different values of > # lambda. > ####################################################################### > ## First we provide an implementation of the functions to be optimized: > f_rosenbrock <- function (x) { + d <- length(x) + z <- x + 1 + hz <- z[1:(d - 1)] + tz <- z[2:d] + s <- sum(100 * (hz^2 - tz)^2 + (hz - 1)^2) + return(s) + } > f_rastrigin <- function (x) { + sum(x * x - 10 * cos(2 * pi * x) + 10) + } > > ## We generate 200 instances (in this case, weights): > weights <- rnorm(200, mean = 0.9, sd = 0.02) > > ## On this set of instances, we are interested in optimizing two > ## parameters of the SANN algorithm: tmax and temp. We setup the > ## parameter space as follows: > parameters.table <- ' + tmax "" i (1, 5000) + temp "" r (0, 100) + ' > > ## We use the irace function readParameters to read this table: > parameters <- readParameters(text=parameters.table) > > ## Next, we define the function that will evaluate each candidate > ## configuration on a single in stance. For simplicity, we restrict to > ## three-dimensional functions and we set the maximum number of > ## iterations of SANN to 5000. > hook.run <- function(instance, candidate, extra.params = NULL, config = list()) + { + D <- 3 + par <- runif(D, min=-1, max=1) + fn <- function(x) { + weight <- instance + return(weight * f_rastrigin(x) + (1 - weight) * f_rosenbrock(x)) + } + res <- optim(par,fn, method="SANN", + control=list(maxit=5000 + , tmax = as.numeric(candidate$values[["tmax"]]) + , temp = as.numeric(candidate$values[["temp"]]) + )) + return(res$value) + } > > ## We are now ready to launch irace. We do it by means of the irace > ## function by setting hookRun to the function define above, instances to > ## the first 100 random weights, and a maximum budget of 1000 calls to > ## hookRun. The function irace will print information about its > ## progress. > result <- irace(tunerConfig = list( + hookRun = hook.run, + instances = weights[1:100], + maxExperiments = 1000), + parameters = parameters) Error in file.check(configuration$execDir, isdir = TRUE, text = "execution directory") : execution directory 'd:/Rcompile/CRANpkg/local/2.13/irace.Rcheck/./' does not exist Calls: irace -> checkConfiguration -> file.check Execution halted