User Tools

Site Tools


documentation:automation

Automation

What is it ?

An Automation is a mechanism to replay a specific scenario which has been already defined. Automation can be used :

  • as a replacement of the save function
  • to do variations on the model input parameters.

Automation supports input variations. This allow to play the same scenario with different parameters combination. This can be usefull to do for instance a sensitivity analysis on a particular model.

Create an Automation

  1. Create your scenario as usual
  2. Export your scenario : Menu Project → Automation → Export/Run

GUI

Menu Project → Automation → Import

  • Event: the list of automation event. Select one to edit the corresponding parameters.
  • Parameters
    • Value: the default value for a parameter.
    • Variation: a comma separated list of value for a parameter.
  • Plan: the type of parameter combination.
  • Threads: number of threads to use to run the simulations in parallel.
  • Max Simu: maximum number of simulation to run (used by random plan).
  • Show project: show project in the project manager. In this case the project is kept in memory.
  • Show summary: show a tab list of output (see model summary).
  • Save: save the automation parameters in an XML file.
  • Run: execute the simulations.
  • Help: this page.

Plan

  • OrderedPlan: do the simulation by taking the parameters in the list order. The number of simulation is equal to the largest parameter list.
  • CompletePlan: generate all possible combinations with the list of parameters.
  • RandomPlan: choose randomly a parameter in the list of values.

Variable

You can use internal variable in the string values:

  • ${root}: capsis root
  • ${name}: project name

To generate a list of values at once, use the following syntax: [inf:sup:step]. Example: [2.0:3.0:0.2] will generate 2.0, 2.2, 2.4, 2.6, 2.8.

Console mode

To run an automation with 4 threads

Under linux:

sh capsis.sh -p automation tmp/test.xml 4 output.txt

Under windows

capsis -p automation tmp/test.xml 4 output.txt

Convert a model to support automation

Adapt the model

Adapt the InitialParameters and the EvolutionPameters class

The 2 classes should implement the interface Automatable

The class fields should be annotated to define how they should be processed.

  • @Ignore : not a parameter.
  • @Param : a parameter (optional).
  • @RecursiveParam : allows to edit sub object field.
  • @ListParam : allows to change list element.

Use the @Ignore annotation if a class field should not be considered as a parameter.

You will need to add these imports:

  • import jeeb.lib.util.annotation.*
  • import capsis.kernel.automation.Automatable

Exemple

class MyInitParam extends AbstractSettings implements  InitialParameters, Automatable {
 
   @Param
   public String filename;
 
   @RecursiveParam
   public PlotDescription plotDesc;
 
   @ListParam
   public List<TreePosition> treePositions;
 
   @Ignore
   public GScene stand;
 
}

Adapt the Extensions

The extension classes should also implement the Automatable interface. Class field should also be annotated.

Note : PaleoExtension are not supported.

documentation/automation.txt · Last modified: 2021/12/13 09:28 by 127.0.0.1