7.3. Running the model

OSMOSE Java can be run from R by using the run_osmose function.


# recover the reference configuration file
filename = system.file(package="osmose", "extdata", "master", "osm_all-parameters.csv")

# setting output directory
outdir = 'output'

# default run mode (java file in inst/java/)
run_osmose(input=fileName, output=outdir)

By default, the OSMOSE Java included in the package is used. However, the user is free to use another build of the OSMOSE Java program as follows:

# Running Osmose by using another version of the .jar file.
jarfile = "/home/nbarrier/Modeles/osmose/svn-osmose/trunk/dist/osmose-trunk.jar"
run_osmose(osmose=jarfile, input=fileName, 
          output=outdir, version="4")


The way the OSMOSE Java core is called has changed between versions 3 and 4. As a consequence, the user must be sure to properly set the version argument.