Back to Documentation/Tutorial

Using reporting tool (experimental)

This tutorial is the continuation of the first step on wrapping groovy model. You can either do this step or load this file.

Exploring the K input

  • Create K input as a double
  • Create c factor as a range of double from 5 to 30 by step of 5
  • link factor.c and input.K

Writing results into a file

  • Add a "GroovyProcessor" processor by right clicking the "Output_processing" node.
  • Copy and Paste the following code in order to dump model output into .dat file.
/* Dump data into .dat file */
def r = 20
def K = 30
def C = 20
def n = input.n
def p = input.p
def filename = System.getProperty('user.home') + '/Desktop/SE_tutoriel_output/'
new File(filename).mkdir()
filename += "r_K_C_" + r + "_" + K + "_" + C + "_data/"
new File(filename).mkdir()
filename += "p_n_" + p + "_" + n + "_data.dat"
f = new File(filename)
f.write("p\tn\n")
output.trajectory.each{ 
  f << it.p << "\t" << it.n << "\n"
}
  • Run the design and check that file are well created on your Desktop.

Disabling some processor

In order to reuse existing results without computing them again, we propose you to disable some processors.

  • Display the Properties Tab clicking menu Window>Properties
  • Select the Model_launcher GroovyProcessor on the Applications frame
  • Uncheck its Run property in the GroovyProcessor - Properties frame
  • Disable the Output_processing GroovyProcessor

Generating PDF report

This step require to install R and its Sweave component. It also require pdflatex compiler.

  • Download template files (templ_report.tex, templ_section.tex, templ_phase.R) in your Desktop/SE_tutoriel_output just created directory.
  • Replace the "Final_processing" content using the following code.
  • Don't forget to adapt the r.rCmd, r.pdflatexCmd, r.pdfviewerCmd using your own system configuration.
/* Generating PDF report */
import org.simexplorer.report.ReportFactory
r = ReportFactory.getInstance()
r.setRoot(System.getProperty('user.home') + '/Desktop/SE_tutoriel_output/')
r.rCmd = "R"
r.pdflatexCmd = "pdflatex"
r.pdfviewerCmd = "evince"
r.setStudyName("Predator_Prey_Model")
r.addDepthTemplates(0, "report", "templ_report.tex");
r.addDepthTemplates(1, "section", "templ_section.tex");
r.addDepthTemplates(2, "phase", "templ_phase.R");
println r.compute()

Retrieve the final content of the application using this file.

logo cemagref

logo iscpif

logo lifegrid

logo region auvergne

logo patres project