mtkExpWorkflow: The constructor of the class 'mtkExpWorkflow'

Description Usage Arguments Value Author(s) References Examples

Description

The class mtkExpWorkflow is used to manage the processes involved in a sensitivity analysis. We can construct a workflow in two ways: either from pre-defined factors and processes or from a XML file.

Usage

1
2
3
4
5
	mtkExpWorkflow(
		expFactors = NULL, 
		processesVector = NULL, 
		xmlFilePath = NULL
		)

Arguments

expFactors

(mtkExpFactors) an object of the mtkExpFactors class.

processesVector

(vector) a vector of objects from the class mtkProcess or its sub-classes.

xmlFilePath

(character) a string holding the name of the XML file and its path.

Value

an object of the mtkExpWorkflow class

Author(s)

Juhui WANG, MIA-Jouy, Inra, Juhui.Wang@jouy.inra.fr

References

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.

Examples

 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
############## 
# Example 1: Construct a workflow 
# from the factors and the processes
##############

	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))


	designer <- mtkNativeDesigner("BasicMonteCarlo", 
            information=list(size=20))
	model <- mtkNativeEvaluator("Ishigami" )
	analyser <- mtkNativeAnalyser("Regression", information=list(nboot=20) )

	ishiReg <- mtkExpWorkflow(expFactors=ishi.factors,
		   processesVector=c( design=designer,
				      evaluate=model,
				      analyze=analyser)
			  				)
	run(ishiReg)
	summary(ishiReg)

############## 
######## Example 2: Construct a workflow from a XML file
##############
# Create a workflow from XML file
	## Nota: If your XML file is a local file
	## for example /var/tmp/X.xml", you should
	## create the workflow as follows: 
	## workflow <- mtkExpWorkflow(
	##   xmlFilePath="/var/tmp/X.xml"
	## )


	xmlFile <- "WWDM_morris.xml"
	
	## If WWDM_morris.xml is a local file, the next line is not necessary.
	xmlFilePath <- paste(path.package("mtk", quiet = TRUE),
		"/extdata/",xmlFile,sep = "") 

	workflow <- mtkExpWorkflow(xmlFilePath=xmlFilePath)

# Run the workflow and report the results
	run(workflow)
	summary(workflow)

mtk documentation built on May 2, 2019, 4:15 a.m.