The Capsis training online
Try to work with the helping elements before looking at the solution…
Helping elements
training.myscripts.SimpleScript
capsis4/data/training/
and change the input file name and location by analogy with the existing codescript.init (ip)
, add a line to change the value of ip.regenerationMax
to 5script.init (ip)
triggers the initialisation process (buildInitScene()
+ initializeModel()
), just after, the root step is availablescript
:script.getRoot ()
returns the root stepscript.getProject ()
returns the projectscript.getModel ()
returns the model connected to the project (here an instance of TraModel)script.getRootDir ()
returns the location of the capsis4/ installation directoryscript.evolve()
script.runIntervener (intervener, step)
script.runOFormat (export, step, fileName)
GScript
superclass of C4Script
script.init (ip)
, make a loop for 100 years in which you may:SimpleScript
import capsis.kernel.extensiontype.*; import capsis.extension.intervener.*; (...) // Intervention: cut tree between 5 and 15m height Intervener thinner = new DHAThinner (DHAThinner.HEIGHT, 5, 15); step = s.runIntervener (thinner, step);
DETimeN
graph in Capsis' user interfacecapsis4/
directorySimpleScript
DETimeN
graph to check the simulationA possible solution