From 20ad31a5c08a876225584300f906d27158af0fce Mon Sep 17 00:00:00 2001 From: Daniel Vedder <daniel.vedder@idiv.de> Date: Fri, 25 Nov 2022 13:23:57 +0100 Subject: [PATCH] Updated README.md --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 62d9620..5d67c81 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,63 @@ Persephone models farmers' decision making and its impact on species in agricult landscapes. The aim is to investigate how policies such as the CAP influence farms and biodiversity. -It is currently in the very early stages of development. +The model is based on the [Agents.jl](https://juliadynamics.github.io/Agents.jl/stable/) +framework. It is currently in the very early stages of development. ## Usage +### Installation + Install the latest version of the [Julia](https://julialang.org/downloads/) programming language. The recommended editors are [VSCode](https://www.julia-vscode.org/) or [Emacs](https://www.emacswiki.org/emacs/JuliaProgrammingLanguage) (see `docs/editors.md`). To install package dependencies, open a Julia REPL in this folder and run `using Pkg; Pkg.activate("."); Pkg.instantiate()`. -Run the simulation by executing `run.jl` from the commandline, or loading it from -within a Julia REPL with `include("run.jl")`. +### Running from the commandline + +This is the normal mode of operation. Simply execute `run.sh`, typically like so (in Linux): + +``` +> ./run.sh -c <config> +``` + +where `<config>` specifies the configuration file to use. The full list of commandline +arguments is: + +``` +usage: run.jl [-c CONFIGFILE] [-s SEED] [-m MAPFILE] [-o OUTDIR] + [-l LOGLEVEL] [-r RUNTIME] [--version] [-h] + +optional arguments: + -c, --configfile CONFIGFILE + name of the configuration file + -s, --seed SEED inital random seed (type: Int64) + -m, --mapfile MAPFILE + name of the map file + -o, --outdir OUTDIR location of the output directory + -l, --loglevel LOGLEVEL + verbosity: "debug", "info", or "errors" + -r, --runtime RUNTIME + duration in days that the simulation will run + (type: Int64) + --version show version information and exit + -h, --help show this help message and exit + +``` + +### Running from within Julia + +To use the model from within Julia (either inside an interactive REPL or if you want +to import it from your own software), do the following: + +```julia +using Pkg +Pkg.activate(".") # assuming you're in the Persephone root folder +using Persephone +``` -This model uses the [Agents.jl](https://juliadynamics.github.io/Agents.jl/stable/) framework. +You can then access all Persephone functions, such as `simulate()`. --- -- GitLab