Running simulations from R

With local region

Since version, ISIS-Fish now includes a new command line action to run simulation with existing region and a random prescript file.

Here is the command line that can be used from R:

java -jar target/isis-fish-4.4.x.y.jar --simulationWithRegionNameAndScript simulationID regionName prescriptPath


  • simulationID : must be a unique simulation name
  • regionName: name a already existing region located in isis-fish-4/isis-database/region
  • prescriptPath: path to prescript file

Prescript example in sensitivity analysis context

In the prescript file, the context object (SimulationContext) can be used to modify simulation before execution.

Simulation parameters

Keep in mind that, using simulationWithRegionNameAndScript action, simulation parameters are totally empty (no population, no strategie, no effective...), so your prescript will have to valuate them.

But your can restore a default "" to avoid a lot of coding using

SimulationParameter params = context.getSimulationStorage().getParameter();
Properties props = new Properties();
props.load(new FileReader(new File("/path/to/simulation/")));

Manipulation region objects

Using context and database DAO (data access object), you can manipulate all your region objects. For example

GearDAO dao = context.getGearDAO();
Gear engin = dao.findByName("Senne");

Using matrix

You also can import or use Matrix to valuate your region's objects. For example, to change the capturability matrix of a specific population:

PopulationDAO pDao = context.getPopulationDAO();
Population pop = pDao.findByName("Anchois_long");
MatrixND mCap = pop.getCapturability();
mCap.importCSV(new FileReader("/path/to/csv/file.csv"), new int[] {0, 0});

Using simulation name

In case you need to use a dynamic parameter to generate or read external file in prescript depending of a specific simulation execution, you can use the simulation name:

String simulationName = context.getSimulationStorage().getName();