Description Class Hierarchy Constructor Slots Methods Author(s) References Examples
The mtkExpWorkflow
class is used to coordinate the processes involved in a sensitivity analysis. It controls the state of the processes and coordinates their chaining.
mtkExpWorkflow
signature(expFactors=NULL, processesVector=NULL, xmlFilePath=NULL)
expFactors
:(mtkExpFactors
) an object of the mtkExpFactors
class.
processesVector
:(vector
) a vector of objects from the class mtkProcess
or its sub-classes.
addProcess
signature(this = "mtkExpWorkflow", p = "mtkProcess", name = "character"): Adds a process to the workflow.
deleteProcess
signature(this = "mtkExpWorkflow", name = "character"): Deletes a process from the workflow.
setProcess
signature(this = "mtkExpWorkflow", p = "mtkProcess", name = "character"): Replaces a process into the workflow.
getProcess
signature(this = "mtkExpWorkflow", name = "character"): Gets a process from the workflow.
extractData
signature(this = "mtkExpWorkflow", name = "list"): Returns the results produced by the workflow as a data.frame. According to the processes specified with the argument "name", we can fetch the results produced by the process "design", "evaluate" or "analyze". i.e. name=c("design") gives the experimental design produced by the process "design" and name=c("design","evaluate") gives both the experimental design and the model simulation, etc.
reevaluate
signature(this = "mtkExpWorkflow", name = "character"): Re-evaluate the processes of the workflow to know if they should be re-run. This should be done after changing a process of the workflow. According to the order "design", evaluate", "analyze", only the processes after the one given by the argument "name" will be re-evaluated.
run
signature(this = "mtkExpWorkflow", context= "missing"): Runs the workflow.
serializeOn
signature(this = "mtkExpWorkflow"): Returns all data managed by the workflow as a named list.
summary
signature(object = "mtkExpWorkflow"): Provides a summary of the results produced by the workflow.
print
signature(x = "mtkExpWorkflow"): Prints a report of the results produced by the workflow.
plot
signature(x = "mtkExpWorkflow"): Plots the results produced by the workflow.
report
signature(this = "mtkExpWorkflow"): Reports the results produced by the workflow.
Juhui WANG, MIA-Jouy, Inra, Juhui.Wang@jouy.inra.fr
J. Wang, H. Richard, R. Faivre, H. Monod (2013). Le package mtk
, une bibliothèque R pour l'exploration numérique des modèles.
In: Analyse de sensibilité et exploration de modèles : Application aux sciences de la nature et de l'environnement
(R. Faivre, B. Iooss, S. Mahévas, D. Makowski, H. Monod, Eds). Editions Quae, Versailles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | ##############
# Example 1: Construct a workflow
# from the factors and the processes
##############
# Specify the factors
x1 <- make.mtkFactor(name="x1", distribName="unif",
distribPara=list(min=-pi, max=pi))
x2 <- make.mtkFactor(name="x2", distribName="unif",
distribPara=list(min=-pi, max=pi))
x3 <- make.mtkFactor(name="x3", distribName="unif",
distribPara=list(min=-pi, max=pi))
ishi.factors <- mtkExpFactors(list(x1,x2,x3))
# Define the processes
designer <- mtkNativeDesigner("BasicMonteCarlo",
information=list(size=20))
model <- mtkNativeEvaluator("Ishigami" )
analyser <- mtkNativeAnalyser("Regression", information=list(nboot=20) )
# Build the workflow
ishiReg <- mtkExpWorkflow( expFactors=ishi.factors,
processesVector=c( design=designer,
evaluate=model,
analyze=analyser)
)
# Run the workflow and report the results
run(ishiReg)
summary(ishiReg)
##############
######## Example 2: Construct a workflow from a XML file
##############
# # XML file is held in the directory of the library: "inst/extdata/"
# Specify the XML file's name
xmlFile <- "WWDM_morris.xml"
## find where the examples are held.
xmlFilePath <- paste(path.package("mtk", quiet = TRUE),
"/extdata/",xmlFile,sep = "")
# Create the workflow from the XML
## Nota: If your XML file is local
## file for example /var/tmp/X.xml", you should
## create the workflow as follows:
## workflow <- mtkExpWorkflow(
## xmlFilePath = "/var/tmp/X.xml"
## )
workflow <- mtkExpWorkflow(xmlFilePath=xmlFilePath)
# Run the workflow and report the results
run(workflow)
summary(workflow)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.