From 6a86a4348c4bc484215f1d8b7d8a6a1080602dc4 Mon Sep 17 00:00:00 2001
From: Daniel Vedder <daniel.vedder@idiv.de>
Date: Tue, 29 Nov 2022 13:35:27 +0100
Subject: [PATCH] Wrote test.sh for development purposes

---
 run.jl                        |  2 +-
 src/analysis/analyse_nature.R |  4 ++--
 src/nature/wolpertinger.jl    |  2 +-
 src/parameters.toml           |  2 +-
 test.sh                       | 11 +++++++++++
 5 files changed, 16 insertions(+), 5 deletions(-)
 create mode 100755 test.sh

diff --git a/run.jl b/run.jl
index 51bc232..4dbf6d2 100755
--- a/run.jl
+++ b/run.jl
@@ -7,4 +7,4 @@ using Pkg
 Pkg.activate(".")
 using Persephone
 
-simulate()
+@time simulate()
diff --git a/src/analysis/analyse_nature.R b/src/analysis/analyse_nature.R
index d3b9be8..4629aa9 100755
--- a/src/analysis/analyse_nature.R
+++ b/src/analysis/analyse_nature.R
@@ -12,7 +12,7 @@ library(terra)
 
 autorun = TRUE ## automatically run all analyses?
 
-datadir = "results" ## "results" by default
+datadir = "test_results" ## "results" by default
 popfile = "populations.csv"
 indfile = "individuals.csv"
 mapfile = "landcover_jena.tif"
@@ -26,7 +26,7 @@ populationTrends = function() {
         mutate(Date = as.POSIXct(strptime(Date,format="%Y-%m-%d")))
     ggplot(data=popdata, aes(x=Date, y=Abundance, color=Species)) +
         geom_point() +
-        geom_smooth() +
+        ##geom_smooth() +
         scale_color_viridis_d() +
         theme_bw()
     ggsave(paste0(datadir, "/", population_output_file, ".pdf"), width=8, height=4)
diff --git a/src/nature/wolpertinger.jl b/src/nature/wolpertinger.jl
index f426ba8..f22abc6 100644
--- a/src/nature/wolpertinger.jl
+++ b/src/nature/wolpertinger.jl
@@ -47,5 +47,5 @@ newspecies("Wolpertinger",
            updatewolpertinger!,
            Dict("popdensity"=>1/10000,
                 "birthenergy"=>400,
-                "fecundity"=>0.02,
+                "fecundity"=>0.01,
                 "maxspeed"=>5))
diff --git a/src/parameters.toml b/src/parameters.toml
index d0032e3..1f8a75b 100644
--- a/src/parameters.toml
+++ b/src/parameters.toml
@@ -15,7 +15,7 @@ loglevel = "debug" # verbosity level: "debug", "info", "quiet"
 seed = 0 # seed value for the RNG (0 -> random value)
 # dates to start and end the simulation
 startdate = 2020-01-01
-enddate = 2020-01-31
+enddate = 2020-12-31
 
 [farm]
 
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..15fb6c9
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+## A short shell script to test the current development version of Persephone.
+
+if [[ -d "test_results" ]]
+then
+    rm -r test_results
+fi
+
+./run.jl -o test_results -s 1
+
+src/analysis/analyse_nature.R
-- 
GitLab