Algorithm Template

This simple algorithm implementation template aims at simplifying cross dissemination of developments.
Not a constraint, it may be taken as a proposal which helps spreading of ideas and ease exchange of GDR members practice.
It is intended to ship good practices for implementation of Computer Experiments algorithms, such as simulation decoupling and testability.

Basics:

Empty template files

See GitHub repository

Using template files

The template is primarily designed to be human readable.
Using any template file to perform a true design on an [external] simulation code is simple as running in your environment (R, matlab, python, ...) the following sequence:

If the simulation code is not an external software, but a function available in the environment, the previous sequence may be run using a simple script:
<code r>
MyCode = function(X) { ... return(Y) }
source("MyAlgorithm.R")

options = list(nmax = 100, delta = 0.1, epsilon = 0.01, ...)
algorithm = MyAlgorithm(options)

X0 = getInitialDesign(algorithm, ...)
Y0 = MyCode(X0)
Xi = X0
Yi = Y0

finished = FALSE
while (!finished) {
Xj = getNextDesign(algorithm,Xi,Yi) if (is.null(Xj) | length(Xj) == 0) { finished = TRUE } else { Yj = MyCode(Xj) Xi = rbind(Xi,Xj) Yi = rbind(Yi,Yj) }}

print(displayResults(algorithm,Xi,Yi))
</code>

Some algorithms template files

(See GitHub repository)