fn = makeBBOBFunction(dimensions = 2L, fid = 1L, iid = 1L)
fn = addCountingWrapper(fn)
# we get a value of 0 since the function has not been called yet
print(getNumberOfEvaluations(fn))
# now call the function 10 times consecutively
for (i in seq(10L)) {
fn(runif(2))
}
print(getNumberOfEvaluations(fn))
# Here we pass a (2x5) matrix to the function with each column representing
# one input vector
x = matrix(runif(10), ncol = 5L)
fn(x)
print(getNumberOfEvaluations(fn))
Run the code above in your browser using DataLab