RunDesign | R Documentation |
Call an external (to R) code wrapped through Funz environment.
RunDesign(
model = NULL,
input.files,
input.variables = NULL,
output.expressions = NULL,
design = NULL,
design.options = NULL,
run.control = list(force.retry = 2, cache.dir = NULL),
monitor.control = list(results.tmp = TRUE, sleep = 5, display.fun = NULL),
archive.dir = NULL,
out.filter = NULL,
verbosity = 1
)
model |
name of the code wrapper to use. See .Funz.Models global var for a list of possible values. |
input.files |
list of files to give as input for the code. |
input.variables |
list of variables definition in a String (for instance x1="[-1,1]"), or array of fixed values (will launch a design for each combination).#' @param all.combinations if FALSE, input.variables variables are grouped (default), else, if TRUE experiments are an expaanded grid of input.variables |
output.expressions |
list of interest output from the code. Will become the names() of return list. |
design |
Design of Experiments (DoE) given by its name (for instance ""). See .Funz.Designs global var for a list of possible values. |
design.options |
list of options to pass to the DoE. All options not given are set to their default values. Note that '_' char in names will be replaced by ' '. |
run.control |
list of control parameters: 'force.retry' is number of retries before failure, 'cache.dir' setup array of directories to search inside before real launching calculations. |
monitor.control |
list of monitor parameters: sleep (delay time between two checks of results), display.fun (function to display project cases status). |
archive.dir |
define an arbitrary output directory where results (cases, csv files) are stored. |
out.filter |
what output(s) to retreive in returned object. |
verbosity |
0-10, print information while running. |
list of array design and results from the code.
## Not run:
# Search for minimum of Branin function, taken as the model (test case)
install.Design("GradientDescent") # Download on github the GradientDescent algorithm
startCalculators(5) # start calculator instances to run model
RunDesign(model="R",
input.files=file.path(Funz:::FUNZ_HOME,"samples","branin.R"),
output.expressions="cat", design = "GradientDescent",
design.options = list(max_iterations=10),input.variables = list(x1="[0,1]",x2="[0,1]"))
# More realistic case using inversion of Modelica:
# find convection coefficient that gives minimal temperature of 40 degrees.
install.Model("Modelica") # Install Modelica plugin (Assumes that Modelica is already installed)
install.Design("Brent") # Install Brent algorithm for inversion
calcs = startCalculators(5) # Will start calculator instances, later used by Run()
NewtonCooling = RunDesign(model = "Modelica",
input.files = file.path(Funz:::FUNZ_HOME,"samples","NewtonCooling.mo.par"),
input.variables = list(convection="[0.0001,1]"), output.expressions = "min(T)",
design="Brent",design.options=list(ytarget=40.0))
plot(NewtonCooling$convection[[1]], NewtonCooling$`min(T)`[[1]])
abline(h=40.0)
abline(v=NewtonCooling$analysis.root)
stopCalculators(calcs) # Shutdown calculators (otherwise stay in background)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.