Learn R Programming

mtk (version 1.0)

addProcess-methods: The addProcess method

Description

Adds a process to the workflow.

Usage

addProcess(this,p,name)

Arguments

this
an object of the class mtkExpWorkflow.
p
an object of the class mtkProcess.
name
a string from "design", "evaluate", or "analyze" to specify the type of process to add.

Value

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

Run this code

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

# Create a workflow to manager the processes used for the analysis task

	ishiReg <- mtkExpWorkflow(expFactors=ishi.factors)

# Create a designer to generate the experiments design and
# put the designer under control of the workflow

	designer <- mtkNativeDesigner("BasicMonteCarlo", 
            information=list(size=20))

	addProcess(ishiReg, designer, name="design")

	# Creates an evaluator and add it to the workflow

	model <- mtkNativeEvaluator("Ishigami" )

	addProcess(ishiReg, model, name="evaluate")

# Create a analyser and add it to the workflow

	analyser <- mtkNativeAnalyser("Regression" )

	addProcess(ishiReg, analyser, name="analyze")

# Run the workflow and reports the results

	run(ishiReg)
	summary(ishiReg)

Run the code above in your browser using DataLab