Learn R Programming

mtk (version 1.0)

run-methods: The run method

Description

Runs a task defined in a process or workflow. Examples classes in which this function is implemented are the following: [mtkParsor], [mtkExpWorkflow], [mtkProcess] and their sub-classes . Examples of "run" are:
  • run(this, context)"this" is an object of class [mtkNativeDesigner], and "context" is an object of class [mtkExpWorkflow].
  • run(this, context)"this" is an object of class [mtkParsor], and "context" is an object of class [mtkExpWorkflow].

Usage

run(this,context)

Arguments

this
an object corresponding to the task to launch. It may be an object of the following classes: [mtkParsor], [mtkExpWorkflow], [mtkProcess] or their sub-classes.
context
missing or an object specifying the context which manages the task. It may be an object of the following classes: [mtkExpWorkflow] or its sub-classes.

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
# Create a designer and an analyser avec the method "Morris"
# to analyze the model "Ishigami":

# Specify the factors to analyze:
	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)) 
	factors <- mtkExpFactors(list(x1,x2,x3)) 

# Build the processes:
#   1) the experimental design process with the method "Morris".
		exp1.designer <- mtkNativeDesigner(design="Morris", 
	      information=list(r=20,type="oat",levels=4,grid.jump=2)) 

#   2) the model simulation process with the model "Ishigami".
		exp1.evaluator <- mtkNativeEvaluator(model="Ishigami") 

#   #   3) the analysis process with the default method.
#      Here, it is the Morris method.
		exp1.analyser <- mtkDefaultAnalyser()

# Build the  workflow with the processes defined previously.
		exp1 <- mtkExpWorkflow(expFactors=factors,
	   	 processesVector = c(design=exp1.designer,
			evaluate=exp1.evaluator, analyze=exp1.analyser))
# Run the workflow and plot the results.
		run(exp1)
		print(exp1)

Run the code above in your browser using DataLab