Hi Dan,
Is `myfunction(instance, configuration, method=1)` returning a list that contains "value" ? The problem seems to be in `myfunction` and the `incorrect number of dimensions` seems to happen inside your `myfunction`.
This code is also wrong:
instances = data[1:500,],
instances must be either a one dimensional vector or a list. If you scenario only has one instance and this instance is represented by `data` then, you should do:
instances = list(data[1:500,])
Complete example:
library(irace)
data <- matrix(runif(1000), nrow=500)
# target runner function
target.runner <- function(experiment, scenario) {
instance <- experiment$instance
configuration <- experiment$configuration
# I'm not saying that doing this makes any sense, just illustrating how a matrix could be used as a single problem instance.
res <- list(value = instance[sample(nrow(x), 1), as.numeric(configuration[["mode"]])])
return(list(cost = res$value))
}
parameters <- readParameters(text='
mode "" c (1,2)
')
scenario <- list(targetRunner = target.runner,
instances = list(data[1:500,]),
maxExperiments = 200,
logFile = "")
checkIraceScenario(scenario, parameters = parameters)