From b27fb1b4a30d0aeab50e8cf399d05c46f18af286 Mon Sep 17 00:00:00 2001
From: Daniel Vedder <daniel.vedder@idiv.de>
Date: Fri, 27 Oct 2023 11:24:54 +0200
Subject: [PATCH] Updated documentation

---
 docs/build/.documenter-siteinfo.json | 1 +
 docs/build/adapting.html             | 2 +-
 docs/build/architecture.html         | 2 +-
 docs/build/config.html               | 4 ++--
 docs/build/crops.html                | 2 +-
 docs/build/developing.html           | 2 +-
 docs/build/energy.html               | 2 +-
 docs/build/farm.html                 | 2 +-
 docs/build/gis.html                  | 4 ++--
 docs/build/gui.html                  | 4 ++--
 docs/build/index.html                | 2 +-
 docs/build/io.html                   | 2 +-
 docs/build/nature.html               | 6 +++---
 docs/build/odd.html                  | 2 +-
 docs/build/search_index.js           | 2 +-
 docs/build/simulation.html           | 2 +-
 docs/build/species-dsl.html          | 4 ++--
 docs/build/species.html              | 2 +-
 docs/build/using.html                | 4 ++--
 docs/builddocs.jl                    | 4 ++--
 docs/src/index.md                    | 6 +++---
 docs/src/using.md                    | 6 +++---
 22 files changed, 34 insertions(+), 33 deletions(-)
 create mode 100644 docs/build/.documenter-siteinfo.json

diff --git a/docs/build/.documenter-siteinfo.json b/docs/build/.documenter-siteinfo.json
new file mode 100644
index 0000000..cd5b0e1
--- /dev/null
+++ b/docs/build/.documenter-siteinfo.json
@@ -0,0 +1 @@
+{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-27T11:23:42","documenter_version":"1.1.2"}}
\ No newline at end of file
diff --git a/docs/build/adapting.html b/docs/build/adapting.html
index c28154d..5a5cd7d 100644
--- a/docs/build/adapting.html
+++ b/docs/build/adapting.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Adapting Persefone · Persefone</title><meta name="title" content="Adapting Persefone · Persefone"/><meta property="og:title" content="Adapting Persefone · Persefone"/><meta property="twitter:title" content="Adapting Persefone · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li class="is-active"><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developing</a></li><li class="is-active"><a href="adapting.html">Adapting Persefone</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="adapting.html">Adapting Persefone</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/adapting.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Adapting-Persefone"><a class="docs-heading-anchor" href="#Adapting-Persefone">Adapting Persefone</a><a id="Adapting-Persefone-1"></a><a class="docs-heading-anchor-permalink" href="#Adapting-Persefone" title="Permalink"></a></h1><p>A key development goal of Persefone is to be <a href="https://doi.org/10.1515/itit-2019-0040">FAIR</a>: <em>findable, accessible, interoperable, and reusable</em>. We aim to build a model that is both easy  to use and easy to adapt to new situations.</p><p>There are multiple ways to adapt Persefone for a new modelling study:</p><h3 id="Changing-the-parameters"><a class="docs-heading-anchor" href="#Changing-the-parameters">Changing the parameters</a><a id="Changing-the-parameters-1"></a><a class="docs-heading-anchor-permalink" href="#Changing-the-parameters" title="Permalink"></a></h3><p>The simplest way to adapt Persefone is simply by changing the parameters. Copy <code>src/parameters.toml</code> to a new location, adjust it to your needs, and run the model using <code>julia run.jl -c &lt;configfile&gt;</code>.</p><h3 id="Changing-the-region"><a class="docs-heading-anchor" href="#Changing-the-region">Changing the region</a><a id="Changing-the-region-1"></a><a class="docs-heading-anchor-permalink" href="#Changing-the-region" title="Permalink"></a></h3><p>To apply Persefone to a new region, you need to create new input maps of land cover and farmplots. How to do so is described <a href="gis.html">here</a>.</p><p><em>You may also need to change aspects of the <code>farm</code> submodel. This is not yet implemented.</em></p><h3 id="Adding-new-animal-species"><a class="docs-heading-anchor" href="#Adding-new-animal-species">Adding new animal species</a><a id="Adding-new-animal-species-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-new-animal-species" title="Permalink"></a></h3><p>To implement a new species to the <code>nature</code> submodel, add a new file to the  <code>src/nature/species</code> directory and <code>include</code> it in <code>src/Persefone.jl</code>, as well as adding the name of the species to the <code>nature.targetspecies</code> parameter. In the new file, implement the species using the <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a> syntax as described <a href="species-dsl.html">here</a>.</p><h3 id="Adding-new-crop-species"><a class="docs-heading-anchor" href="#Adding-new-crop-species">Adding new crop species</a><a id="Adding-new-crop-species-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-new-crop-species" title="Permalink"></a></h3><p><em>Crop growth is not yet implemented.</em></p><h3 id="Adding-new-farmer-behaviour"><a class="docs-heading-anchor" href="#Adding-new-farmer-behaviour">Adding new farmer behaviour</a><a id="Adding-new-farmer-behaviour-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-new-farmer-behaviour" title="Permalink"></a></h3><p><em>Farmer behaviour is not yet implemented.</em></p><h3 id="Adding-a-new-submodel"><a class="docs-heading-anchor" href="#Adding-a-new-submodel">Adding a new submodel</a><a id="Adding-a-new-submodel-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-a-new-submodel" title="Permalink"></a></h3><p>To add a new submodel in addition to the existing ones (<code>nature</code>, <code>crop</code>, and <code>farm</code>), you need to familiarise yourself with the <a href="architecture.html">software architecture</a>. In particular, you need to understand how initialisation and scheduling works in <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/simulation.jl"><code>src/core/simulation.jl</code></a>, and what information is stored in the <code>model</code> object.</p><p>If you want to add a new agent type, use Agents.jl&#39;s  <a href="https://juliadynamics.github.io/Agents.jl/stable/tutorial/#Agents.@agent"><code>@agent</code></a> macro. (But be aware that Persefone already has three agent types and you may encounter <a href="https://juliadynamics.github.io/Agents.jl/stable/performance_tips/#Avoid-Unions-of-many-different-agent-types-(temporary!)-1">performance problems</a>.) Having implemented the new agent type, add it to the <code>model</code> objects type definition and scheduler, and write an initialisation function and a <code>stepagent!</code> function. (See <a href="simulation.html#Persefone.initmodel-Tuple{Dict{String, Any}}"><code>Persefone.initmodel</code></a> and <a href="simulation.html#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>stepsimulation!</code></a> for details.)</p><h3 id="Linking-to-another-model"><a class="docs-heading-anchor" href="#Linking-to-another-model">Linking to another model</a><a id="Linking-to-another-model-1"></a><a class="docs-heading-anchor-permalink" href="#Linking-to-another-model" title="Permalink"></a></h3><p>Persefone can also be used as a software library and be called from another application. For this purpose, it is set up as a <a href="https://pkgdocs.julialang.org/v1/">Julia package</a>, with a <a href="https://docs.julialang.org/en/v1/manual/modules/">module</a> exporting various model functions, types, and macros (see  <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/Persephone.jl"><code>src/Persefone.jl</code></a>). Of particular interest are the functions <a href="simulation.html#Persefone.simulate"><code>simulate</code></a> (set up and run a complete simulation based on a config file), <a href="simulation.html#Persefone.initialise"><code>initialise</code></a> (create one or more <code>model</code> objects from a config file), <a href="simulation.html#Persefone.simulate!-Tuple{Agents.AgentBasedModel}"><code>simulate!</code></a> (do a simulation run with an existing <code>model</code> object), and <a href="simulation.html#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>stepsimulation!</code></a> (update a <code>model</code> object by one time step).</p><p>To interface with Julia from another language, see the Julia docs <a href="https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/">here</a> and <a href="https://docs.julialang.org/en/v1/manual/embedding/">here</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="developing.html">« Developing Persefone</a><a class="docs-footer-nextpage" href="architecture.html">Source code architecture »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Adapting Persefone · Persefone</title><meta name="title" content="Adapting Persefone · Persefone"/><meta property="og:title" content="Adapting Persefone · Persefone"/><meta property="twitter:title" content="Adapting Persefone · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li class="is-active"><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developer guide</a></li><li class="is-active"><a href="adapting.html">Adapting Persefone</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="adapting.html">Adapting Persefone</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/adapting.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Adapting-Persefone"><a class="docs-heading-anchor" href="#Adapting-Persefone">Adapting Persefone</a><a id="Adapting-Persefone-1"></a><a class="docs-heading-anchor-permalink" href="#Adapting-Persefone" title="Permalink"></a></h1><p>A key development goal of Persefone is to be <a href="https://doi.org/10.1515/itit-2019-0040">FAIR</a>: <em>findable, accessible, interoperable, and reusable</em>. We aim to build a model that is both easy  to use and easy to adapt to new situations.</p><p>There are multiple ways to adapt Persefone for a new modelling study:</p><h3 id="Changing-the-parameters"><a class="docs-heading-anchor" href="#Changing-the-parameters">Changing the parameters</a><a id="Changing-the-parameters-1"></a><a class="docs-heading-anchor-permalink" href="#Changing-the-parameters" title="Permalink"></a></h3><p>The simplest way to adapt Persefone is simply by changing the parameters. Copy <code>src/parameters.toml</code> to a new location, adjust it to your needs, and run the model using <code>julia run.jl -c &lt;configfile&gt;</code>.</p><h3 id="Changing-the-region"><a class="docs-heading-anchor" href="#Changing-the-region">Changing the region</a><a id="Changing-the-region-1"></a><a class="docs-heading-anchor-permalink" href="#Changing-the-region" title="Permalink"></a></h3><p>To apply Persefone to a new region, you need to create new input maps of land cover and farmplots. How to do so is described <a href="gis.html">here</a>.</p><p><em>You may also need to change aspects of the <code>farm</code> submodel. This is not yet implemented.</em></p><h3 id="Adding-new-animal-species"><a class="docs-heading-anchor" href="#Adding-new-animal-species">Adding new animal species</a><a id="Adding-new-animal-species-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-new-animal-species" title="Permalink"></a></h3><p>To implement a new species to the <code>nature</code> submodel, add a new file to the  <code>src/nature/species</code> directory and <code>include</code> it in <code>src/Persefone.jl</code>, as well as adding the name of the species to the <code>nature.targetspecies</code> parameter. In the new file, implement the species using the <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a> syntax as described <a href="species-dsl.html">here</a>.</p><h3 id="Adding-new-crop-species"><a class="docs-heading-anchor" href="#Adding-new-crop-species">Adding new crop species</a><a id="Adding-new-crop-species-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-new-crop-species" title="Permalink"></a></h3><p><em>Crop growth is not yet implemented.</em></p><h3 id="Adding-new-farmer-behaviour"><a class="docs-heading-anchor" href="#Adding-new-farmer-behaviour">Adding new farmer behaviour</a><a id="Adding-new-farmer-behaviour-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-new-farmer-behaviour" title="Permalink"></a></h3><p><em>Farmer behaviour is not yet implemented.</em></p><h3 id="Adding-a-new-submodel"><a class="docs-heading-anchor" href="#Adding-a-new-submodel">Adding a new submodel</a><a id="Adding-a-new-submodel-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-a-new-submodel" title="Permalink"></a></h3><p>To add a new submodel in addition to the existing ones (<code>nature</code>, <code>crop</code>, and <code>farm</code>), you need to familiarise yourself with the <a href="architecture.html">software architecture</a>. In particular, you need to understand how initialisation and scheduling works in <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/simulation.jl"><code>src/core/simulation.jl</code></a>, and what information is stored in the <code>model</code> object.</p><p>If you want to add a new agent type, use Agents.jl&#39;s  <a href="https://juliadynamics.github.io/Agents.jl/stable/tutorial/#Agents.@agent"><code>@agent</code></a> macro. (But be aware that Persefone already has three agent types and you may encounter <a href="https://juliadynamics.github.io/Agents.jl/stable/performance_tips/#Avoid-Unions-of-many-different-agent-types-(temporary!)-1">performance problems</a>.) Having implemented the new agent type, add it to the <code>model</code> objects type definition and scheduler, and write an initialisation function and a <code>stepagent!</code> function. (See <a href="simulation.html#Persefone.initmodel-Tuple{Dict{String, Any}}"><code>Persefone.initmodel</code></a> and <a href="simulation.html#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>stepsimulation!</code></a> for details.)</p><h3 id="Linking-to-another-model"><a class="docs-heading-anchor" href="#Linking-to-another-model">Linking to another model</a><a id="Linking-to-another-model-1"></a><a class="docs-heading-anchor-permalink" href="#Linking-to-another-model" title="Permalink"></a></h3><p>Persefone can also be used as a software library and be called from another application. For this purpose, it is set up as a <a href="https://pkgdocs.julialang.org/v1/">Julia package</a>, with a <a href="https://docs.julialang.org/en/v1/manual/modules/">module</a> exporting various model functions, types, and macros (see  <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/Persephone.jl"><code>src/Persefone.jl</code></a>). Of particular interest are the functions <a href="simulation.html#Persefone.simulate"><code>simulate</code></a> (set up and run a complete simulation based on a config file), <a href="simulation.html#Persefone.initialise"><code>initialise</code></a> (create one or more <code>model</code> objects from a config file), <a href="simulation.html#Persefone.simulate!-Tuple{Agents.AgentBasedModel}"><code>simulate!</code></a> (do a simulation run with an existing <code>model</code> object), and <a href="simulation.html#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>stepsimulation!</code></a> (update a <code>model</code> object by one time step).</p><p>To interface with Julia from another language, see the Julia docs <a href="https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/">here</a> and <a href="https://docs.julialang.org/en/v1/manual/embedding/">here</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="developing.html">« Developing Persefone</a><a class="docs-footer-nextpage" href="architecture.html">Source code architecture »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/architecture.html b/docs/build/architecture.html
index a0c76ed..e3600d0 100644
--- a/docs/build/architecture.html
+++ b/docs/build/architecture.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Source code architecture · Persefone</title><meta name="title" content="Source code architecture · Persefone"/><meta property="og:title" content="Source code architecture · Persefone"/><meta property="twitter:title" content="Source code architecture · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li class="is-active"><a class="tocitem" href="architecture.html">Source code architecture</a><ul class="internal"><li class="toplevel"><a class="tocitem" href="#Model-components"><span>Model components</span></a></li><li class="toplevel"><a class="tocitem" href="#Important-implementation-details"><span>Important implementation details</span></a></li></ul></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developing</a></li><li class="is-active"><a href="architecture.html">Source code architecture</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="architecture.html">Source code architecture</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/architecture.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Source-code-architecture"><a class="docs-heading-anchor" href="#Source-code-architecture">Source code architecture</a><a id="Source-code-architecture-1"></a><a class="docs-heading-anchor-permalink" href="#Source-code-architecture" title="Permalink"></a></h1><h1 id="Model-components"><a class="docs-heading-anchor" href="#Model-components">Model components</a><a id="Model-components-1"></a><a class="docs-heading-anchor-permalink" href="#Model-components" title="Permalink"></a></h1><p><img src="assets/architecture.png" alt="&quot;model architecture&quot;"/></p><p>Persefone is divided into four components, three of which are semi-independent submodels:</p><ol><li><p><code>core</code>: This is the foundation of the model software, which sets up and executes simulation runs. It also reads in the configuration file and landscape maps, and provides data output functionality. (Eventually, it will also provide weather data.)</p></li><li><p><code>nature</code>: This is an individual-based model of species in agricultural landscapes. It defines the <a href="nature.html#Persefone.Animal"><code>Animal</code></a> agent type, and a set of macros that can be used to rapidly create new species. It also includes ecological process functions that are useful for all species.</p></li><li><p><code>farm</code>: This is an agent-based model of farmer decision making. It is not yet implemented, but will provide the <a href="farm.html#Persefone.Farmer"><code>Farmer</code></a> agent type.</p></li><li><p><code>crop</code>: This is a mathematical growth model for various crops. It is not yet implemented, but already provides the agent type <a href="crops.html#Persefone.FarmPlot"><code>FarmPlot</code></a>, representing one field and its associated extent and crop type.</p></li></ol><p>Conceptually, <code>core</code> provides functionality that is needed by all of the submodels. Decisions made by <code>Farmer</code>s affect the <code>FarmPlot</code>s they own, and (directly or indirectly) the <code>Animal</code>s in the model landscape.</p><h1 id="Important-implementation-details"><a class="docs-heading-anchor" href="#Important-implementation-details">Important implementation details</a><a id="Important-implementation-details-1"></a><a class="docs-heading-anchor-permalink" href="#Important-implementation-details" title="Permalink"></a></h1><p><img src="assets/model_object.png" alt="&quot;the model object&quot;"/></p><h3 id="The-model-object"><a class="docs-heading-anchor" href="#The-model-object">The <code>model</code> object</a><a id="The-model-object-1"></a><a class="docs-heading-anchor-permalink" href="#The-model-object" title="Permalink"></a></h3><p>A cursory reading of the source code will quickly show that most functions take an  <code>AgentBasedModel</code> object as one of their arguments. This is the key data structure  of <a href="https://juliadynamics.github.io/Agents.jl/stable/tutorial/#.-The-model-1">Agents.jl</a>, and holds all state that is in any way relevant to a simulation run. (Persefone has a strict &quot;no global state&quot; policy to avoid state-dependent bugs and allow parallelisation.) The model object gives access to all agent instances (via <code>model[id]</code>, where <code>id</code> is the unique identifier of this agent). It also stores the configuration (<code>model.settings</code>), the landscape (<code>model.landscape</code>, a matrix of <a href="simulation.html#Persefone.Pixel"><code>Pixel</code></a> objects that store the local land cover, amongst other things), and the current simulation date (<code>model.date</code>). (See <a href="simulation.html#Persefone.initmodel-Tuple{Dict{String, Any}}"><code>Persefone.initmodel</code></a> for details.)</p><p>For more information about working with agent objects, see the  <a href="https://juliadynamics.github.io/Agents.jl/stable/api/">Agents.jl API</a>.</p><h3 id="Model-configuration/the-@param-macro"><a class="docs-heading-anchor" href="#Model-configuration/the-@param-macro">Model configuration/the <code>@param</code> macro</a><a id="Model-configuration/the-@param-macro-1"></a><a class="docs-heading-anchor-permalink" href="#Model-configuration/the-@param-macro" title="Permalink"></a></h3><p>The model is configured via a <a href="https://toml.io/en/">TOML</a> file, the default version of which is at  <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/parameters.toml"><code>src/parameters.toml</code></a>. An individual run can be configured using a user-defined configuration file, commandline arguments, or function calls (when Persefone is used as a package rather than an application). During a model run, the <a href="io.html#Persefone.@param-Tuple{Any}"><code>@param</code></a> macro can be used to access parameter values.  Note that parameter names are prepended with the name of the component they are associated  with. For example, the <code>outdir</code> parameter belongs to the <code>[core]</code> section of the TOML file,  and must therefore be referenced as  <code>@param(core.outdir)</code>. (See  <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/input.jl"><code>src/core/input.jl</code></a>  for details.)</p><div class="admonition is-info"><header class="admonition-header">@param and other macros</header><div class="admonition-body"><p>As <code>@param(parameter)</code> expands to <code>model.settings[&quot;parameter&quot;]</code>, it can obviously only be used in a context where the <code>model</code> object is actually available. (This is the case for most functions in Persefone, but not for all.) Similarly, many of the <code>nature</code> macros depend on specific variables being available where they are called, and can therefore only be used in specific contexts (this is indicated in their documentation).</p></div></div><h3 id="Output-data"><a class="docs-heading-anchor" href="#Output-data">Output data</a><a id="Output-data-1"></a><a class="docs-heading-anchor-permalink" href="#Output-data" title="Permalink"></a></h3><p>Persefone can output model data into text files with a specified frequency (daily, monthly, yearly, or at the simulation end). Submodels can use <a href="io.html#Persefone.newdataoutput!"><code>Persefone.newdataoutput!</code></a> to plug into this system. For an example of how to use  this, see <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/nature/ecologicaldata.jl"><code>src/nature/ecologicaldata.jl</code></a>.  (See <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/output.jl"><code>src/core/output.jl</code></a> for details.)</p><h3 id="Farm-events"><a class="docs-heading-anchor" href="#Farm-events">Farm events</a><a id="Farm-events-1"></a><a class="docs-heading-anchor-permalink" href="#Farm-events" title="Permalink"></a></h3><p>The <a href="simulation.html#Persefone.FarmEvent"><code>FarmEvent</code></a> struct is used to communicate farming-related events between  submodels. An event can be triggered with <a href="simulation.html#Persefone.createevent!"><code>createevent!</code></a> and affects all pixels  within a <a href="crops.html#Persefone.FarmPlot"><code>FarmPlot</code></a>. (See  <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/landscape.jl"><code>src/core/landscape.jl</code></a>  for details.)</p><h3 id="Random-numbers-and-logging"><a class="docs-heading-anchor" href="#Random-numbers-and-logging">Random numbers and logging</a><a id="Random-numbers-and-logging-1"></a><a class="docs-heading-anchor-permalink" href="#Random-numbers-and-logging" title="Permalink"></a></h3><p>By default in Julia, the <a href="https://docs.julialang.org/en/v1/stdlib/Random/">random number generator</a> (RNG) and the <a href="https://docs.julialang.org/en/v1/stdlib/Logging/#Logging.global_logger">system logger</a> are two globally accessible variables. As Persefone needs to avoid all global data (since this would interfere with reproducibility in parallel runs), the <code>model</code> object stores a  local logger and a local RNG. The local logger generally does not change the way the  model uses <a href="https://docs.julialang.org/en/v1/stdlib/Logging/">log statements</a>, it is  only relevant for some functions in <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/simulation.jl"><code>src/core/simulation.jl</code></a>.</p><div class="admonition is-info"><header class="admonition-header">Using the model RNG</header><div class="admonition-body"><p>Whenever you need to use a <a href="https://docs.julialang.org/en/v1/stdlib/Random/#Base.rand">random number</a>,  you must use the <code>model.rng</code>. The easiest way to do this is with the <a href="io.html#Persefone.@rand-Tuple"><code>@rand</code></a>  and <a href="io.html#Persefone.@shuffle!-Tuple{Any}"><code>@shuffle!</code></a> macros. (Note that these, too, require access to the <code>model</code> object.)</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="adapting.html">« Adapting Persefone</a><a class="docs-footer-nextpage" href="gis.html">Maps and weather data »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Source code architecture · Persefone</title><meta name="title" content="Source code architecture · Persefone"/><meta property="og:title" content="Source code architecture · Persefone"/><meta property="twitter:title" content="Source code architecture · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li class="is-active"><a class="tocitem" href="architecture.html">Source code architecture</a><ul class="internal"><li class="toplevel"><a class="tocitem" href="#Model-components"><span>Model components</span></a></li><li class="toplevel"><a class="tocitem" href="#Important-implementation-details"><span>Important implementation details</span></a></li></ul></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developer guide</a></li><li class="is-active"><a href="architecture.html">Source code architecture</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="architecture.html">Source code architecture</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/architecture.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Source-code-architecture"><a class="docs-heading-anchor" href="#Source-code-architecture">Source code architecture</a><a id="Source-code-architecture-1"></a><a class="docs-heading-anchor-permalink" href="#Source-code-architecture" title="Permalink"></a></h1><h1 id="Model-components"><a class="docs-heading-anchor" href="#Model-components">Model components</a><a id="Model-components-1"></a><a class="docs-heading-anchor-permalink" href="#Model-components" title="Permalink"></a></h1><p><img src="assets/architecture.png" alt="&quot;model architecture&quot;"/></p><p>Persefone is divided into four components, three of which are semi-independent submodels:</p><ol><li><p><code>core</code>: This is the foundation of the model software, which sets up and executes simulation runs. It also reads in the configuration file and landscape maps, and provides data output functionality. (Eventually, it will also provide weather data.)</p></li><li><p><code>nature</code>: This is an individual-based model of species in agricultural landscapes. It defines the <a href="nature.html#Persefone.Animal"><code>Animal</code></a> agent type, and a set of macros that can be used to rapidly create new species. It also includes ecological process functions that are useful for all species.</p></li><li><p><code>farm</code>: This is an agent-based model of farmer decision making. It is not yet implemented, but will provide the <a href="farm.html#Persefone.Farmer"><code>Farmer</code></a> agent type.</p></li><li><p><code>crop</code>: This is a mathematical growth model for various crops. It is not yet implemented, but already provides the agent type <a href="crops.html#Persefone.FarmPlot"><code>FarmPlot</code></a>, representing one field and its associated extent and crop type.</p></li></ol><p>Conceptually, <code>core</code> provides functionality that is needed by all of the submodels. Decisions made by <code>Farmer</code>s affect the <code>FarmPlot</code>s they own, and (directly or indirectly) the <code>Animal</code>s in the model landscape.</p><h1 id="Important-implementation-details"><a class="docs-heading-anchor" href="#Important-implementation-details">Important implementation details</a><a id="Important-implementation-details-1"></a><a class="docs-heading-anchor-permalink" href="#Important-implementation-details" title="Permalink"></a></h1><p><img src="assets/model_object.png" alt="&quot;the model object&quot;"/></p><h3 id="The-model-object"><a class="docs-heading-anchor" href="#The-model-object">The <code>model</code> object</a><a id="The-model-object-1"></a><a class="docs-heading-anchor-permalink" href="#The-model-object" title="Permalink"></a></h3><p>A cursory reading of the source code will quickly show that most functions take an  <code>AgentBasedModel</code> object as one of their arguments. This is the key data structure  of <a href="https://juliadynamics.github.io/Agents.jl/stable/tutorial/#.-The-model-1">Agents.jl</a>, and holds all state that is in any way relevant to a simulation run. (Persefone has a strict &quot;no global state&quot; policy to avoid state-dependent bugs and allow parallelisation.) The model object gives access to all agent instances (via <code>model[id]</code>, where <code>id</code> is the unique identifier of this agent). It also stores the configuration (<code>model.settings</code>), the landscape (<code>model.landscape</code>, a matrix of <a href="simulation.html#Persefone.Pixel"><code>Pixel</code></a> objects that store the local land cover, amongst other things), and the current simulation date (<code>model.date</code>). (See <a href="simulation.html#Persefone.initmodel-Tuple{Dict{String, Any}}"><code>Persefone.initmodel</code></a> for details.)</p><p>For more information about working with agent objects, see the  <a href="https://juliadynamics.github.io/Agents.jl/stable/api/">Agents.jl API</a>.</p><h3 id="Model-configuration/the-@param-macro"><a class="docs-heading-anchor" href="#Model-configuration/the-@param-macro">Model configuration/the <code>@param</code> macro</a><a id="Model-configuration/the-@param-macro-1"></a><a class="docs-heading-anchor-permalink" href="#Model-configuration/the-@param-macro" title="Permalink"></a></h3><p>The model is configured via a <a href="https://toml.io/en/">TOML</a> file, the default version of which is at  <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/parameters.toml"><code>src/parameters.toml</code></a>. An individual run can be configured using a user-defined configuration file, commandline arguments, or function calls (when Persefone is used as a package rather than an application). During a model run, the <a href="io.html#Persefone.@param-Tuple{Any}"><code>@param</code></a> macro can be used to access parameter values.  Note that parameter names are prepended with the name of the component they are associated  with. For example, the <code>outdir</code> parameter belongs to the <code>[core]</code> section of the TOML file,  and must therefore be referenced as  <code>@param(core.outdir)</code>. (See  <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/input.jl"><code>src/core/input.jl</code></a>  for details.)</p><div class="admonition is-info"><header class="admonition-header">@param and other macros</header><div class="admonition-body"><p>As <code>@param(parameter)</code> expands to <code>model.settings[&quot;parameter&quot;]</code>, it can obviously only be used in a context where the <code>model</code> object is actually available. (This is the case for most functions in Persefone, but not for all.) Similarly, many of the <code>nature</code> macros depend on specific variables being available where they are called, and can therefore only be used in specific contexts (this is indicated in their documentation).</p></div></div><h3 id="Output-data"><a class="docs-heading-anchor" href="#Output-data">Output data</a><a id="Output-data-1"></a><a class="docs-heading-anchor-permalink" href="#Output-data" title="Permalink"></a></h3><p>Persefone can output model data into text files with a specified frequency (daily, monthly, yearly, or at the simulation end). Submodels can use <a href="io.html#Persefone.newdataoutput!"><code>Persefone.newdataoutput!</code></a> to plug into this system. For an example of how to use  this, see <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/nature/ecologicaldata.jl"><code>src/nature/ecologicaldata.jl</code></a>.  (See <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/output.jl"><code>src/core/output.jl</code></a> for details.)</p><h3 id="Farm-events"><a class="docs-heading-anchor" href="#Farm-events">Farm events</a><a id="Farm-events-1"></a><a class="docs-heading-anchor-permalink" href="#Farm-events" title="Permalink"></a></h3><p>The <a href="simulation.html#Persefone.FarmEvent"><code>FarmEvent</code></a> struct is used to communicate farming-related events between  submodels. An event can be triggered with <a href="simulation.html#Persefone.createevent!"><code>createevent!</code></a> and affects all pixels  within a <a href="crops.html#Persefone.FarmPlot"><code>FarmPlot</code></a>. (See  <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/landscape.jl"><code>src/core/landscape.jl</code></a>  for details.)</p><h3 id="Random-numbers-and-logging"><a class="docs-heading-anchor" href="#Random-numbers-and-logging">Random numbers and logging</a><a id="Random-numbers-and-logging-1"></a><a class="docs-heading-anchor-permalink" href="#Random-numbers-and-logging" title="Permalink"></a></h3><p>By default in Julia, the <a href="https://docs.julialang.org/en/v1/stdlib/Random/">random number generator</a> (RNG) and the <a href="https://docs.julialang.org/en/v1/stdlib/Logging/#Logging.global_logger">system logger</a> are two globally accessible variables. As Persefone needs to avoid all global data (since this would interfere with reproducibility in parallel runs), the <code>model</code> object stores a  local logger and a local RNG. The local logger generally does not change the way the  model uses <a href="https://docs.julialang.org/en/v1/stdlib/Logging/">log statements</a>, it is  only relevant for some functions in <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/src/core/simulation.jl"><code>src/core/simulation.jl</code></a>.</p><div class="admonition is-info"><header class="admonition-header">Using the model RNG</header><div class="admonition-body"><p>Whenever you need to use a <a href="https://docs.julialang.org/en/v1/stdlib/Random/#Base.rand">random number</a>,  you must use the <code>model.rng</code>. The easiest way to do this is with the <a href="io.html#Persefone.@rand-Tuple"><code>@rand</code></a>  and <a href="io.html#Persefone.@shuffle!-Tuple{Any}"><code>@shuffle!</code></a> macros. (Note that these, too, require access to the <code>model</code> object.)</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="adapting.html">« Adapting Persefone</a><a class="docs-footer-nextpage" href="gis.html">Maps and weather data »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/config.html b/docs/build/config.html
index f135f69..e81a9da 100644
--- a/docs/build/config.html
+++ b/docs/build/config.html
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Configuration · Persefone</title><meta name="title" content="Configuration · Persefone"/><meta property="og:title" content="Configuration · Persefone"/><meta property="twitter:title" content="Configuration · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li class="is-active"><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Manual</a></li><li class="is-active"><a href="config.html">Configuration</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="config.html">Configuration</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/config.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Configuration"><a class="docs-heading-anchor" href="#Configuration">Configuration</a><a id="Configuration-1"></a><a class="docs-heading-anchor-permalink" href="#Configuration" title="Permalink"></a></h1><p>Persefone requires three <a href="io.html">input</a> files: a configuration file and two map files.  How to generate the map files is documented <a href="gis.html">elsewhere</a>. The configuration file defines parameter values and looks like this (see <code>src/parameters.toml</code> for the default):</p><pre><code class="language-TOML hljs">### Persefone.jl - a model of agricultural landscapes and ecosystems in Europe.
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Configuration · Persefone</title><meta name="title" content="Configuration · Persefone"/><meta property="og:title" content="Configuration · Persefone"/><meta property="twitter:title" content="Configuration · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li class="is-active"><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">User guide</a></li><li class="is-active"><a href="config.html">Configuration</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="config.html">Configuration</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/config.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Configuration"><a class="docs-heading-anchor" href="#Configuration">Configuration</a><a id="Configuration-1"></a><a class="docs-heading-anchor-permalink" href="#Configuration" title="Permalink"></a></h1><p>Persefone requires three <a href="io.html">input</a> files: a configuration file and two map files.  How to generate the map files is documented <a href="gis.html">elsewhere</a>. The configuration file defines parameter values and looks like this (see <code>src/parameters.toml</code> for the default):</p><pre><code class="language-TOML hljs">### Persefone.jl - a model of agricultural landscapes and ecosystems in Europe.
 ###
 ### This is the default configuration file for Persefone, containing all model parameters.
 ### The syntax is described here: https://toml.io/en/
@@ -35,4 +35,4 @@ insectmodel = [&quot;season&quot;, &quot;habitat&quot;, &quot;pesticides&quot;,
 [crop]
 cropmodel = &quot;almass&quot; # crop growth model to use, &quot;almass&quot; or &quot;aquacrop&quot;
 cropfile = &quot;data/crops/almass/crop_data_general.csv&quot; # file with general crop parameters
-growthfile = &quot;data/crops/almass/almass_crop_growth_curves.csv&quot; # file with crop growth parameters	</code></pre><div class="admonition is-info"><header class="admonition-header">Parameter scanning</header><div class="admonition-body"><p>You can set any parameter to a list of different values, e.g. <code>seed = [1,2,3]</code>. Persefone will then set up and run multiple simulations, one for every possible combination of parameters that you entered (i.e. do a full-factorial simulation experiment).</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="gui.html">« Graphical User Interface</a><a class="docs-footer-nextpage" href="developing.html">Developing Persefone »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+growthfile = &quot;data/crops/almass/almass_crop_growth_curves.csv&quot; # file with crop growth parameters	</code></pre><div class="admonition is-info"><header class="admonition-header">Parameter scanning</header><div class="admonition-body"><p>You can set any parameter to a list of different values, e.g. <code>seed = [1,2,3]</code>. Persefone will then set up and run multiple simulations, one for every possible combination of parameters that you entered (i.e. do a full-factorial simulation experiment).</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="gui.html">« Graphical User Interface</a><a class="docs-footer-nextpage" href="developing.html">Developing Persefone »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/crops.html b/docs/build/crops.html
index 617ec0f..5359083 100644
--- a/docs/build/crops.html
+++ b/docs/build/crops.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Crop submodel · Persefone</title><meta name="title" content="Crop submodel · Persefone"/><meta property="og:title" content="Crop submodel · Persefone"/><meta property="twitter:title" content="Crop submodel · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li class="is-active"><a class="tocitem" href="crops.html">Crop submodel</a><ul class="internal"><li><a class="tocitem" href="#farmplot.jl"><span>farmplot.jl</span></a></li><li><a class="tocitem" href="#crops.jl"><span>crops.jl</span></a></li></ul></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="crops.html">Crop submodel</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="crops.html">Crop submodel</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/crops.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Crop-submodel"><a class="docs-heading-anchor" href="#Crop-submodel">Crop submodel</a><a id="Crop-submodel-1"></a><a class="docs-heading-anchor-permalink" href="#Crop-submodel" title="Permalink"></a></h1><p>Eventually, the plan is to have Persefone include a reimplementation of the AquaCrop model,  a well-established crop growth model developed by the FAO. Until then, we are using the crop growth submodel used in <a href="https://doi.org/10.1016/S0304-3800(03)00173-X">ALMaSS</a>.</p><h2 id="farmplot.jl"><a class="docs-heading-anchor" href="#farmplot.jl">farmplot.jl</a><a id="farmplot.jl-1"></a><a class="docs-heading-anchor-permalink" href="#farmplot.jl" title="Permalink"></a></h2><p>This file is responsible for the farm plots, i.e. the indidivual fields that farmers manage.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.FarmPlot" href="#Persefone.FarmPlot"><code>Persefone.FarmPlot</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">FarmPlot</code></pre><p>This represents one field, i.e. a collection of pixels with the same management. This is the spatial unit with which the crop growth model and the farm model work.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L8-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.averagefieldsize-Tuple{Agents.AgentBasedModel}" href="#Persefone.averagefieldsize-Tuple{Agents.AgentBasedModel}"><code>Persefone.averagefieldsize</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">averagefieldsize(model)</code></pre><p>Calculate the average field size in hectares for the model landscape.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L154-L158">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.cropheight</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">cropheight(model, position)</code></pre><p>Return the height of the crop at this position, or nothing if there is no crop here (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L190-L195">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.cropname-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.cropname-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.cropname</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">cropname(model, position)</code></pre><p>Return the name of the crop at this position, or nothing if there is no crop here (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L179-L184">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.croptype</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">croptype(model, position)</code></pre><p>Return the crop at this position, or nothing if there is no crop here (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L169-L173">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.growcrop!-Tuple{FarmPlot, Agents.AgentBasedModel}" href="#Persefone.growcrop!-Tuple{FarmPlot, Agents.AgentBasedModel}"><code>Persefone.growcrop!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">growcrop!(farmplot, model)</code></pre><p>Apply the relevant crop growth model to update the plants on this farm plot. Currently only supports the ALMaSS crop growth model by Topping et al.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L114-L119">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.harvest!-Tuple{FarmPlot, Agents.AgentBasedModel}" href="#Persefone.harvest!-Tuple{FarmPlot, Agents.AgentBasedModel}"><code>Persefone.harvest!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">harvest!(farmplot, model)</code></pre><p>Harvest the crop on this farmplot.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L96-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initfields!-Tuple{Agents.AgentBasedModel}" href="#Persefone.initfields!-Tuple{Agents.AgentBasedModel}"><code>Persefone.initfields!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initfields!(model)</code></pre><p>Initialise the model with its farm plots.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L26-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.sow!-Tuple{String, FarmPlot, Agents.AgentBasedModel}" href="#Persefone.sow!-Tuple{String, FarmPlot, Agents.AgentBasedModel}"><code>Persefone.sow!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">sow!(cropname, farmplot, model)</code></pre><p>Sow the specified crop on this farmplot.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L84-L88">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}" href="#Persefone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}"><code>Persefone.stepagent!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">stepagent!(farmplot, model)</code></pre><p>Update a farm plot by one day.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/farmplot.jl#L61-L65">source</a></section></article><h2 id="crops.jl"><a class="docs-heading-anchor" href="#crops.jl">crops.jl</a><a id="crops.jl-1"></a><a class="docs-heading-anchor-permalink" href="#crops.jl" title="Permalink"></a></h2><p>This includes the types and functions needed for all crop growth model, which are also referenced by the other submodels.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.CropCurveParams" href="#Persefone.CropCurveParams"><code>Persefone.CropCurveParams</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">CropCurveParams</code></pre><p>The values in this struct define one crop growth curve.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/crops.jl#L16-L20">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.CropType" href="#Persefone.CropType"><code>Persefone.CropType</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">CropType</code></pre><p>The type struct for all crops. Currently follows the crop growth model as implemented in ALMaSS.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/crops.jl#L30-L35">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.GrowthPhase" href="#Persefone.GrowthPhase"><code>Persefone.GrowthPhase</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">GrowthPhase</code></pre><p>ALMaSS crop growth curves are split into five phases, triggered by seasonal dates or agricultural events.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/crops.jl#L8-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Base.tryparse-Tuple{Type{Persefone.GrowthPhase}, String}" href="#Base.tryparse-Tuple{Type{Persefone.GrowthPhase}, String}"><code>Base.tryparse</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">Base.tryparse(type, str)</code></pre><p>Extend <code>tryparse</code> to allow parsing GrowthPhase values. (Needed to read in the CSV parameter file.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/crops.jl#L48-L53">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.buildgrowthcurve-Tuple{Vector{CSV.Row}}" href="#Persefone.buildgrowthcurve-Tuple{Vector{CSV.Row}}"><code>Persefone.buildgrowthcurve</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">buildgrowthcurve(data)</code></pre><p>Convert a list of rows from the crop growth data into a CropCurveParams object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/crops.jl#L63-L67">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.readcropparameters-Tuple{String, String}" href="#Persefone.readcropparameters-Tuple{String, String}"><code>Persefone.readcropparameters</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">readcropparameters(generalcropfile, cropgrowthfile)</code></pre><p>Parse a CSV file containing the required parameter values for each crop (as produced from the original ALMaSS file by <code>convert_almass_data.py</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/crop/crops.jl#L92-L97">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="species.html">« Species</a><a class="docs-footer-nextpage" href="farm.html">Farm submodel »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Crop submodel · Persefone</title><meta name="title" content="Crop submodel · Persefone"/><meta property="og:title" content="Crop submodel · Persefone"/><meta property="twitter:title" content="Crop submodel · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li class="is-active"><a class="tocitem" href="crops.html">Crop submodel</a><ul class="internal"><li><a class="tocitem" href="#farmplot.jl"><span>farmplot.jl</span></a></li><li><a class="tocitem" href="#crops.jl"><span>crops.jl</span></a></li></ul></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="crops.html">Crop submodel</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="crops.html">Crop submodel</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/crops.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Crop-submodel"><a class="docs-heading-anchor" href="#Crop-submodel">Crop submodel</a><a id="Crop-submodel-1"></a><a class="docs-heading-anchor-permalink" href="#Crop-submodel" title="Permalink"></a></h1><p>Eventually, the plan is to have Persefone include a reimplementation of the AquaCrop model,  a well-established crop growth model developed by the FAO. Until then, we are using the crop growth submodel used in <a href="https://doi.org/10.1016/S0304-3800(03)00173-X">ALMaSS</a>.</p><h2 id="farmplot.jl"><a class="docs-heading-anchor" href="#farmplot.jl">farmplot.jl</a><a id="farmplot.jl-1"></a><a class="docs-heading-anchor-permalink" href="#farmplot.jl" title="Permalink"></a></h2><p>This file is responsible for the farm plots, i.e. the indidivual fields that farmers manage.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.FarmPlot" href="#Persefone.FarmPlot"><code>Persefone.FarmPlot</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">FarmPlot</code></pre><p>This represents one field, i.e. a collection of pixels with the same management. This is the spatial unit with which the crop growth model and the farm model work.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L8-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.averagefieldsize-Tuple{Agents.AgentBasedModel}" href="#Persefone.averagefieldsize-Tuple{Agents.AgentBasedModel}"><code>Persefone.averagefieldsize</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">averagefieldsize(model)</code></pre><p>Calculate the average field size in hectares for the model landscape.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L154-L158">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.cropheight</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">cropheight(model, position)</code></pre><p>Return the height of the crop at this position, or nothing if there is no crop here (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L190-L195">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.cropname-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.cropname-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.cropname</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">cropname(model, position)</code></pre><p>Return the name of the crop at this position, or nothing if there is no crop here (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L179-L184">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.croptype</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">croptype(model, position)</code></pre><p>Return the crop at this position, or nothing if there is no crop here (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L169-L173">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.growcrop!-Tuple{FarmPlot, Agents.AgentBasedModel}" href="#Persefone.growcrop!-Tuple{FarmPlot, Agents.AgentBasedModel}"><code>Persefone.growcrop!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">growcrop!(farmplot, model)</code></pre><p>Apply the relevant crop growth model to update the plants on this farm plot. Currently only supports the ALMaSS crop growth model by Topping et al.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L114-L119">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.harvest!-Tuple{FarmPlot, Agents.AgentBasedModel}" href="#Persefone.harvest!-Tuple{FarmPlot, Agents.AgentBasedModel}"><code>Persefone.harvest!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">harvest!(farmplot, model)</code></pre><p>Harvest the crop on this farmplot.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L96-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initfields!-Tuple{Agents.AgentBasedModel}" href="#Persefone.initfields!-Tuple{Agents.AgentBasedModel}"><code>Persefone.initfields!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initfields!(model)</code></pre><p>Initialise the model with its farm plots.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L26-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.sow!-Tuple{String, FarmPlot, Agents.AgentBasedModel}" href="#Persefone.sow!-Tuple{String, FarmPlot, Agents.AgentBasedModel}"><code>Persefone.sow!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">sow!(cropname, farmplot, model)</code></pre><p>Sow the specified crop on this farmplot.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L84-L88">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}" href="#Persefone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}"><code>Persefone.stepagent!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">stepagent!(farmplot, model)</code></pre><p>Update a farm plot by one day.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/farmplot.jl#L61-L65">source</a></section></article><h2 id="crops.jl"><a class="docs-heading-anchor" href="#crops.jl">crops.jl</a><a id="crops.jl-1"></a><a class="docs-heading-anchor-permalink" href="#crops.jl" title="Permalink"></a></h2><p>This includes the types and functions needed for all crop growth model, which are also referenced by the other submodels.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.CropCurveParams" href="#Persefone.CropCurveParams"><code>Persefone.CropCurveParams</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">CropCurveParams</code></pre><p>The values in this struct define one crop growth curve.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/crops.jl#L16-L20">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.CropType" href="#Persefone.CropType"><code>Persefone.CropType</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">CropType</code></pre><p>The type struct for all crops. Currently follows the crop growth model as implemented in ALMaSS.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/crops.jl#L30-L35">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.GrowthPhase" href="#Persefone.GrowthPhase"><code>Persefone.GrowthPhase</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">GrowthPhase</code></pre><p>ALMaSS crop growth curves are split into five phases, triggered by seasonal dates or agricultural events.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/crops.jl#L8-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Base.tryparse-Tuple{Type{Persefone.GrowthPhase}, String}" href="#Base.tryparse-Tuple{Type{Persefone.GrowthPhase}, String}"><code>Base.tryparse</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">Base.tryparse(type, str)</code></pre><p>Extend <code>tryparse</code> to allow parsing GrowthPhase values. (Needed to read in the CSV parameter file.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/crops.jl#L48-L53">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.buildgrowthcurve-Tuple{Vector{CSV.Row}}" href="#Persefone.buildgrowthcurve-Tuple{Vector{CSV.Row}}"><code>Persefone.buildgrowthcurve</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">buildgrowthcurve(data)</code></pre><p>Convert a list of rows from the crop growth data into a CropCurveParams object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/crops.jl#L63-L67">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.readcropparameters-Tuple{String, String}" href="#Persefone.readcropparameters-Tuple{String, String}"><code>Persefone.readcropparameters</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">readcropparameters(generalcropfile, cropgrowthfile)</code></pre><p>Parse a CSV file containing the required parameter values for each crop (as produced from the original ALMaSS file by <code>convert_almass_data.py</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/crop/crops.jl#L92-L97">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="species.html">« Species</a><a class="docs-footer-nextpage" href="farm.html">Farm submodel »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/developing.html b/docs/build/developing.html
index a0bcdc1..8854c26 100644
--- a/docs/build/developing.html
+++ b/docs/build/developing.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Developing Persefone · Persefone</title><meta name="title" content="Developing Persefone · Persefone"/><meta property="og:title" content="Developing Persefone · Persefone"/><meta property="twitter:title" content="Developing Persefone · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li class="is-active"><a class="tocitem" href="developing.html">Developing Persefone</a><ul class="internal"><li><a class="tocitem" href="#Workflow"><span>Workflow</span></a></li><li><a class="tocitem" href="#Libraries"><span>Libraries</span></a></li><li><a class="tocitem" href="#Julia-editors"><span>Julia editors</span></a></li></ul></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developing</a></li><li class="is-active"><a href="developing.html">Developing Persefone</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="developing.html">Developing Persefone</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/developing.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Developing-Persefone"><a class="docs-heading-anchor" href="#Developing-Persefone">Developing Persefone</a><a id="Developing-Persefone-1"></a><a class="docs-heading-anchor-permalink" href="#Developing-Persefone" title="Permalink"></a></h1><h2 id="Workflow"><a class="docs-heading-anchor" href="#Workflow">Workflow</a><a id="Workflow-1"></a><a class="docs-heading-anchor-permalink" href="#Workflow" title="Permalink"></a></h2><ol><li><p>Pull the current version from the master branch on Gitlab:  <a href="https://git.idiv.de/xo30xoqa/persephone">https://git.idiv.de/xo30xoqa/persephone</a>.</p></li><li><p>If you are working on a new feature, create a new branch to avoid breaking the <code>master</code> branch. (The <code>master</code> branch on Github should always be in a runnable and error-free state.)</p></li><li><p>Implement your changes.</p></li><li><p>Run an example simulation and the test suite to make sure everything works without crashing (<code>make run</code> and <code>make test</code> on Linux, or execute <code>run.jl</code> and <code>test/runtests.jl</code> manually.)</p></li><li><p>Commit your work frequently, and try to keep each commit small. Don&#39;t forget to add relevant tests to the test suite.</p></li><li><p>Once your satisfied with your work, do another pull/merge from the <code>master</code> branch in case somebody else changed the branch in the meantime. Then merge your work into <code>master</code> and push to the Gitlab server.</p></li><li><p>Repeat :-)</p></li></ol><p>The Gitlab <a href="https://git.idiv.de/xo30xoqa/persephone/-/boards/373">issue tracker</a> can be used  to create, discuss, and assign tasks, as well as to monitor progress towards milestones/releases.  Once we have a first release, we will start using <a href="https://semver.org/">semantic versioning</a>.</p><h2 id="Libraries"><a class="docs-heading-anchor" href="#Libraries">Libraries</a><a id="Libraries-1"></a><a class="docs-heading-anchor-permalink" href="#Libraries" title="Permalink"></a></h2><h3 id="Agents.jl"><a class="docs-heading-anchor" href="#Agents.jl">Agents.jl</a><a id="Agents.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Agents.jl" title="Permalink"></a></h3><p>Our model uses <a href="https://juliadynamics.github.io/Agents.jl/stable/">Agents.jl</a> as a framework. Their <a href="https://github.com/JuliaDynamics/Agents.jl">repository</a> can be used to inspect the source code or submit bug reports (the authors are quick to respond). Questions can be asked at the  <a href="https://discourse.julialang.org/c/domain/models/21">Julia Discourse forum</a>.</p><p><em>Tutorial on collaborating on Julia packages:  <a href="https://www.matecdev.com/posts/julia-package-collaboration.html">https://www.matecdev.com/posts/julia-package-collaboration.html</a>.</em></p><h3 id="Revise.jl"><a class="docs-heading-anchor" href="#Revise.jl">Revise.jl</a><a id="Revise.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Revise.jl" title="Permalink"></a></h3><p><a href="https://timholy.github.io/Revise.jl/stable/"><code>Revise.jl</code></a> allows one to reload code without restarting the Julia interpreter. Get it with <code>Pkg.add(&quot;Revise&quot;)</code>, then  add <code>using Revise</code> to <code>.julia/config/startup.jl</code> to have it automatically available.</p><h3 id="Test"><a class="docs-heading-anchor" href="#Test">Test</a><a id="Test-1"></a><a class="docs-heading-anchor-permalink" href="#Test" title="Permalink"></a></h3><p>Persefone uses the inbuilt Julia <a href="https://docs.julialang.org/en/v1/stdlib/Test/">testing framework</a>. All new functions should have appropriate tests written for them in the appropriate file in the <code>test</code> directory. (See <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/test/runtests.jl"><code>test/runtests.jl</code></a> for details.) There are three ways to run the test suite: in the terminal, executing <code>make test</code> or <code>cd test; julia runtests.jl</code>; or in the Julia REPL,  <code>Pkg.activate(&quot;.&quot;); Pkg.test()</code>.</p><h3 id="Documenter.jl"><a class="docs-heading-anchor" href="#Documenter.jl">Documenter.jl</a><a id="Documenter.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Documenter.jl" title="Permalink"></a></h3><p>The HTML documentation is generated using <a href="https://documenter.juliadocs.org">Documenter.jl</a>. Therefore, all new functions should have docstrings attached. New files need to be integrated into the relevant documentation source files in <code>docs/src</code>, and if necessary into <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/docs/builddocs.jl"><code>docs/builddocs.jl</code></a>. To build the documentation, run <code>make docs</code>, or <code>cd docs; julia builddocs.jl</code> (if using the latter, don&#39;t forget to update the date and commit in <code>docs/src/index.md</code>).</p><h2 id="Julia-editors"><a class="docs-heading-anchor" href="#Julia-editors">Julia editors</a><a id="Julia-editors-1"></a><a class="docs-heading-anchor-permalink" href="#Julia-editors" title="Permalink"></a></h2><h3 id="Emacs"><a class="docs-heading-anchor" href="#Emacs">Emacs</a><a id="Emacs-1"></a><a class="docs-heading-anchor-permalink" href="#Emacs" title="Permalink"></a></h3><p>There are a couple of addons that make working with Julia much nicer in Emacs:</p><ol><li><p><code>julia-mode</code> gives syntax highlighting. Install with <code>M-x package-install julia-mode</code>.</p></li><li><p><a href="https://github.com/gcv/julia-snail"><code>julia-snail</code></a> provides IDE-like features,  especially a fully-functional REPL and the ability to evaluate code straight from inside a buffer. Note that the installation can be somewhat tricky. You first need to manually install all the dependencies of its dependency <a href="https://github.com/akermu/emacs-libvterm">vterm</a>, then install vterm itself with <code>M-x package-install vterm</code>, <em>before</em> you can do <code>M-x package-install julia-snail</code>. Then add it to your <code>init.el</code> with <code>(require &#39;julia-snail)</code> and <code>(add-hook &#39;julia-mode-hook #&#39;julia-snail-mode)</code>.</p></li><li><p><a href="http://company-mode.github.io/"><code>company-mode</code></a> integrates with Snail to give code  completion. Install with <code>M-x package-install company</code>, then add  <code>(add-hook &#39;julia-mode-hook #&#39;company-mode)</code> and  <code>(global-set-key (kbd &quot;C-&lt;tab&gt;&quot;) &#39;company-complete)</code> to your <code>init.el</code>.</p></li><li><p><a href="https://magit.vc/"><code>magit</code></a> is a great git interface for Emacs. Install with <code>M-x package-install magit</code> and add <code>(global-set-key (kbd &quot;C-x g&quot;) &#39;magit-status)</code> to your <code>init.el</code>.</p></li></ol><h3 id="VSCode"><a class="docs-heading-anchor" href="#VSCode">VSCode</a><a id="VSCode-1"></a><a class="docs-heading-anchor-permalink" href="#VSCode" title="Permalink"></a></h3><p>See <a href="https://www.julia-vscode.org/">here</a>.</p><p><em>TODO: add more detail.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="config.html">« Configuration</a><a class="docs-footer-nextpage" href="adapting.html">Adapting Persefone »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Developing Persefone · Persefone</title><meta name="title" content="Developing Persefone · Persefone"/><meta property="og:title" content="Developing Persefone · Persefone"/><meta property="twitter:title" content="Developing Persefone · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li class="is-active"><a class="tocitem" href="developing.html">Developing Persefone</a><ul class="internal"><li><a class="tocitem" href="#Workflow"><span>Workflow</span></a></li><li><a class="tocitem" href="#Libraries"><span>Libraries</span></a></li><li><a class="tocitem" href="#Julia-editors"><span>Julia editors</span></a></li></ul></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developer guide</a></li><li class="is-active"><a href="developing.html">Developing Persefone</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="developing.html">Developing Persefone</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/developing.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Developing-Persefone"><a class="docs-heading-anchor" href="#Developing-Persefone">Developing Persefone</a><a id="Developing-Persefone-1"></a><a class="docs-heading-anchor-permalink" href="#Developing-Persefone" title="Permalink"></a></h1><h2 id="Workflow"><a class="docs-heading-anchor" href="#Workflow">Workflow</a><a id="Workflow-1"></a><a class="docs-heading-anchor-permalink" href="#Workflow" title="Permalink"></a></h2><ol><li><p>Pull the current version from the master branch on Gitlab:  <a href="https://git.idiv.de/xo30xoqa/persephone">https://git.idiv.de/xo30xoqa/persephone</a>.</p></li><li><p>If you are working on a new feature, create a new branch to avoid breaking the <code>master</code> branch. (The <code>master</code> branch on Github should always be in a runnable and error-free state.)</p></li><li><p>Implement your changes.</p></li><li><p>Run an example simulation and the test suite to make sure everything works without crashing (<code>make run</code> and <code>make test</code> on Linux, or execute <code>run.jl</code> and <code>test/runtests.jl</code> manually.)</p></li><li><p>Commit your work frequently, and try to keep each commit small. Don&#39;t forget to add relevant tests to the test suite.</p></li><li><p>Once your satisfied with your work, do another pull/merge from the <code>master</code> branch in case somebody else changed the branch in the meantime. Then merge your work into <code>master</code> and push to the Gitlab server.</p></li><li><p>Repeat :-)</p></li></ol><p>The Gitlab <a href="https://git.idiv.de/xo30xoqa/persephone/-/boards/373">issue tracker</a> can be used  to create, discuss, and assign tasks, as well as to monitor progress towards milestones/releases.  Once we have a first release, we will start using <a href="https://semver.org/">semantic versioning</a>.</p><h2 id="Libraries"><a class="docs-heading-anchor" href="#Libraries">Libraries</a><a id="Libraries-1"></a><a class="docs-heading-anchor-permalink" href="#Libraries" title="Permalink"></a></h2><h3 id="Agents.jl"><a class="docs-heading-anchor" href="#Agents.jl">Agents.jl</a><a id="Agents.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Agents.jl" title="Permalink"></a></h3><p>Our model uses <a href="https://juliadynamics.github.io/Agents.jl/stable/">Agents.jl</a> as a framework. Their <a href="https://github.com/JuliaDynamics/Agents.jl">repository</a> can be used to inspect the source code or submit bug reports (the authors are quick to respond). Questions can be asked at the  <a href="https://discourse.julialang.org/c/domain/models/21">Julia Discourse forum</a>.</p><p><em>Tutorial on collaborating on Julia packages:  <a href="https://www.matecdev.com/posts/julia-package-collaboration.html">https://www.matecdev.com/posts/julia-package-collaboration.html</a>.</em></p><h3 id="Revise.jl"><a class="docs-heading-anchor" href="#Revise.jl">Revise.jl</a><a id="Revise.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Revise.jl" title="Permalink"></a></h3><p><a href="https://timholy.github.io/Revise.jl/stable/"><code>Revise.jl</code></a> allows one to reload code without restarting the Julia interpreter. Get it with <code>Pkg.add(&quot;Revise&quot;)</code>, then  add <code>using Revise</code> to <code>.julia/config/startup.jl</code> to have it automatically available.</p><h3 id="Test"><a class="docs-heading-anchor" href="#Test">Test</a><a id="Test-1"></a><a class="docs-heading-anchor-permalink" href="#Test" title="Permalink"></a></h3><p>Persefone uses the inbuilt Julia <a href="https://docs.julialang.org/en/v1/stdlib/Test/">testing framework</a>. All new functions should have appropriate tests written for them in the appropriate file in the <code>test</code> directory. (See <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/test/runtests.jl"><code>test/runtests.jl</code></a> for details.) There are three ways to run the test suite: in the terminal, executing <code>make test</code> or <code>cd test; julia runtests.jl</code>; or in the Julia REPL,  <code>Pkg.activate(&quot;.&quot;); Pkg.test()</code>.</p><h3 id="Documenter.jl"><a class="docs-heading-anchor" href="#Documenter.jl">Documenter.jl</a><a id="Documenter.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Documenter.jl" title="Permalink"></a></h3><p>The HTML documentation is generated using <a href="https://documenter.juliadocs.org">Documenter.jl</a>. Therefore, all new functions should have docstrings attached. New files need to be integrated into the relevant documentation source files in <code>docs/src</code>, and if necessary into <a href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master/docs/builddocs.jl"><code>docs/builddocs.jl</code></a>. To build the documentation, run <code>make docs</code>, or <code>cd docs; julia builddocs.jl</code> (if using the latter, don&#39;t forget to update the date and commit in <code>docs/src/index.md</code>).</p><h2 id="Julia-editors"><a class="docs-heading-anchor" href="#Julia-editors">Julia editors</a><a id="Julia-editors-1"></a><a class="docs-heading-anchor-permalink" href="#Julia-editors" title="Permalink"></a></h2><h3 id="Emacs"><a class="docs-heading-anchor" href="#Emacs">Emacs</a><a id="Emacs-1"></a><a class="docs-heading-anchor-permalink" href="#Emacs" title="Permalink"></a></h3><p>There are a couple of addons that make working with Julia much nicer in Emacs:</p><ol><li><p><code>julia-mode</code> gives syntax highlighting. Install with <code>M-x package-install julia-mode</code>.</p></li><li><p><a href="https://github.com/gcv/julia-snail"><code>julia-snail</code></a> provides IDE-like features,  especially a fully-functional REPL and the ability to evaluate code straight from inside a buffer. Note that the installation can be somewhat tricky. You first need to manually install all the dependencies of its dependency <a href="https://github.com/akermu/emacs-libvterm">vterm</a>, then install vterm itself with <code>M-x package-install vterm</code>, <em>before</em> you can do <code>M-x package-install julia-snail</code>. Then add it to your <code>init.el</code> with <code>(require &#39;julia-snail)</code> and <code>(add-hook &#39;julia-mode-hook #&#39;julia-snail-mode)</code>.</p></li><li><p><a href="http://company-mode.github.io/"><code>company-mode</code></a> integrates with Snail to give code  completion. Install with <code>M-x package-install company</code>, then add  <code>(add-hook &#39;julia-mode-hook #&#39;company-mode)</code> and  <code>(global-set-key (kbd &quot;C-&lt;tab&gt;&quot;) &#39;company-complete)</code> to your <code>init.el</code>.</p></li><li><p><a href="https://magit.vc/"><code>magit</code></a> is a great git interface for Emacs. Install with <code>M-x package-install magit</code> and add <code>(global-set-key (kbd &quot;C-x g&quot;) &#39;magit-status)</code> to your <code>init.el</code>.</p></li></ol><h3 id="VSCode"><a class="docs-heading-anchor" href="#VSCode">VSCode</a><a id="VSCode-1"></a><a class="docs-heading-anchor-permalink" href="#VSCode" title="Permalink"></a></h3><p>See <a href="https://www.julia-vscode.org/">here</a>.</p><p><em>TODO: add more detail.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="config.html">« Configuration</a><a class="docs-footer-nextpage" href="adapting.html">Adapting Persefone »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/energy.html b/docs/build/energy.html
index 5fd67f9..7bd13f2 100644
--- a/docs/build/energy.html
+++ b/docs/build/energy.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Dynamic Energy Budgets · Persefone</title><meta name="title" content="Dynamic Energy Budgets · Persefone"/><meta property="og:title" content="Dynamic Energy Budgets · Persefone"/><meta property="twitter:title" content="Dynamic Energy Budgets · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li class="is-active"><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a><ul class="internal"><li><a class="tocitem" href="#energy.jl"><span>energy.jl</span></a></li></ul></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Nature</a></li><li class="is-active"><a href="energy.html">Dynamic Energy Budgets</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="energy.html">Dynamic Energy Budgets</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/energy.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Dynamic-Energy-Budgets"><a class="docs-heading-anchor" href="#Dynamic-Energy-Budgets">Dynamic Energy Budgets</a><a id="Dynamic-Energy-Budgets-1"></a><a class="docs-heading-anchor-permalink" href="#Dynamic-Energy-Budgets" title="Permalink"></a></h1><p>Persefone&#39;s nature module uses Kooijman&#39;s Dynamic Energy Budget theory to model energy flows within individuals.</p><p><img src="assets/deb.png" alt="&quot;The standard model of the Dynamic Energy Budget theory&quot;"/></p><p><em>The standard model of the Dynamic Energy Budget theory. (Fig. 1 from Sousa et al. (2010).)</em></p><ul><li><p><a href="https://doi.org/10.1098/rstb.2010.0166">Sousa et al. (2010)</a>. Dynamic energy budget theory restores coherence in biology. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1557), 3413–3428.</p></li><li><p><a href="https://www.researchgate.net/profile/Edgar-Meza-3/post/Is_there_a_toxicokinetic_model_for_daphnia_magna_or_other_zooplankton/attachment/59d62cf579197b807798b396/AS%3A348547653357569%401460111644286/download/Dynamic+Energy+Budget+theory+-+Kooijman.pdf">Kooijman, S. A. L. M. (2009)</a>. Dynamic energy and mass budgets in biological systems (3rd ed). Cambridge University Press.</p></li><li><p><a href="https://doi.org/10.1111/2041-210x.12002">Sibly et al. (2013)</a>. Representing the acquisition and use of energy by individuals in agent-based models of animal populations. Methods in Ecology and Evolution, 4(2), 151–161.</p></li></ul><h2 id="energy.jl"><a class="docs-heading-anchor" href="#energy.jl">energy.jl</a><a id="energy.jl-1"></a><a class="docs-heading-anchor-permalink" href="#energy.jl" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.DEBparameters" href="#Persefone.DEBparameters"><code>Persefone.DEBparameters</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DEBparameters</code></pre><p>An immutable struct to save the parameter list for a species&#39; Dynamic Energy Budget model. (See Sousa et al., 2010.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L9-L14">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.EnergyBudget" href="#Persefone.EnergyBudget"><code>Persefone.EnergyBudget</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">EnergyBudget</code></pre><p>This struct represents an individual&#39;s energy balance, as conceptualised by the Dynamic Energy Budget theory. Upon assimilation, energy is first stored as biomass in a reserve buffer, before being used for maintenance, growth, and reproduction. (Note that this is a simplified model form which ignores maturity as a separate buffer.)</p><p><strong>Sources:</strong></p><ul><li>Malishev &amp; Kramer-Schadt (2021). Movement, models, and metabolism: Individual-based energy budget models as next-generation extensions for predicting animal movement outcomes across scales. Ecological Modelling, 441, 109413. https://doi.org/10.1016/j.ecolmodel.2020.109413</li><li>Marques et al. (2018). The AmP project: Comparing species on the basis of dynamic energy budget parameters. PLOS Computational Biology,14(5), e1006100. https://doi.org/10.1371/journal.pcbi.1006100</li><li>Sibly et al. (2013). Representing the acquisition and use of energy by individuals in agent-based models of animal populations. Methods in Ecology and Evolution, 4(2), 151–161. https://doi.org/10.1111/2041-210x.12002</li><li>Sousa et al. (2010). Dynamic energy budget theory restores coherence in biology. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1557), 3413–3428. https://doi.org/10.1098/rstb.2010.0166</li><li>Kooijman, S. A. L. M. (2009). Dynamic energy and mass budgets in biological systems (3rd ed). Cambridge University Press. https://www.researchgate.net/profile/Edgar-Meza-3/post/Is<em>there</em>a<em>toxicokinetic</em>model<em>for</em>daphnia<em>magna</em>or<em>other</em>zooplankton/attachment/59d62cf579197b807798b396/AS%3A348547653357569%401460111644286/download/Dynamic+Energy+Budget+theory+-+Kooijman.pdf</li><li><em>see also:</em> Brown et al. (2004). Toward a metabolic theory of ecology. Ecology, 85(7), 1771–1789. https://doi.org/10.1890/03-9000</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L30-L46">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.feed!-Tuple{Float64, Persefone.EnergyBudget}" href="#Persefone.feed!-Tuple{Float64, Persefone.EnergyBudget}"><code>Persefone.feed!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">feed!(quantity, energybudget)</code></pre><p>Consume a given quantity of food. Expands the energy reserve by an amount determined by the assimilation rate. Returns <code>true</code> if successful, <code>false</code> if the reserve is already full.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L207-L213">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.growthrate-Tuple{Persefone.EnergyBudget}" href="#Persefone.growthrate-Tuple{Persefone.EnergyBudget}"><code>Persefone.growthrate</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">growthrate(energybudget)</code></pre><p>Calculate the specific growth rate r. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L115-L120">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.investmentratio-Tuple{Persefone.EnergyBudget}" href="#Persefone.investmentratio-Tuple{Persefone.EnergyBudget}"><code>Persefone.investmentratio</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">investmentratio(energybudget)</code></pre><p>Calculate the investment ratio g. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L99-L104">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.maturitymaintenance-Tuple{Persefone.EnergyBudget}" href="#Persefone.maturitymaintenance-Tuple{Persefone.EnergyBudget}"><code>Persefone.maturitymaintenance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">maturitymaintenance(energybudget)</code></pre><p>Calculate the specific maturity maintenance k_J. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L71-L76">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.mobilisation-Tuple{Persefone.EnergyBudget}" href="#Persefone.mobilisation-Tuple{Persefone.EnergyBudget}"><code>Persefone.mobilisation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">mobilisation(energybudget)</code></pre><p>Calculate the mobilisation rate J_EC. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L136-L141">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.reproduce!-Tuple{Persefone.EnergyBudget}" href="#Persefone.reproduce!-Tuple{Persefone.EnergyBudget}"><code>Persefone.reproduce!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">reproduce!(energybudget)</code></pre><p>If there is sufficient energy in the <code>offspring</code> buffer of an adult, produce an embryo/egg, reducing the parent energy in the process. Returns the embryo&#39;s energy budget, or <code>nothing</code> if the conditions are not met.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L234-L240">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.scaledreservedensity-Tuple{Persefone.EnergyBudget}" href="#Persefone.scaledreservedensity-Tuple{Persefone.EnergyBudget}"><code>Persefone.scaledreservedensity</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">scaledreservedensity(energybudget)</code></pre><p>Calculate the scaled reserve density e. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L85-L90">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.update!-Tuple{Persefone.EnergyBudget}" href="#Persefone.update!-Tuple{Persefone.EnergyBudget}"><code>Persefone.update!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">update!(energybudget)</code></pre><p>Carry out a daily update of the energy budget. Mobilises reserves and allocates these to maintenance (prioritised), growth, and reproduction.</p><p>Return <code>true</code> if the individual has enough energy to survive, or <code>false</code> if the reserve is empty and it starves.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L154-L162">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.volumetriclength-Tuple{Persefone.EnergyBudget}" href="#Persefone.volumetriclength-Tuple{Persefone.EnergyBudget}"><code>Persefone.volumetriclength</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">volumetriclength(energybudget)</code></pre><p>Calculate the structural length in cm based on an individual&#39;s weight (assuming a density of 1 g/cm³ to calculate volume, see Kooijman 2009).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/energy.jl#L58-L63">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="nature.html">« Nature</a><a class="docs-footer-nextpage" href="species.html">Species »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Dynamic Energy Budgets · Persefone</title><meta name="title" content="Dynamic Energy Budgets · Persefone"/><meta property="og:title" content="Dynamic Energy Budgets · Persefone"/><meta property="twitter:title" content="Dynamic Energy Budgets · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li class="is-active"><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a><ul class="internal"><li><a class="tocitem" href="#energy.jl"><span>energy.jl</span></a></li></ul></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Nature</a></li><li class="is-active"><a href="energy.html">Dynamic Energy Budgets</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="energy.html">Dynamic Energy Budgets</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/energy.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Dynamic-Energy-Budgets"><a class="docs-heading-anchor" href="#Dynamic-Energy-Budgets">Dynamic Energy Budgets</a><a id="Dynamic-Energy-Budgets-1"></a><a class="docs-heading-anchor-permalink" href="#Dynamic-Energy-Budgets" title="Permalink"></a></h1><p>Persefone&#39;s nature module uses Kooijman&#39;s Dynamic Energy Budget theory to model energy flows within individuals.</p><p><img src="assets/deb.png" alt="&quot;The standard model of the Dynamic Energy Budget theory&quot;"/></p><p><em>The standard model of the Dynamic Energy Budget theory. (Fig. 1 from Sousa et al. (2010).)</em></p><ul><li><p><a href="https://doi.org/10.1098/rstb.2010.0166">Sousa et al. (2010)</a>. Dynamic energy budget theory restores coherence in biology. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1557), 3413–3428.</p></li><li><p><a href="https://www.researchgate.net/profile/Edgar-Meza-3/post/Is_there_a_toxicokinetic_model_for_daphnia_magna_or_other_zooplankton/attachment/59d62cf579197b807798b396/AS%3A348547653357569%401460111644286/download/Dynamic+Energy+Budget+theory+-+Kooijman.pdf">Kooijman, S. A. L. M. (2009)</a>. Dynamic energy and mass budgets in biological systems (3rd ed). Cambridge University Press.</p></li><li><p><a href="https://doi.org/10.1111/2041-210x.12002">Sibly et al. (2013)</a>. Representing the acquisition and use of energy by individuals in agent-based models of animal populations. Methods in Ecology and Evolution, 4(2), 151–161.</p></li></ul><h2 id="energy.jl"><a class="docs-heading-anchor" href="#energy.jl">energy.jl</a><a id="energy.jl-1"></a><a class="docs-heading-anchor-permalink" href="#energy.jl" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.DEBparameters" href="#Persefone.DEBparameters"><code>Persefone.DEBparameters</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DEBparameters</code></pre><p>An immutable struct to save the parameter list for a species&#39; Dynamic Energy Budget model. (See Sousa et al., 2010.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L9-L14">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.EnergyBudget" href="#Persefone.EnergyBudget"><code>Persefone.EnergyBudget</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">EnergyBudget</code></pre><p>This struct represents an individual&#39;s energy balance, as conceptualised by the Dynamic Energy Budget theory. Upon assimilation, energy is first stored as biomass in a reserve buffer, before being used for maintenance, growth, and reproduction. (Note that this is a simplified model form which ignores maturity as a separate buffer.)</p><p><strong>Sources:</strong></p><ul><li>Malishev &amp; Kramer-Schadt (2021). Movement, models, and metabolism: Individual-based energy budget models as next-generation extensions for predicting animal movement outcomes across scales. Ecological Modelling, 441, 109413. https://doi.org/10.1016/j.ecolmodel.2020.109413</li><li>Marques et al. (2018). The AmP project: Comparing species on the basis of dynamic energy budget parameters. PLOS Computational Biology,14(5), e1006100. https://doi.org/10.1371/journal.pcbi.1006100</li><li>Sibly et al. (2013). Representing the acquisition and use of energy by individuals in agent-based models of animal populations. Methods in Ecology and Evolution, 4(2), 151–161. https://doi.org/10.1111/2041-210x.12002</li><li>Sousa et al. (2010). Dynamic energy budget theory restores coherence in biology. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1557), 3413–3428. https://doi.org/10.1098/rstb.2010.0166</li><li>Kooijman, S. A. L. M. (2009). Dynamic energy and mass budgets in biological systems (3rd ed). Cambridge University Press. https://www.researchgate.net/profile/Edgar-Meza-3/post/Is<em>there</em>a<em>toxicokinetic</em>model<em>for</em>daphnia<em>magna</em>or<em>other</em>zooplankton/attachment/59d62cf579197b807798b396/AS%3A348547653357569%401460111644286/download/Dynamic+Energy+Budget+theory+-+Kooijman.pdf</li><li><em>see also:</em> Brown et al. (2004). Toward a metabolic theory of ecology. Ecology, 85(7), 1771–1789. https://doi.org/10.1890/03-9000</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L30-L46">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.feed!-Tuple{Float64, Persefone.EnergyBudget}" href="#Persefone.feed!-Tuple{Float64, Persefone.EnergyBudget}"><code>Persefone.feed!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">feed!(quantity, energybudget)</code></pre><p>Consume a given quantity of food. Expands the energy reserve by an amount determined by the assimilation rate. Returns <code>true</code> if successful, <code>false</code> if the reserve is already full.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L207-L213">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.growthrate-Tuple{Persefone.EnergyBudget}" href="#Persefone.growthrate-Tuple{Persefone.EnergyBudget}"><code>Persefone.growthrate</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">growthrate(energybudget)</code></pre><p>Calculate the specific growth rate r. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L115-L120">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.investmentratio-Tuple{Persefone.EnergyBudget}" href="#Persefone.investmentratio-Tuple{Persefone.EnergyBudget}"><code>Persefone.investmentratio</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">investmentratio(energybudget)</code></pre><p>Calculate the investment ratio g. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L99-L104">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.maturitymaintenance-Tuple{Persefone.EnergyBudget}" href="#Persefone.maturitymaintenance-Tuple{Persefone.EnergyBudget}"><code>Persefone.maturitymaintenance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">maturitymaintenance(energybudget)</code></pre><p>Calculate the specific maturity maintenance k_J. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L71-L76">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.mobilisation-Tuple{Persefone.EnergyBudget}" href="#Persefone.mobilisation-Tuple{Persefone.EnergyBudget}"><code>Persefone.mobilisation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">mobilisation(energybudget)</code></pre><p>Calculate the mobilisation rate J_EC. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L136-L141">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.reproduce!-Tuple{Persefone.EnergyBudget}" href="#Persefone.reproduce!-Tuple{Persefone.EnergyBudget}"><code>Persefone.reproduce!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">reproduce!(energybudget)</code></pre><p>If there is sufficient energy in the <code>offspring</code> buffer of an adult, produce an embryo/egg, reducing the parent energy in the process. Returns the embryo&#39;s energy budget, or <code>nothing</code> if the conditions are not met.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L234-L240">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.scaledreservedensity-Tuple{Persefone.EnergyBudget}" href="#Persefone.scaledreservedensity-Tuple{Persefone.EnergyBudget}"><code>Persefone.scaledreservedensity</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">scaledreservedensity(energybudget)</code></pre><p>Calculate the scaled reserve density e. (Internal function.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L85-L90">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.update!-Tuple{Persefone.EnergyBudget}" href="#Persefone.update!-Tuple{Persefone.EnergyBudget}"><code>Persefone.update!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">update!(energybudget)</code></pre><p>Carry out a daily update of the energy budget. Mobilises reserves and allocates these to maintenance (prioritised), growth, and reproduction.</p><p>Return <code>true</code> if the individual has enough energy to survive, or <code>false</code> if the reserve is empty and it starves.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L154-L162">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.volumetriclength-Tuple{Persefone.EnergyBudget}" href="#Persefone.volumetriclength-Tuple{Persefone.EnergyBudget}"><code>Persefone.volumetriclength</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">volumetriclength(energybudget)</code></pre><p>Calculate the structural length in cm based on an individual&#39;s weight (assuming a density of 1 g/cm³ to calculate volume, see Kooijman 2009).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/energy.jl#L58-L63">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="nature.html">« Nature</a><a class="docs-footer-nextpage" href="species.html">Species »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/farm.html b/docs/build/farm.html
index 87440e6..981feaf 100644
--- a/docs/build/farm.html
+++ b/docs/build/farm.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Farm submodel · Persefone</title><meta name="title" content="Farm submodel · Persefone"/><meta property="og:title" content="Farm submodel · Persefone"/><meta property="twitter:title" content="Farm submodel · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li class="is-active"><a class="tocitem" href="farm.html">Farm submodel</a><ul class="internal"><li><a class="tocitem" href="#farm.jl"><span>farm.jl</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="farm.html">Farm submodel</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="farm.html">Farm submodel</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/farm.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Farm-submodel"><a class="docs-heading-anchor" href="#Farm-submodel">Farm submodel</a><a id="Farm-submodel-1"></a><a class="docs-heading-anchor-permalink" href="#Farm-submodel" title="Permalink"></a></h1><p>Eventually, the aim is to create a full socio-economic farm decision model for Persefone. However, for the time being, we will restrict ourselves to a simple model that executes typical farm operations and crop rotations.</p><h2 id="farm.jl"><a class="docs-heading-anchor" href="#farm.jl">farm.jl</a><a id="farm.jl-1"></a><a class="docs-heading-anchor-permalink" href="#farm.jl" title="Permalink"></a></h2><p>This file is responsible for managing the farm module(s).</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.Farmer" href="#Persefone.Farmer"><code>Persefone.Farmer</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Farmer</code></pre><p>This is the agent type for the farm ABM. (Not yet implemented.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/farm/farm.jl#L6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initfarms!-Tuple{Agents.AgentBasedModel}" href="#Persefone.initfarms!-Tuple{Agents.AgentBasedModel}"><code>Persefone.initfarms!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initfarms!(model)</code></pre><p>Initialise the model with a set of farm agents.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/farm/farm.jl#L26-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}" href="#Persefone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}"><code>Persefone.stepagent!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">stepagent!(farmer, model)</code></pre><p>Update a farmer by one day.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/farm/farm.jl#L17-L21">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="crops.html">« Crop submodel</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Farm submodel · Persefone</title><meta name="title" content="Farm submodel · Persefone"/><meta property="og:title" content="Farm submodel · Persefone"/><meta property="twitter:title" content="Farm submodel · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li class="is-active"><a class="tocitem" href="farm.html">Farm submodel</a><ul class="internal"><li><a class="tocitem" href="#farm.jl"><span>farm.jl</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="farm.html">Farm submodel</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="farm.html">Farm submodel</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/farm.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Farm-submodel"><a class="docs-heading-anchor" href="#Farm-submodel">Farm submodel</a><a id="Farm-submodel-1"></a><a class="docs-heading-anchor-permalink" href="#Farm-submodel" title="Permalink"></a></h1><p>Eventually, the aim is to create a full socio-economic farm decision model for Persefone. However, for the time being, we will restrict ourselves to a simple model that executes typical farm operations and crop rotations.</p><h2 id="farm.jl"><a class="docs-heading-anchor" href="#farm.jl">farm.jl</a><a id="farm.jl-1"></a><a class="docs-heading-anchor-permalink" href="#farm.jl" title="Permalink"></a></h2><p>This file is responsible for managing the farm module(s).</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.Farmer" href="#Persefone.Farmer"><code>Persefone.Farmer</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Farmer</code></pre><p>This is the agent type for the farm ABM. (Not yet implemented.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/farm/farm.jl#L6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initfarms!-Tuple{Agents.AgentBasedModel}" href="#Persefone.initfarms!-Tuple{Agents.AgentBasedModel}"><code>Persefone.initfarms!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initfarms!(model)</code></pre><p>Initialise the model with a set of farm agents.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/farm/farm.jl#L26-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}" href="#Persefone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}"><code>Persefone.stepagent!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">stepagent!(farmer, model)</code></pre><p>Update a farmer by one day.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/farm/farm.jl#L17-L21">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="crops.html">« Crop submodel</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/gis.html b/docs/build/gis.html
index 9e12cd9..682e590 100644
--- a/docs/build/gis.html
+++ b/docs/build/gis.html
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Maps and weather data · Persefone</title><meta name="title" content="Maps and weather data · Persefone"/><meta property="og:title" content="Maps and weather data · Persefone"/><meta property="twitter:title" content="Maps and weather data · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li class="is-active"><a class="tocitem" href="gis.html">Maps and weather data</a><ul class="internal"><li><a class="tocitem" href="#Land-cover-maps"><span>Land cover maps</span></a></li><li><a class="tocitem" href="#Field-ID-maps"><span>Field ID maps</span></a></li><li><a class="tocitem" href="#Weather-data"><span>Weather data</span></a></li></ul></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developing</a></li><li class="is-active"><a href="gis.html">Maps and weather data</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="gis.html">Maps and weather data</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/gis.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Maps-and-weather-data"><a class="docs-heading-anchor" href="#Maps-and-weather-data">Maps and weather data</a><a id="Maps-and-weather-data-1"></a><a class="docs-heading-anchor-permalink" href="#Maps-and-weather-data" title="Permalink"></a></h1><p>Persefone currently requires two separate map input files: one for land cover, the other for field geometry. Additionally, a weather input file is needed.  This documents describe how to obtain and process the data needed for each  of these.</p><h2 id="Land-cover-maps"><a class="docs-heading-anchor" href="#Land-cover-maps">Land cover maps</a><a id="Land-cover-maps-1"></a><a class="docs-heading-anchor-permalink" href="#Land-cover-maps" title="Permalink"></a></h2><p>Land cover maps for Germany at 10m resolution can be obtained from  <a href="https://data.mundialis.de/geonetwork/srv/eng/catalog.search#/metadata/9246503f-6adf-460b-a31e-73a649182d07">Mundialis</a>. These are generated annually from Sentinel data and comprise the following  land cover classes:</p><pre><code class="nohighlight hljs">10: forest
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Maps and weather data · Persefone</title><meta name="title" content="Maps and weather data · Persefone"/><meta property="og:title" content="Maps and weather data · Persefone"/><meta property="twitter:title" content="Maps and weather data · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li class="is-active"><a class="tocitem" href="gis.html">Maps and weather data</a><ul class="internal"><li><a class="tocitem" href="#Land-cover-maps"><span>Land cover maps</span></a></li><li><a class="tocitem" href="#Field-ID-maps"><span>Field ID maps</span></a></li><li><a class="tocitem" href="#Weather-data"><span>Weather data</span></a></li></ul></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developer guide</a></li><li class="is-active"><a href="gis.html">Maps and weather data</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="gis.html">Maps and weather data</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/gis.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Maps-and-weather-data"><a class="docs-heading-anchor" href="#Maps-and-weather-data">Maps and weather data</a><a id="Maps-and-weather-data-1"></a><a class="docs-heading-anchor-permalink" href="#Maps-and-weather-data" title="Permalink"></a></h1><p>Persefone currently requires two separate map input files: one for land cover, the other for field geometry. Additionally, a weather input file is needed.  This documents describe how to obtain and process the data needed for each  of these.</p><h2 id="Land-cover-maps"><a class="docs-heading-anchor" href="#Land-cover-maps">Land cover maps</a><a id="Land-cover-maps-1"></a><a class="docs-heading-anchor-permalink" href="#Land-cover-maps" title="Permalink"></a></h2><p>Land cover maps for Germany at 10m resolution can be obtained from  <a href="https://data.mundialis.de/geonetwork/srv/eng/catalog.search#/metadata/9246503f-6adf-460b-a31e-73a649182d07">Mundialis</a>. These are generated annually from Sentinel data and comprise the following  land cover classes:</p><pre><code class="nohighlight hljs">10: forest
 20: low vegetation
 30: water
 40: built-up
@@ -26,4 +26,4 @@ weather = data %&gt;%
            min_temperature=na_if(TNK, -999), TNK=NULL)
 
 ## replace with the desired file name
-write.csv(weather, file=&quot;weather_jena.csv&quot;, row.names=FALSE)</code></pre><p><em>Note: for calculating the reference evapotranspiration ET_0 (needed for the AquaCrop model),  use the <a href="https://www.fao.org/3/X0490E/x0490e06.htm#equation">FAO Penman-Monteith equation</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="architecture.html">« Source code architecture</a><a class="docs-footer-nextpage" href="species-dsl.html">Defining new species »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+write.csv(weather, file=&quot;weather_jena.csv&quot;, row.names=FALSE)</code></pre><p><em>Note: for calculating the reference evapotranspiration ET_0 (needed for the AquaCrop model),  use the <a href="https://www.fao.org/3/X0490E/x0490e06.htm#equation">FAO Penman-Monteith equation</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="architecture.html">« Source code architecture</a><a class="docs-footer-nextpage" href="species-dsl.html">Defining new species »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/gui.html b/docs/build/gui.html
index eb22dd5..2f827de 100644
--- a/docs/build/gui.html
+++ b/docs/build/gui.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Graphical User Interface · Persefone</title><meta name="title" content="Graphical User Interface · Persefone"/><meta property="og:title" content="Graphical User Interface · Persefone"/><meta property="twitter:title" content="Graphical User Interface · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li class="is-active"><a class="tocitem" href="gui.html">Graphical User Interface</a><ul class="internal"><li><a class="tocitem" href="#Install-and-run"><span>Install and run</span></a></li><li><a class="tocitem" href="#User-interface"><span>User interface</span></a></li></ul></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Manual</a></li><li class="is-active"><a href="gui.html">Graphical User Interface</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="gui.html">Graphical User Interface</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/gui.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Graphical-User-Interface"><a class="docs-heading-anchor" href="#Graphical-User-Interface">Graphical User Interface</a><a id="Graphical-User-Interface-1"></a><a class="docs-heading-anchor-permalink" href="#Graphical-User-Interface" title="Permalink"></a></h1><p>Due to the computational demands of simulating many individuals at high temporal and spatial resolution, Persefone.jl is primarily designed to be run non-interactively on an HPC. However, to allow interactive exploratory simulations to be conducted while learning or developing the model, a graphical user interface is available as an additional package: <a href="https://git.idiv.de/persefone/persefone-desktop">Persefone Desktop</a>.</p><h2 id="Install-and-run"><a class="docs-heading-anchor" href="#Install-and-run">Install and run</a><a id="Install-and-run-1"></a><a class="docs-heading-anchor-permalink" href="#Install-and-run" title="Permalink"></a></h2><p><strong>To install:</strong> Install <a href="https://julialang.org/downloads/">Julia</a> and download/clone  the <a href="https://git.idiv.de/persefone/persefone-desktop">repository</a>. Open a Julia REPL  in the downloaded folder and execute the following to install all dependencies:</p><pre><code class="language-julia hljs">using Pkg
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Graphical User Interface · Persefone</title><meta name="title" content="Graphical User Interface · Persefone"/><meta property="og:title" content="Graphical User Interface · Persefone"/><meta property="twitter:title" content="Graphical User Interface · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li class="is-active"><a class="tocitem" href="gui.html">Graphical User Interface</a><ul class="internal"><li><a class="tocitem" href="#Install-and-run"><span>Install and run</span></a></li><li><a class="tocitem" href="#User-interface"><span>User interface</span></a></li></ul></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">User guide</a></li><li class="is-active"><a href="gui.html">Graphical User Interface</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="gui.html">Graphical User Interface</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/gui.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Graphical-User-Interface"><a class="docs-heading-anchor" href="#Graphical-User-Interface">Graphical User Interface</a><a id="Graphical-User-Interface-1"></a><a class="docs-heading-anchor-permalink" href="#Graphical-User-Interface" title="Permalink"></a></h1><p>Due to the computational demands of simulating many individuals at high temporal and spatial resolution, Persefone.jl is primarily designed to be run non-interactively on an HPC. However, to allow interactive exploratory simulations to be conducted while learning or developing the model, a graphical user interface is available as an additional package: <a href="https://git.idiv.de/persefone/persefone-desktop">Persefone Desktop</a>.</p><h2 id="Install-and-run"><a class="docs-heading-anchor" href="#Install-and-run">Install and run</a><a id="Install-and-run-1"></a><a class="docs-heading-anchor-permalink" href="#Install-and-run" title="Permalink"></a></h2><p><strong>To install:</strong> Install <a href="https://julialang.org/downloads/">Julia</a> and download/clone  the <a href="https://git.idiv.de/persefone/persefone-desktop">repository</a>. Open a Julia REPL  in the downloaded folder and execute the following to install all dependencies:</p><pre><code class="language-julia hljs">using Pkg
 Pkg.activate(&quot;.&quot;)
 Pkg.instantiate()</code></pre><p><strong>To run:</strong> Run <code>desktop.jl</code>. Alternatively, open a Julia REPL in this folder and run:</p><pre><code class="language-julia hljs">using Pkg
 Pkg.activate(&quot;.&quot;)
 using PersefoneDesktop
-launch()</code></pre><p><em>Note:</em> Due to the necessary pre-compilation done by Julia, installing and launching the application can take quite a long time. (Start-up time with <code>desktop.jl</code> is currently about 2 minutes.) We will reduce this as much as possible in future releases.</p><h2 id="User-interface"><a class="docs-heading-anchor" href="#User-interface">User interface</a><a id="User-interface-1"></a><a class="docs-heading-anchor-permalink" href="#User-interface" title="Permalink"></a></h2><p><img src="assets/screenshot.png" alt="Persefone.jl Desktop screenshot"/></p><p>The main window component is the <strong>map view</strong>. This displays a land cover map of the simulated region: dark green are forests, light green grassland, yellow fields, red built-up areas and blue water. On it, little circles show the position of individual animals, with different species denoted by different colours.</p><h3 id="Control-bar"><a class="docs-heading-anchor" href="#Control-bar">Control bar</a><a id="Control-bar-1"></a><a class="docs-heading-anchor-permalink" href="#Control-bar" title="Permalink"></a></h3><ul><li><p><strong>Back button:</strong> Rewind the simulation by one day.</p></li><li><p><strong>Step button:</strong> Advance the simulation by one day.</p></li><li><p><strong>Run button:</strong> Run the simulation until the button is pressed again or the end date is reached.</p></li><li><p><strong>Progress bar:</strong> Shows the percentage of time elapsed between the start and end dates of the simulation.</p></li><li><p><strong>Speed slider:</strong> Set the time delay between each simulation step when running.</p></li><li><p><strong>Date:</strong> Shows the simulation date currently displayed on the map.</p></li></ul><h3 id="Menu-bar"><a class="docs-heading-anchor" href="#Menu-bar">Menu bar</a><a id="Menu-bar-1"></a><a class="docs-heading-anchor-permalink" href="#Menu-bar" title="Permalink"></a></h3><p><strong>Simulation:</strong></p><ul><li><p><strong>New simulation:</strong> Reset the model and start over.</p></li><li><p><strong>Configure simulation:</strong> Change the model settings (<em>not yet implemented</em>).</p></li><li><p><strong>Load saved state:</strong> Load a model object file saved by a previous simulation run.</p></li><li><p><strong>Save current state:</strong> Save a model object file for later use.</p></li><li><p><strong>Quit:</strong> Close the application.</p></li></ul><p><strong>Data:</strong></p><ul><li><p><strong>Show population graph:</strong> Show a window with a graph of population sizes over time in the current model run.</p></li><li><p><strong>Save simulation output:</strong> Save the model output data to file (saves both raw CSV data and generated graphics).</p></li></ul><p><strong>Help:</strong></p><ul><li><p><strong>Documentation:</strong> Open the Persefone.jl online documentation in a browser.</p></li><li><p><strong>Website:</strong> Open the main Persefone.jl website in a browser.</p></li><li><p><strong>About:</strong> Show a window with core information about the application.</p></li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="using.html">« Usage</a><a class="docs-footer-nextpage" href="config.html">Configuration »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+launch()</code></pre><p><em>Note:</em> Due to the necessary pre-compilation done by Julia, installing and launching the application can take quite a long time. (Start-up time with <code>desktop.jl</code> is currently about 2 minutes.) We will reduce this as much as possible in future releases.</p><h2 id="User-interface"><a class="docs-heading-anchor" href="#User-interface">User interface</a><a id="User-interface-1"></a><a class="docs-heading-anchor-permalink" href="#User-interface" title="Permalink"></a></h2><p><img src="assets/screenshot.png" alt="Persefone.jl Desktop screenshot"/></p><p>The main window component is the <strong>map view</strong>. This displays a land cover map of the simulated region: dark green are forests, light green grassland, yellow fields, red built-up areas and blue water. On it, little circles show the position of individual animals, with different species denoted by different colours.</p><h3 id="Control-bar"><a class="docs-heading-anchor" href="#Control-bar">Control bar</a><a id="Control-bar-1"></a><a class="docs-heading-anchor-permalink" href="#Control-bar" title="Permalink"></a></h3><ul><li><p><strong>Back button:</strong> Rewind the simulation by one day.</p></li><li><p><strong>Step button:</strong> Advance the simulation by one day.</p></li><li><p><strong>Run button:</strong> Run the simulation until the button is pressed again or the end date is reached.</p></li><li><p><strong>Progress bar:</strong> Shows the percentage of time elapsed between the start and end dates of the simulation.</p></li><li><p><strong>Speed slider:</strong> Set the time delay between each simulation step when running.</p></li><li><p><strong>Date:</strong> Shows the simulation date currently displayed on the map.</p></li></ul><h3 id="Menu-bar"><a class="docs-heading-anchor" href="#Menu-bar">Menu bar</a><a id="Menu-bar-1"></a><a class="docs-heading-anchor-permalink" href="#Menu-bar" title="Permalink"></a></h3><p><strong>Simulation:</strong></p><ul><li><p><strong>New simulation:</strong> Reset the model and start over.</p></li><li><p><strong>Configure simulation:</strong> Change the model settings (<em>not yet implemented</em>).</p></li><li><p><strong>Load saved state:</strong> Load a model object file saved by a previous simulation run.</p></li><li><p><strong>Save current state:</strong> Save a model object file for later use.</p></li><li><p><strong>Quit:</strong> Close the application.</p></li></ul><p><strong>Data:</strong></p><ul><li><p><strong>Show population graph:</strong> Show a window with a graph of population sizes over time in the current model run.</p></li><li><p><strong>Save simulation output:</strong> Save the model output data to file (saves both raw CSV data and generated graphics).</p></li></ul><p><strong>Help:</strong></p><ul><li><p><strong>Documentation:</strong> Open the Persefone.jl online documentation in a browser.</p></li><li><p><strong>Website:</strong> Open the main Persefone.jl website in a browser.</p></li><li><p><strong>About:</strong> Show a window with core information about the application.</p></li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="using.html">« The Persefone.jl Package</a><a class="docs-footer-nextpage" href="config.html">Configuration »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/index.html b/docs/build/index.html
index c835f11..ce27b21 100644
--- a/docs/build/index.html
+++ b/docs/build/index.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Introduction · Persefone</title><meta name="title" content="Introduction · Persefone"/><meta property="og:title" content="Introduction · Persefone"/><meta property="twitter:title" content="Introduction · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="index.html">Introduction</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="index.html">Introduction</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/index.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><p><a href="https://persefone-model.eu"><img src="assets/persefonejl_logo_v3_splash.png" alt="Persefone.jl splash screen"/></a></p><h1 id="Introduction"><a class="docs-heading-anchor" href="#Introduction">Introduction</a><a id="Introduction-1"></a><a class="docs-heading-anchor-permalink" href="#Introduction" title="Permalink"></a></h1><p><a href="https://persefone-model.eu">Persefone.jl</a> models agricultural practice and how it impacts  animal species at a landscape scale. It includes a farm submodel, a crop growth submodel,  and individual-based models of multiple indicator species. Its aim is to investigate how  changes in farm operations (e.g. through policy changes in the CAP) influence biodiversity.</p><p>The model is open-source software licensed under the terms of the MIT license and available on <a href="https://git.idiv.de/persefone/persefone-model">Gitlab</a>.</p><p><em>Last updated: 2023-10-27 (commit 9f4a9c7)</em></p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="using.html">Usage »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Introduction · Persefone</title><meta name="title" content="Introduction · Persefone"/><meta property="og:title" content="Introduction · Persefone"/><meta property="twitter:title" content="Introduction · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="index.html">Introduction</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="index.html">Introduction</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/index.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><p><a href="https://persefone-model.eu"><img src="assets/persefonejl_logo_v3_splash.png" alt="Persefone.jl splash screen"/></a></p><h1 id="Introduction"><a class="docs-heading-anchor" href="#Introduction">Introduction</a><a id="Introduction-1"></a><a class="docs-heading-anchor-permalink" href="#Introduction" title="Permalink"></a></h1><p><a href="https://persefone-model.eu">Persefone.jl</a> models agricultural practice and how it impacts  animal species at a landscape scale. It includes a farm submodel, a crop growth submodel,  and individual-based models of multiple indicator species. Its aim is to investigate how  changes in farm operations (e.g. through policy changes in the CAP) influence biodiversity.</p><p>The model is open-source software available on  <a href="https://git.idiv.de/persefone/persefone-model">Gitlab</a>.</p><p><em>Last updated: 2023-10-27 (commit 261d20b)</em></p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="using.html">The Persefone.jl Package »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/io.html b/docs/build/io.html
index 5401970..a21964f 100644
--- a/docs/build/io.html
+++ b/docs/build/io.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Input and Output · Persefone</title><meta name="title" content="Input and Output · Persefone"/><meta property="og:title" content="Input and Output · Persefone"/><meta property="twitter:title" content="Input and Output · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li class="is-active"><a class="tocitem" href="io.html">Input and Output</a><ul class="internal"><li><a class="tocitem" href="#input.jl"><span>input.jl</span></a></li><li><a class="tocitem" href="#output.jl"><span>output.jl</span></a></li><li><a class="tocitem" href="#makieplots.jl"><span>makieplots.jl</span></a></li></ul></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Core</a></li><li class="is-active"><a href="io.html">Input and Output</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="io.html">Input and Output</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/io.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Input-and-Output"><a class="docs-heading-anchor" href="#Input-and-Output">Input and Output</a><a id="Input-and-Output-1"></a><a class="docs-heading-anchor-permalink" href="#Input-and-Output" title="Permalink"></a></h1><p>These functions are responsible for reading in all model configurations (passed by config file or commandline), administrating them during a run, and printing or plotting any output.</p><h2 id="input.jl"><a class="docs-heading-anchor" href="#input.jl">input.jl</a><a id="input.jl-1"></a><a class="docs-heading-anchor-permalink" href="#input.jl" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.PARAMFILE" href="#Persefone.PARAMFILE"><code>Persefone.PARAMFILE</code></a> — <span class="docstring-category">Constant</span></header><section><div><p>The file that stores all default parameters: <code>src/parameters.toml</code></p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L9-L11">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.flattenTOML-Tuple{Any}" href="#Persefone.flattenTOML-Tuple{Any}"><code>Persefone.flattenTOML</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">flattenTOML(dict)</code></pre><p>An internal utility function to convert the two-dimensional dict returned by <code>TOML.parsefile()</code> into a one-dimensional dict, so that instead of writing <code>settings[&quot;domain&quot;][&quot;param&quot;]</code> one can use <code>settings[&quot;domain.param&quot;]</code>. Can be reversed with <a href="io.html#Persefone.prepareTOML-Tuple{Any}"><code>prepareTOML</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L100-L107">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.getsettings" href="#Persefone.getsettings"><code>Persefone.getsettings</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">getsettings(configfile, seed=nothing)</code></pre><p>Combines all configuration options to produce a single settings dict. Precedence: commandline parameters - user config file - default values</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L37-L42">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.loadmodelobject-Tuple{String}" href="#Persefone.loadmodelobject-Tuple{String}"><code>Persefone.loadmodelobject</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">loadmodelobject(fullfilename)</code></pre><p>Deserialise a model object that was previously saved with <code>[savemodelobject](@ref)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L177-L181">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.parsecommandline-Tuple{}" href="#Persefone.parsecommandline-Tuple{}"><code>Persefone.parsecommandline</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">parsecommandline()</code></pre><p>Certain software parameters can be set via the commandline.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L140-L144">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.preprocessparameters-Tuple{Dict{String, Any}, String}" href="#Persefone.preprocessparameters-Tuple{Dict{String, Any}, String}"><code>Persefone.preprocessparameters</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">preprocessparameters(settings)</code></pre><p>Take the raw input parameters and process them (convert types, perform checks, etc.). This is a helper function for <a href="io.html#Persefone.getsettings"><code>getsettings</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L75-L80">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@param-Tuple{Any}" href="#Persefone.@param-Tuple{Any}"><code>Persefone.@param</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@param(domainparam)</code></pre><p>Return a configuration parameter from the global settings. The argument should be in the form <code>&lt;domain&gt;.&lt;parameter&gt;</code>, for example <code>@param(core.outdir)</code>. Possible values for <code>&lt;domain&gt;</code> are <code>core</code>, <code>nature</code>, <code>farm</code>, or <code>crop</code>. For a full list of parameters, see <code>src/parameters.toml</code>.</p><p>Note: this macro only works in a context where the <code>model</code> object is available!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L19-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@rand-Tuple" href="#Persefone.@rand-Tuple"><code>Persefone.@rand</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@rand(args...)</code></pre><p>Return a random number or element from the sample, using the model RNG. This is a utility wrapper that can only be used a context where the <code>model</code> object is available.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L118-L124">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@shuffle!-Tuple{Any}" href="#Persefone.@shuffle!-Tuple{Any}"><code>Persefone.@shuffle!</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@shuffle!(collection)</code></pre><p>Shuffle the given collection in place, using the model RNG. This is a utility wrapper that can only be used a context where the <code>model</code> object is available.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/input.jl#L129-L135">source</a></section></article><h2 id="output.jl"><a class="docs-heading-anchor" href="#output.jl">output.jl</a><a id="output.jl-1"></a><a class="docs-heading-anchor-permalink" href="#output.jl" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.DataOutput" href="#Persefone.DataOutput"><code>Persefone.DataOutput</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DataOutput</code></pre><p>A struct for organising model output. This is used to collect model data in an in-memory dataframe or for CSV output. Submodels can register their own output functions using <a href="io.html#Persefone.newdataoutput!"><code>newdataoutput!</code></a>.</p><p>Struct fields:     - name: a string identifier for the data collection (used as file name)     - header: a list of column names     - outputfunction: a function that takes a model object and returns data values to record (formatted as a vector of vectors)     - frequency: how often to call the output function (daily/monthly/yearly/end/never)     - plotfunction: a function that takes a model object and returns a Makie figure object (optional)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L122-L135">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.createdatadir-Tuple{String, Union{Bool, String}}" href="#Persefone.createdatadir-Tuple{String, Union{Bool, String}}"><code>Persefone.createdatadir</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">createdatadir(outdir, overwrite)</code></pre><p>Creates the output directory, dealing with possible conflicts.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L11-L15">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.modellogger-Tuple{String, String}" href="#Persefone.modellogger-Tuple{String, String}"><code>Persefone.modellogger</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">modellogger(loglevel, outdir)</code></pre><p>Create a logger object that writes output both to screen and to a logfile. This object is stored as <code>model.logger</code> and can then be used with <code>with_logger()</code>. Note: requires <a href="io.html#Persefone.createdatadir-Tuple{String, Union{Bool, String}}"><code>createdatadir</code></a> to be run first.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L32-L38">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.newdataoutput!" href="#Persefone.newdataoutput!"><code>Persefone.newdataoutput!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">newdataoutput!(model, name, header, outputfunction, frequency)</code></pre><p>Create and register a new data output. This function must be called by all submodels that want to have their output functions called regularly.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L144-L149">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.outputdata" href="#Persefone.outputdata"><code>Persefone.outputdata</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">outputdata(model, force=false)</code></pre><p>Cycle through all registered data outputs and activate them according to their configured frequency. If <code>force</code> is <code>true</code>, activate all outputs regardless of their configuration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L174-L180">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.prepareTOML-Tuple{Any}" href="#Persefone.prepareTOML-Tuple{Any}"><code>Persefone.prepareTOML</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">prepareTOML(dict)</code></pre><p>An internal utility function to re-convert the one-dimensional dict created by <a href="io.html#Persefone.flattenTOML-Tuple{Any}"><code>flattenTOML</code></a> into the two-dimensional dict needed by <code>TOML.print</code>, and convert any data types into TOML-compatible types where necessary.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L100-L106">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.saveinputfiles-Tuple{Agents.AgentBasedModel}" href="#Persefone.saveinputfiles-Tuple{Agents.AgentBasedModel}"><code>Persefone.saveinputfiles</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">saveinputfiles(model)</code></pre><p>Copy all input files into the output directory, including the actual parameter settings used. This allows replicating a run in future.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L66-L71">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.savemodelobject-Tuple{Agents.AgentBasedModel, String}" href="#Persefone.savemodelobject-Tuple{Agents.AgentBasedModel, String}"><code>Persefone.savemodelobject</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">savemodelobject(model, filename)</code></pre><p>Serialise a model object and save it to file for later reference. Includes the current model and Julia versions for compatibility checking.</p><p>WARNING: produces large files (&gt;100 MB) and takes a while to execute.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L228-L235">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.visualiseoutput" href="#Persefone.visualiseoutput"><code>Persefone.visualiseoutput</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">visualiseoutput(model)</code></pre><p>Cycle through all data outputs and call their respective plot functions, saving each figure as a PDF.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L212-L217">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.withtestlogger-Tuple{Agents.AgentBasedModel}" href="#Persefone.withtestlogger-Tuple{Agents.AgentBasedModel}"><code>Persefone.withtestlogger</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">withtestlogger(model)</code></pre><p>Replace the model logger with the currently active logger. This is intended to be used in the testsuite to circumvent a <a href="https://github.com/JuliaLang/julia/issues/48456">Julia issue</a>, where <code>@test_logs</code> doesn&#39;t work with local loggers.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/output.jl#L52-L58">source</a></section></article><h2 id="makieplots.jl"><a class="docs-heading-anchor" href="#makieplots.jl">makieplots.jl</a><a id="makieplots.jl-1"></a><a class="docs-heading-anchor-permalink" href="#makieplots.jl" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.gettickmarks-Tuple{Any}" href="#Persefone.gettickmarks-Tuple{Any}"><code>Persefone.gettickmarks</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">gettickmarks(dates)</code></pre><p>Given a vector of dates, construct a selection to use as tick mark locations. Helper function for <code>[populationtrends](@ref)</code></p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/analysis/makieplots.jl#L72-L77">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.populationtrends-Tuple{Agents.AgentBasedModel}" href="#Persefone.populationtrends-Tuple{Agents.AgentBasedModel}"><code>Persefone.populationtrends</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">populationtrends(model)</code></pre><p>Plot a line graph of population sizes of each species over time. Returns a Makie figure object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/analysis/makieplots.jl#L48-L53">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.visualisemap" href="#Persefone.visualisemap"><code>Persefone.visualisemap</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">visualisemap(model, date, landcovermap)</code></pre><p>Draw the model&#39;s land cover map and plot all individuals as points on it at the specified date. If no date is passed, use the last date for which data are available. Optionally, you can pass a landcover map image (this is needed to reduce the frequency of disk I/O for Persefone Desktop). Returns a Makie figure object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/analysis/makieplots.jl#L6-L14">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="simulation.html">« Simulation</a><a class="docs-footer-nextpage" href="nature.html">Nature »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Input and Output · Persefone</title><meta name="title" content="Input and Output · Persefone"/><meta property="og:title" content="Input and Output · Persefone"/><meta property="twitter:title" content="Input and Output · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li class="is-active"><a class="tocitem" href="io.html">Input and Output</a><ul class="internal"><li><a class="tocitem" href="#input.jl"><span>input.jl</span></a></li><li><a class="tocitem" href="#output.jl"><span>output.jl</span></a></li><li><a class="tocitem" href="#makieplots.jl"><span>makieplots.jl</span></a></li></ul></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Core</a></li><li class="is-active"><a href="io.html">Input and Output</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="io.html">Input and Output</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/io.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Input-and-Output"><a class="docs-heading-anchor" href="#Input-and-Output">Input and Output</a><a id="Input-and-Output-1"></a><a class="docs-heading-anchor-permalink" href="#Input-and-Output" title="Permalink"></a></h1><p>These functions are responsible for reading in all model configurations (passed by config file or commandline), administrating them during a run, and printing or plotting any output.</p><h2 id="input.jl"><a class="docs-heading-anchor" href="#input.jl">input.jl</a><a id="input.jl-1"></a><a class="docs-heading-anchor-permalink" href="#input.jl" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.PARAMFILE" href="#Persefone.PARAMFILE"><code>Persefone.PARAMFILE</code></a> — <span class="docstring-category">Constant</span></header><section><div><p>The file that stores all default parameters: <code>src/parameters.toml</code></p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L9-L11">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.flattenTOML-Tuple{Any}" href="#Persefone.flattenTOML-Tuple{Any}"><code>Persefone.flattenTOML</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">flattenTOML(dict)</code></pre><p>An internal utility function to convert the two-dimensional dict returned by <code>TOML.parsefile()</code> into a one-dimensional dict, so that instead of writing <code>settings[&quot;domain&quot;][&quot;param&quot;]</code> one can use <code>settings[&quot;domain.param&quot;]</code>. Can be reversed with <a href="io.html#Persefone.prepareTOML-Tuple{Any}"><code>prepareTOML</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L100-L107">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.getsettings" href="#Persefone.getsettings"><code>Persefone.getsettings</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">getsettings(configfile, seed=nothing)</code></pre><p>Combines all configuration options to produce a single settings dict. Precedence: commandline parameters - user config file - default values</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L37-L42">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.loadmodelobject-Tuple{String}" href="#Persefone.loadmodelobject-Tuple{String}"><code>Persefone.loadmodelobject</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">loadmodelobject(fullfilename)</code></pre><p>Deserialise a model object that was previously saved with <code>[savemodelobject](@ref)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L177-L181">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.parsecommandline-Tuple{}" href="#Persefone.parsecommandline-Tuple{}"><code>Persefone.parsecommandline</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">parsecommandline()</code></pre><p>Certain software parameters can be set via the commandline.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L140-L144">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.preprocessparameters-Tuple{Dict{String, Any}, String}" href="#Persefone.preprocessparameters-Tuple{Dict{String, Any}, String}"><code>Persefone.preprocessparameters</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">preprocessparameters(settings)</code></pre><p>Take the raw input parameters and process them (convert types, perform checks, etc.). This is a helper function for <a href="io.html#Persefone.getsettings"><code>getsettings</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L75-L80">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@param-Tuple{Any}" href="#Persefone.@param-Tuple{Any}"><code>Persefone.@param</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@param(domainparam)</code></pre><p>Return a configuration parameter from the global settings. The argument should be in the form <code>&lt;domain&gt;.&lt;parameter&gt;</code>, for example <code>@param(core.outdir)</code>. Possible values for <code>&lt;domain&gt;</code> are <code>core</code>, <code>nature</code>, <code>farm</code>, or <code>crop</code>. For a full list of parameters, see <code>src/parameters.toml</code>.</p><p>Note: this macro only works in a context where the <code>model</code> object is available!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L19-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@rand-Tuple" href="#Persefone.@rand-Tuple"><code>Persefone.@rand</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@rand(args...)</code></pre><p>Return a random number or element from the sample, using the model RNG. This is a utility wrapper that can only be used a context where the <code>model</code> object is available.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L118-L124">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@shuffle!-Tuple{Any}" href="#Persefone.@shuffle!-Tuple{Any}"><code>Persefone.@shuffle!</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@shuffle!(collection)</code></pre><p>Shuffle the given collection in place, using the model RNG. This is a utility wrapper that can only be used a context where the <code>model</code> object is available.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/input.jl#L129-L135">source</a></section></article><h2 id="output.jl"><a class="docs-heading-anchor" href="#output.jl">output.jl</a><a id="output.jl-1"></a><a class="docs-heading-anchor-permalink" href="#output.jl" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.DataOutput" href="#Persefone.DataOutput"><code>Persefone.DataOutput</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DataOutput</code></pre><p>A struct for organising model output. This is used to collect model data in an in-memory dataframe or for CSV output. Submodels can register their own output functions using <a href="io.html#Persefone.newdataoutput!"><code>newdataoutput!</code></a>.</p><p>Struct fields:     - name: a string identifier for the data collection (used as file name)     - header: a list of column names     - outputfunction: a function that takes a model object and returns data values to record (formatted as a vector of vectors)     - frequency: how often to call the output function (daily/monthly/yearly/end/never)     - plotfunction: a function that takes a model object and returns a Makie figure object (optional)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L122-L135">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.createdatadir-Tuple{String, Union{Bool, String}}" href="#Persefone.createdatadir-Tuple{String, Union{Bool, String}}"><code>Persefone.createdatadir</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">createdatadir(outdir, overwrite)</code></pre><p>Creates the output directory, dealing with possible conflicts.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L11-L15">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.modellogger-Tuple{String, String}" href="#Persefone.modellogger-Tuple{String, String}"><code>Persefone.modellogger</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">modellogger(loglevel, outdir)</code></pre><p>Create a logger object that writes output both to screen and to a logfile. This object is stored as <code>model.logger</code> and can then be used with <code>with_logger()</code>. Note: requires <a href="io.html#Persefone.createdatadir-Tuple{String, Union{Bool, String}}"><code>createdatadir</code></a> to be run first.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L32-L38">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.newdataoutput!" href="#Persefone.newdataoutput!"><code>Persefone.newdataoutput!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">newdataoutput!(model, name, header, outputfunction, frequency)</code></pre><p>Create and register a new data output. This function must be called by all submodels that want to have their output functions called regularly.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L144-L149">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.outputdata" href="#Persefone.outputdata"><code>Persefone.outputdata</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">outputdata(model, force=false)</code></pre><p>Cycle through all registered data outputs and activate them according to their configured frequency. If <code>force</code> is <code>true</code>, activate all outputs regardless of their configuration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L174-L180">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.prepareTOML-Tuple{Any}" href="#Persefone.prepareTOML-Tuple{Any}"><code>Persefone.prepareTOML</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">prepareTOML(dict)</code></pre><p>An internal utility function to re-convert the one-dimensional dict created by <a href="io.html#Persefone.flattenTOML-Tuple{Any}"><code>flattenTOML</code></a> into the two-dimensional dict needed by <code>TOML.print</code>, and convert any data types into TOML-compatible types where necessary.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L100-L106">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.saveinputfiles-Tuple{Agents.AgentBasedModel}" href="#Persefone.saveinputfiles-Tuple{Agents.AgentBasedModel}"><code>Persefone.saveinputfiles</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">saveinputfiles(model)</code></pre><p>Copy all input files into the output directory, including the actual parameter settings used. This allows replicating a run in future.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L66-L71">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.savemodelobject-Tuple{Agents.AgentBasedModel, String}" href="#Persefone.savemodelobject-Tuple{Agents.AgentBasedModel, String}"><code>Persefone.savemodelobject</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">savemodelobject(model, filename)</code></pre><p>Serialise a model object and save it to file for later reference. Includes the current model and Julia versions for compatibility checking.</p><p>WARNING: produces large files (&gt;100 MB) and takes a while to execute.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L228-L235">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.visualiseoutput" href="#Persefone.visualiseoutput"><code>Persefone.visualiseoutput</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">visualiseoutput(model)</code></pre><p>Cycle through all data outputs and call their respective plot functions, saving each figure as a PDF.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L212-L217">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.withtestlogger-Tuple{Agents.AgentBasedModel}" href="#Persefone.withtestlogger-Tuple{Agents.AgentBasedModel}"><code>Persefone.withtestlogger</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">withtestlogger(model)</code></pre><p>Replace the model logger with the currently active logger. This is intended to be used in the testsuite to circumvent a <a href="https://github.com/JuliaLang/julia/issues/48456">Julia issue</a>, where <code>@test_logs</code> doesn&#39;t work with local loggers.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/output.jl#L52-L58">source</a></section></article><h2 id="makieplots.jl"><a class="docs-heading-anchor" href="#makieplots.jl">makieplots.jl</a><a id="makieplots.jl-1"></a><a class="docs-heading-anchor-permalink" href="#makieplots.jl" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.gettickmarks-Tuple{Any}" href="#Persefone.gettickmarks-Tuple{Any}"><code>Persefone.gettickmarks</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">gettickmarks(dates)</code></pre><p>Given a vector of dates, construct a selection to use as tick mark locations. Helper function for <code>[populationtrends](@ref)</code></p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/analysis/makieplots.jl#L72-L77">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.populationtrends-Tuple{Agents.AgentBasedModel}" href="#Persefone.populationtrends-Tuple{Agents.AgentBasedModel}"><code>Persefone.populationtrends</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">populationtrends(model)</code></pre><p>Plot a line graph of population sizes of each species over time. Returns a Makie figure object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/analysis/makieplots.jl#L48-L53">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.visualisemap" href="#Persefone.visualisemap"><code>Persefone.visualisemap</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">visualisemap(model, date, landcovermap)</code></pre><p>Draw the model&#39;s land cover map and plot all individuals as points on it at the specified date. If no date is passed, use the last date for which data are available. Optionally, you can pass a landcover map image (this is needed to reduce the frequency of disk I/O for Persefone Desktop). Returns a Makie figure object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/analysis/makieplots.jl#L6-L14">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="simulation.html">« Simulation</a><a class="docs-footer-nextpage" href="nature.html">Nature »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/nature.html b/docs/build/nature.html
index b420f63..e6d8a7a 100644
--- a/docs/build/nature.html
+++ b/docs/build/nature.html
@@ -1,10 +1,10 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Nature · Persefone</title><meta name="title" content="Nature · Persefone"/><meta property="og:title" content="Nature · Persefone"/><meta property="twitter:title" content="Nature · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li class="is-active"><a class="tocitem" href="nature.html">Nature</a><ul class="internal"><li><a class="tocitem" href="#nature.jl"><span>nature.jl</span></a></li><li><a class="tocitem" href="#populations.jl"><span>populations.jl</span></a></li><li><a class="tocitem" href="#insects.jl"><span>insects.jl</span></a></li><li><a class="tocitem" href="#ecologicaldata.jl"><span>ecologicaldata.jl</span></a></li></ul></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Nature</a></li><li class="is-active"><a href="nature.html">Nature</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="nature.html">Nature</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/nature.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Nature"><a class="docs-heading-anchor" href="#Nature">Nature</a><a id="Nature-1"></a><a class="docs-heading-anchor-permalink" href="#Nature" title="Permalink"></a></h1><h2 id="nature.jl"><a class="docs-heading-anchor" href="#nature.jl">nature.jl</a><a id="nature.jl-1"></a><a class="docs-heading-anchor-permalink" href="#nature.jl" title="Permalink"></a></h2><p>This file is responsible for managing the animal modules.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.Animal" href="#Persefone.Animal"><code>Persefone.Animal</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Animal</code></pre><p>This is the generic agent type for all animals. Species are differentiated by trait dictionaries passed by them during initialisation. (Note that each trait variable can still be accessed as if it were a normal field name, i.e. the trait <code>phase</code> can be accessed and modified with <code>animal.phase</code>.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L12-L19">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.animalid-Tuple{Animal}" href="#Persefone.animalid-Tuple{Animal}"><code>Persefone.animalid</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">animalid(animal)</code></pre><p>A small utility function to return a string with the species name and ID of an animal.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L57-L61">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initnature!-Tuple{Agents.AgentBasedModel}" href="#Persefone.initnature!-Tuple{Agents.AgentBasedModel}"><code>Persefone.initnature!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initnature!(model)</code></pre><p>Initialise the model with all simulated animal populations.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L76-L80">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}" href="#Persefone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}"><code>Persefone.stepagent!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">stepagent!(animal, model)</code></pre><p>Update an animal by one day, executing it&#39;s currently active phase function.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@countanimals-Tuple" href="#Persefone.@countanimals-Tuple"><code>Persefone.@countanimals</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@countanimals(species=&quot;&quot;, radius=0)</code></pre><p>Count the number of animals of the given species in this location. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L379-L385">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@cropheight-Tuple{}" href="#Persefone.@cropheight-Tuple{}"><code>Persefone.@cropheight</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@cropheight</code></pre><p>Return the height of the crop at this position, or 0 if there is no crop here. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L346-L352">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@cropname-Tuple{}" href="#Persefone.@cropname-Tuple{}"><code>Persefone.@cropname</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@cropname</code></pre><p>Return the name of the local croptype, or nothing if there is no crop here. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L335-L341">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@distanceto-Tuple{Any}" href="#Persefone.@distanceto-Tuple{Any}"><code>Persefone.@distanceto</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@distanceto(habitat)</code></pre><p>Calculate the distance to the closest habitat of the specified type or descriptor. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L357-L363">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@distancetoedge-Tuple{}" href="#Persefone.@distancetoedge-Tuple{}"><code>Persefone.@distancetoedge</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@distancetoedge</code></pre><p>Calculate the distance to the closest neighbouring habitat. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L368-L374">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@habitat-Tuple{Any}" href="#Persefone.@habitat-Tuple{Any}"><code>Persefone.@habitat</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@habitat</code></pre><p>Specify habitat suitability for spatial ecological processes.</p><p>This macro works by creating an anonymous function that takes in a model object and a position, and returns <code>true</code> or <code>false</code> depending on the conditions specified in the macro body.</p><p>Several utility macros can be used within the body of <code>@habitat</code> as a short-hand for common expressions: <a href="nature.html#Persefone.@landcover-Tuple{}"><code>@landcover</code></a>, <a href="nature.html#Persefone.@cropname-Tuple{}"><code>@cropname</code></a>, <a href="nature.html#Persefone.@cropheight-Tuple{}"><code>@cropheight</code></a>, <a href="nature.html#Persefone.@distanceto-Tuple{Any}"><code>@distanceto</code></a>, <a href="nature.html#Persefone.@distancetoedge-Tuple{}"><code>@distancetoedge</code></a>, <a href="nature.html#Persefone.@countanimals-Tuple"><code>@countanimals</code></a>. The variables <code>model</code> and <code>pos</code> can be used for checks that don&#39;t have a macro available.</p><p>Two example uses of <code>@habitat</code> might look like this:</p><pre><code class="language-julia hljs">movementhabitat = @habitat(@landcover() in (grass agriculture soil))
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Nature · Persefone</title><meta name="title" content="Nature · Persefone"/><meta property="og:title" content="Nature · Persefone"/><meta property="twitter:title" content="Nature · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li class="is-active"><a class="tocitem" href="nature.html">Nature</a><ul class="internal"><li><a class="tocitem" href="#nature.jl"><span>nature.jl</span></a></li><li><a class="tocitem" href="#populations.jl"><span>populations.jl</span></a></li><li><a class="tocitem" href="#insects.jl"><span>insects.jl</span></a></li><li><a class="tocitem" href="#ecologicaldata.jl"><span>ecologicaldata.jl</span></a></li></ul></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Nature</a></li><li class="is-active"><a href="nature.html">Nature</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="nature.html">Nature</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/nature.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Nature"><a class="docs-heading-anchor" href="#Nature">Nature</a><a id="Nature-1"></a><a class="docs-heading-anchor-permalink" href="#Nature" title="Permalink"></a></h1><h2 id="nature.jl"><a class="docs-heading-anchor" href="#nature.jl">nature.jl</a><a id="nature.jl-1"></a><a class="docs-heading-anchor-permalink" href="#nature.jl" title="Permalink"></a></h2><p>This file is responsible for managing the animal modules.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.Animal" href="#Persefone.Animal"><code>Persefone.Animal</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Animal</code></pre><p>This is the generic agent type for all animals. Species are differentiated by trait dictionaries passed by them during initialisation. (Note that each trait variable can still be accessed as if it were a normal field name, i.e. the trait <code>phase</code> can be accessed and modified with <code>animal.phase</code>.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L12-L19">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.animalid-Tuple{Animal}" href="#Persefone.animalid-Tuple{Animal}"><code>Persefone.animalid</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">animalid(animal)</code></pre><p>A small utility function to return a string with the species name and ID of an animal.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L57-L61">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initnature!-Tuple{Agents.AgentBasedModel}" href="#Persefone.initnature!-Tuple{Agents.AgentBasedModel}"><code>Persefone.initnature!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initnature!(model)</code></pre><p>Initialise the model with all simulated animal populations.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L76-L80">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}" href="#Persefone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}"><code>Persefone.stepagent!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">stepagent!(animal, model)</code></pre><p>Update an animal by one day, executing it&#39;s currently active phase function.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@countanimals-Tuple" href="#Persefone.@countanimals-Tuple"><code>Persefone.@countanimals</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@countanimals(species=&quot;&quot;, radius=0)</code></pre><p>Count the number of animals of the given species in this location. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L379-L385">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@cropheight-Tuple{}" href="#Persefone.@cropheight-Tuple{}"><code>Persefone.@cropheight</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@cropheight</code></pre><p>Return the height of the crop at this position, or 0 if there is no crop here. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L346-L352">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@cropname-Tuple{}" href="#Persefone.@cropname-Tuple{}"><code>Persefone.@cropname</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@cropname</code></pre><p>Return the name of the local croptype, or nothing if there is no crop here. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L335-L341">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@distanceto-Tuple{Any}" href="#Persefone.@distanceto-Tuple{Any}"><code>Persefone.@distanceto</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@distanceto(habitat)</code></pre><p>Calculate the distance to the closest habitat of the specified type or descriptor. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L357-L363">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@distancetoedge-Tuple{}" href="#Persefone.@distancetoedge-Tuple{}"><code>Persefone.@distancetoedge</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@distancetoedge</code></pre><p>Calculate the distance to the closest neighbouring habitat. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L368-L374">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@habitat-Tuple{Any}" href="#Persefone.@habitat-Tuple{Any}"><code>Persefone.@habitat</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@habitat</code></pre><p>Specify habitat suitability for spatial ecological processes.</p><p>This macro works by creating an anonymous function that takes in a model object and a position, and returns <code>true</code> or <code>false</code> depending on the conditions specified in the macro body.</p><p>Several utility macros can be used within the body of <code>@habitat</code> as a short-hand for common expressions: <a href="nature.html#Persefone.@landcover-Tuple{}"><code>@landcover</code></a>, <a href="nature.html#Persefone.@cropname-Tuple{}"><code>@cropname</code></a>, <a href="nature.html#Persefone.@cropheight-Tuple{}"><code>@cropheight</code></a>, <a href="nature.html#Persefone.@distanceto-Tuple{Any}"><code>@distanceto</code></a>, <a href="nature.html#Persefone.@distancetoedge-Tuple{}"><code>@distancetoedge</code></a>, <a href="nature.html#Persefone.@countanimals-Tuple"><code>@countanimals</code></a>. The variables <code>model</code> and <code>pos</code> can be used for checks that don&#39;t have a macro available.</p><p>Two example uses of <code>@habitat</code> might look like this:</p><pre><code class="language-julia hljs">movementhabitat = @habitat(@landcover() in (grass agriculture soil))
 
 nestinghabitat = @habitat((@landcover() == grass || 
                            (@landcover() == agriculture &amp;&amp; @cropname() != &quot;maize&quot; &amp;&amp;
                             @cropheight() &lt; 10)) &amp;&amp;
-                          @distanceto(forest) &gt; 20)</code></pre><p>For more complex habitat suitability checks, the use of this macro can be circumvented by directly creating an equivalent function.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L280-L307">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@initialise-Tuple{Any, Vararg{Any}}" href="#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>Persefone.@initialise</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@initialise(habitatdescriptor; kwargs...)</code></pre><p>Call this macro within the body of <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a>. It passes the given habitat descriptor function and keyword arguments on to <a href="nature.html#Persefone.initpopulation-Tuple{Function}"><code>initpopulation</code></a> when setting up the simulation.</p><p>Note: if this macro is not used, the variable <code>initialise!</code> must be set manually in the species definition.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L152-L160">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@kill-Tuple" href="#Persefone.@kill-Tuple"><code>Persefone.@kill</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@kill</code></pre><p>Kill this animal (and immediately abort its current update). This is a thin wrapper around <a href="nature.html#Persefone.kill!"><code>kill!</code></a>, and passes on any arguments. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L245-L251">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@landcover-Tuple{}" href="#Persefone.@landcover-Tuple{}"><code>Persefone.@landcover</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@landcover</code></pre><p>Returns the local landcover. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L325-L330">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@neighbours-Tuple{Any}" href="#Persefone.@neighbours-Tuple{Any}"><code>Persefone.@neighbours</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@neighbours(radius)</code></pre><p>Return an iterator over all animals in the given radius around this animal, excluding itself. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L269-L274">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@phase-Tuple{Any, Any}" href="#Persefone.@phase-Tuple{Any, Any}"><code>Persefone.@phase</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@phase(name, body)</code></pre><p>This macro is designed to be used within a species definition block (i.e. within the body of a call to <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a>).</p><p>The idea behind this is that species show very different behaviour during different phases of their lives. Therefore, <code>@phase</code> can be used define the behaviour for one such phase, and the conditions under which the animal transitions to another phase.</p><p><code>@phase</code> works by creating a function that will be called by the model if the animal is in the relevant phase. When it is called, it has access to the following variables:</p><ul><li><code>animal</code> a reference to the animal itself. This provides access to <code>animal.age</code>,   <code>animal.sex</code>, and <code>animal.&lt;trait&gt;</code> (where &lt;trait&gt; is a variable that was defined   in the top part of the species definition body).</li><li><code>pos</code> gives the animal&#39;s current position as a coordinate tuple.</li><li><code>model</code> a reference to the model world (an object of type <code>AgentBasedModel</code>).   This allows access to <code>model.date</code> (the current simulation date) and   <code>model.landscape</code> (a two-dimensional array of pixels containing geographic   information).</li></ul><p>Several utility macros can be used within the body of <code>@phase</code> as a short-hand for common expressions: <a href="nature.html#Persefone.@trait-Tuple{Any}"><code>@trait</code></a>, <a href="nature.html#Persefone.@setphase-Tuple{Any}"><code>@setphase</code></a>, <a href="nature.html#Persefone.@respond-Tuple{Any, Any}"><code>@respond</code></a>, <a href="nature.html#Persefone.@kill-Tuple"><code>@kill</code></a>, <a href="nature.html#Persefone.@reproduce-Tuple"><code>@reproduce</code></a>, <a href="nature.html#Persefone.@neighbours-Tuple{Any}"><code>@neighbours</code></a>, <a href="io.html#Persefone.@rand-Tuple"><code>@rand</code></a>, <a href="io.html#Persefone.@shuffle!-Tuple{Any}"><code>@shuffle!</code></a>.</p><p>Note that the first phase that is defined in a species definition block will be the phase that animals are assigned at birth, unless the variable <code>phase</code> is explicitly defined by the user in the species definition block.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L165-L195">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@reproduce-Tuple" href="#Persefone.@reproduce-Tuple"><code>Persefone.@reproduce</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@reproduce</code></pre><p>Let this animal reproduce. This is a thin wrapper around <a href="energy.html#Persefone.reproduce!-Tuple{Persefone.EnergyBudget}"><code>reproduce!</code></a>, and passes on any arguments. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L259-L264">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@respond-Tuple{Any, Any}" href="#Persefone.@respond-Tuple{Any, Any}"><code>Persefone.@respond</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@respond(eventname, body)</code></pre><p>Define how an animal responds to a landscape event that affects its current position. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L231-L236">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@setphase-Tuple{Any}" href="#Persefone.@setphase-Tuple{Any}"><code>Persefone.@setphase</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@setphase(newphase)</code></pre><p>Switch this animal over to a different phase. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L221-L225">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@species-Tuple{Any, Any}" href="#Persefone.@species-Tuple{Any, Any}"><code>Persefone.@species</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@species(name, body)</code></pre><p>A macro used to create new species definitions for the nature model. This is effectively a simple domain-specific language, establishing a custom syntax to describe species&#39; biology:</p><pre><code class="language-julia hljs">@species name begin
+                          @distanceto(forest) &gt; 20)</code></pre><p>For more complex habitat suitability checks, the use of this macro can be circumvented by directly creating an equivalent function.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L280-L307">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@initialise-Tuple{Any, Vararg{Any}}" href="#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>Persefone.@initialise</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@initialise(habitatdescriptor; kwargs...)</code></pre><p>Call this macro within the body of <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a>. It passes the given habitat descriptor function and keyword arguments on to <a href="nature.html#Persefone.initpopulation-Tuple{Function}"><code>initpopulation</code></a> when setting up the simulation.</p><p>Note: if this macro is not used, the variable <code>initialise!</code> must be set manually in the species definition.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L152-L160">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@kill-Tuple" href="#Persefone.@kill-Tuple"><code>Persefone.@kill</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@kill</code></pre><p>Kill this animal (and immediately abort its current update). This is a thin wrapper around <a href="nature.html#Persefone.kill!"><code>kill!</code></a>, and passes on any arguments. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L245-L251">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@landcover-Tuple{}" href="#Persefone.@landcover-Tuple{}"><code>Persefone.@landcover</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@landcover</code></pre><p>Returns the local landcover. This is a utility wrapper that can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> or <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L325-L330">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@neighbours-Tuple{Any}" href="#Persefone.@neighbours-Tuple{Any}"><code>Persefone.@neighbours</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@neighbours(radius)</code></pre><p>Return an iterator over all animals in the given radius around this animal, excluding itself. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L269-L274">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@phase-Tuple{Any, Any}" href="#Persefone.@phase-Tuple{Any, Any}"><code>Persefone.@phase</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@phase(name, body)</code></pre><p>This macro is designed to be used within a species definition block (i.e. within the body of a call to <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a>).</p><p>The idea behind this is that species show very different behaviour during different phases of their lives. Therefore, <code>@phase</code> can be used define the behaviour for one such phase, and the conditions under which the animal transitions to another phase.</p><p><code>@phase</code> works by creating a function that will be called by the model if the animal is in the relevant phase. When it is called, it has access to the following variables:</p><ul><li><code>animal</code> a reference to the animal itself. This provides access to <code>animal.age</code>,   <code>animal.sex</code>, and <code>animal.&lt;trait&gt;</code> (where &lt;trait&gt; is a variable that was defined   in the top part of the species definition body).</li><li><code>pos</code> gives the animal&#39;s current position as a coordinate tuple.</li><li><code>model</code> a reference to the model world (an object of type <code>AgentBasedModel</code>).   This allows access to <code>model.date</code> (the current simulation date) and   <code>model.landscape</code> (a two-dimensional array of pixels containing geographic   information).</li></ul><p>Several utility macros can be used within the body of <code>@phase</code> as a short-hand for common expressions: <a href="nature.html#Persefone.@trait-Tuple{Any}"><code>@trait</code></a>, <a href="nature.html#Persefone.@setphase-Tuple{Any}"><code>@setphase</code></a>, <a href="nature.html#Persefone.@respond-Tuple{Any, Any}"><code>@respond</code></a>, <a href="nature.html#Persefone.@kill-Tuple"><code>@kill</code></a>, <a href="nature.html#Persefone.@reproduce-Tuple"><code>@reproduce</code></a>, <a href="nature.html#Persefone.@neighbours-Tuple{Any}"><code>@neighbours</code></a>, <a href="io.html#Persefone.@rand-Tuple"><code>@rand</code></a>, <a href="io.html#Persefone.@shuffle!-Tuple{Any}"><code>@shuffle!</code></a>.</p><p>Note that the first phase that is defined in a species definition block will be the phase that animals are assigned at birth, unless the variable <code>phase</code> is explicitly defined by the user in the species definition block.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L165-L195">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@reproduce-Tuple" href="#Persefone.@reproduce-Tuple"><code>Persefone.@reproduce</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@reproduce</code></pre><p>Let this animal reproduce. This is a thin wrapper around <a href="energy.html#Persefone.reproduce!-Tuple{Persefone.EnergyBudget}"><code>reproduce!</code></a>, and passes on any arguments. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L259-L264">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@respond-Tuple{Any, Any}" href="#Persefone.@respond-Tuple{Any, Any}"><code>Persefone.@respond</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@respond(eventname, body)</code></pre><p>Define how an animal responds to a landscape event that affects its current position. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L231-L236">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@setphase-Tuple{Any}" href="#Persefone.@setphase-Tuple{Any}"><code>Persefone.@setphase</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@setphase(newphase)</code></pre><p>Switch this animal over to a different phase. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L221-L225">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@species-Tuple{Any, Any}" href="#Persefone.@species-Tuple{Any, Any}"><code>Persefone.@species</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@species(name, body)</code></pre><p>A macro used to create new species definitions for the nature model. This is effectively a simple domain-specific language, establishing a custom syntax to describe species&#39; biology:</p><pre><code class="language-julia hljs">@species name begin
 
     @initialise(@habitat(...))
     speciesvar1 = 3.14
@@ -13,4 +13,4 @@ nestinghabitat = @habitat((@landcover() == grass ||
     @phase phase1 begin
         ...
     end
-end</code></pre><p>The definition body (enclosed in the begin/end block) has two sections. First comes a call to <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a>, and optionally a list of species-specific parameters, which are assigned just like normal variables. Second come one or more phase definitions, that describe the behaviour of the species during various parts of its life cycle. (See the documentation to <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a> and <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> for details).</p><p>Code in a species definition block can access the rest of the model using the <code>model</code> variable (an object of type <code>AgentBasedModel</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L99-L128">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@trait-Tuple{Any}" href="#Persefone.@trait-Tuple{Any}"><code>Persefone.@trait</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@trait(traitname)</code></pre><p>A utility macro to quickly access an animal&#39;s trait value. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/nature.jl#L207-L212">source</a></section></article><h2 id="populations.jl"><a class="docs-heading-anchor" href="#populations.jl">populations.jl</a><a id="populations.jl-1"></a><a class="docs-heading-anchor-permalink" href="#populations.jl" title="Permalink"></a></h2><p>This file contains a set of utility functions for species, including initialisation, reproduction, and mortality.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.countanimals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">countanimals(pos, model; species=&quot;&quot;, radius=0)</code></pre><p>Count the number of animals in this location (optionally supplying a species name and radius).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/populations.jl#L137-L141">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initpopulation-Tuple{Function}" href="#Persefone.initpopulation-Tuple{Function}"><code>Persefone.initpopulation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initpopulation(habitatdescriptor; popsize=-1, pairs=false, asexual=false)</code></pre><p>Creates a function that initialises individuals at random locations across the landscape. This can be used to create the <code>initialise!</code> variable in a species definition block.</p><ul><li><p><code>habitatdescriptor</code> is a function that determines whether a given location is suitable   or not (create this using <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>).</p></li><li><p><code>phase</code> determines which life phase individuals will be assigned to. If this is <code>nothing</code>,   the species&#39; default post-natal life stage will be used (although note that this is   probably not what you want).</p></li><li><p><code>popsize</code> determines the number of individuals that will be created. If this is zero or   negative, one individual will be created in every suitable location in the landscape.   If <code>popsize</code> is greater than the number of suitable locations, multiple individuals   will be created in one place. (Maximum population density can be set in the habitat   descriptor using the <a href="nature.html#Persefone.@countanimals-Tuple"><code>@countanimals</code></a> macro.)</p></li><li><p>If <code>pairs</code> is true, a male and a female individual will be created in each selected   location, otherwise, only one individual will be created at a time.</p></li><li><p>If <code>asexual</code> is true, all created individuals are assigned the sex <code>hermaphrodite</code>,   otherwise, they are randomly assigned male of female. (If <code>pairs</code> is true, <code>asexual</code>   is ignored.)</p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/populations.jl#L7-L32">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initrandompopulation-Tuple{Int64}" href="#Persefone.initrandompopulation-Tuple{Int64}"><code>Persefone.initrandompopulation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initrandompopulation(popsize; kwargs...)</code></pre><p>A simplified version of <a href="nature.html#Persefone.initpopulation-Tuple{Function}"><code>initpopulation</code></a>. Creates a function that initialises <code>popsize</code> individuals, spread at random across the landscape.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/populations.jl#L70-L75">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.kill!" href="#Persefone.kill!"><code>Persefone.kill!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">kill(animal, model, probability=1.0, cause=&quot;&quot;)</code></pre><p>Kill this animal, optionally with a given percentage probability. Returns true if the animal dies, false if not.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/populations.jl#L99-L104">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}" href="#Persefone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}"><code>Persefone.nearby_animals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">nearby_animals(animal, model, radius)</code></pre><p>Return an iterator over all animals in the given radius around this animal, excluding itself.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/populations.jl#L126-L130">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}" href="#Persefone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}"><code>Persefone.nearby_animals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">nearby_animals(pos, model, radius)</code></pre><p>Return an iterator over all animals in the given radius around this position.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/populations.jl#L115-L119">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.reproduce!" href="#Persefone.reproduce!"><code>Persefone.reproduce!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">reproduce!(animal, model, n=1)</code></pre><p>Produce one or more offspring for the given animal at its current location.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/populations.jl#L84-L88">source</a></section></article><h2 id="insects.jl"><a class="docs-heading-anchor" href="#insects.jl">insects.jl</a><a id="insects.jl-1"></a><a class="docs-heading-anchor-permalink" href="#insects.jl" title="Permalink"></a></h2><p>This file contains the insect submodel, which calculates the likely insect biomass in a given location at a given time.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.insectbiomass-Tuple{Pixel, Agents.AgentBasedModel}" href="#Persefone.insectbiomass-Tuple{Pixel, Agents.AgentBasedModel}"><code>Persefone.insectbiomass</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">insectbiomass(pixel, model)</code></pre><p>Calculate the insect biomass in this location, using the factors configured in the <code>nature.insectmodel</code> settings (any combination of: &quot;season&quot;, &quot;habitat&quot;, &quot;weather&quot;, &quot;pesticides&quot;). Returns a float value in g/m².</p><p><strong>Biological note:</strong> this is a very approximate calculation! Insect biomass varies wildly in time and space and is hard to measure. This calculation is based on the idea of a parabolic seasonal development of insect abundance, modified by habitat suitability, weather, and pesticide application. Although it is based on empirical studies, it can only deliver a rough, order-of-magnitude estimation of likely insect biomass in a given location.</p><p><strong>Sources:</strong></p><ul><li>Odderskær et al. (1997). Skylark Reproduction in Pesticide Treated and Untreated Fields (32; Pesticides Research). Danish Environmental Protection Agency.</li><li>Grüebler et al. (2008). A predictive model of the density of airborne insects in agricultural environments. Agriculture, Ecosystems &amp; Environment, 123(1), 75–80. https://doi.org/10.1016/j.agee.2007.05.001</li><li>Paquette et al. (2013). Seasonal patterns in Tree Swallow prey (Diptera) abundance are affected by agricultural intensification. Ecological Applications, 23(1), 122–133. https://doi.org/10.1890/12-0068.1</li><li>Püttmanns et al. (2022). Habitat use and foraging parameters of breeding Skylarks indicate no seasonal decrease in food availability in heterogeneous farmland. Ecology and Evolution, 12(1), e8461. https://doi.org/10.1002/ece3.8461</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/insects.jl#L6-L26">source</a></section></article><h2 id="ecologicaldata.jl"><a class="docs-heading-anchor" href="#ecologicaldata.jl">ecologicaldata.jl</a><a id="ecologicaldata.jl-1"></a><a class="docs-heading-anchor-permalink" href="#ecologicaldata.jl" title="Permalink"></a></h2><p>This file contains a set of life-history related utility functions needed by species.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initecologicaldata-Tuple{Agents.AgentBasedModel}" href="#Persefone.initecologicaldata-Tuple{Agents.AgentBasedModel}"><code>Persefone.initecologicaldata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initecologicaldata()</code></pre><p>Create output files for each data group collected by the nature model.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/ecologicaldata.jl#L6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.saveindividualdata-Tuple{Agents.AgentBasedModel}" href="#Persefone.saveindividualdata-Tuple{Agents.AgentBasedModel}"><code>Persefone.saveindividualdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">saveindividualdata(model)</code></pre><p>Return a comma-separated set of lines (to be printed to <code>individuals.csv</code>), listing all properties of all animal individuals in the model. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter <code>nature.indoutfreq</code>. WARNING: Produces very big files!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/ecologicaldata.jl#L39-L46">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.savepopulationdata-Tuple{Agents.AgentBasedModel}" href="#Persefone.savepopulationdata-Tuple{Agents.AgentBasedModel}"><code>Persefone.savepopulationdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">savepopulationdata(model)</code></pre><p>Return a comma-separated set of lines (to be printed to <code>populations.csv</code>), giving the current date and population size for each animal species. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter <code>nature.popoutfreq</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/nature/ecologicaldata.jl#L18-L25">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="io.html">« Input and Output</a><a class="docs-footer-nextpage" href="energy.html">Dynamic Energy Budgets »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+end</code></pre><p>The definition body (enclosed in the begin/end block) has two sections. First comes a call to <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a>, and optionally a list of species-specific parameters, which are assigned just like normal variables. Second come one or more phase definitions, that describe the behaviour of the species during various parts of its life cycle. (See the documentation to <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a> and <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> for details).</p><p>Code in a species definition block can access the rest of the model using the <code>model</code> variable (an object of type <code>AgentBasedModel</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L99-L128">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.@trait-Tuple{Any}" href="#Persefone.@trait-Tuple{Any}"><code>Persefone.@trait</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@trait(traitname)</code></pre><p>A utility macro to quickly access an animal&#39;s trait value. This can only be used nested within <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/nature.jl#L207-L212">source</a></section></article><h2 id="populations.jl"><a class="docs-heading-anchor" href="#populations.jl">populations.jl</a><a id="populations.jl-1"></a><a class="docs-heading-anchor-permalink" href="#populations.jl" title="Permalink"></a></h2><p>This file contains a set of utility functions for species, including initialisation, reproduction, and mortality.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.countanimals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">countanimals(pos, model; species=&quot;&quot;, radius=0)</code></pre><p>Count the number of animals in this location (optionally supplying a species name and radius).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/populations.jl#L137-L141">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initpopulation-Tuple{Function}" href="#Persefone.initpopulation-Tuple{Function}"><code>Persefone.initpopulation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initpopulation(habitatdescriptor; popsize=-1, pairs=false, asexual=false)</code></pre><p>Creates a function that initialises individuals at random locations across the landscape. This can be used to create the <code>initialise!</code> variable in a species definition block.</p><ul><li><p><code>habitatdescriptor</code> is a function that determines whether a given location is suitable   or not (create this using <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>).</p></li><li><p><code>phase</code> determines which life phase individuals will be assigned to. If this is <code>nothing</code>,   the species&#39; default post-natal life stage will be used (although note that this is   probably not what you want).</p></li><li><p><code>popsize</code> determines the number of individuals that will be created. If this is zero or   negative, one individual will be created in every suitable location in the landscape.   If <code>popsize</code> is greater than the number of suitable locations, multiple individuals   will be created in one place. (Maximum population density can be set in the habitat   descriptor using the <a href="nature.html#Persefone.@countanimals-Tuple"><code>@countanimals</code></a> macro.)</p></li><li><p>If <code>pairs</code> is true, a male and a female individual will be created in each selected   location, otherwise, only one individual will be created at a time.</p></li><li><p>If <code>asexual</code> is true, all created individuals are assigned the sex <code>hermaphrodite</code>,   otherwise, they are randomly assigned male of female. (If <code>pairs</code> is true, <code>asexual</code>   is ignored.)</p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/populations.jl#L7-L32">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initrandompopulation-Tuple{Int64}" href="#Persefone.initrandompopulation-Tuple{Int64}"><code>Persefone.initrandompopulation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initrandompopulation(popsize; kwargs...)</code></pre><p>A simplified version of <a href="nature.html#Persefone.initpopulation-Tuple{Function}"><code>initpopulation</code></a>. Creates a function that initialises <code>popsize</code> individuals, spread at random across the landscape.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/populations.jl#L70-L75">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.kill!" href="#Persefone.kill!"><code>Persefone.kill!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">kill(animal, model, probability=1.0, cause=&quot;&quot;)</code></pre><p>Kill this animal, optionally with a given percentage probability. Returns true if the animal dies, false if not.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/populations.jl#L99-L104">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}" href="#Persefone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}"><code>Persefone.nearby_animals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">nearby_animals(animal, model, radius)</code></pre><p>Return an iterator over all animals in the given radius around this animal, excluding itself.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/populations.jl#L126-L130">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}" href="#Persefone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}"><code>Persefone.nearby_animals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">nearby_animals(pos, model, radius)</code></pre><p>Return an iterator over all animals in the given radius around this position.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/populations.jl#L115-L119">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.reproduce!" href="#Persefone.reproduce!"><code>Persefone.reproduce!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">reproduce!(animal, model, n=1)</code></pre><p>Produce one or more offspring for the given animal at its current location.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/populations.jl#L84-L88">source</a></section></article><h2 id="insects.jl"><a class="docs-heading-anchor" href="#insects.jl">insects.jl</a><a id="insects.jl-1"></a><a class="docs-heading-anchor-permalink" href="#insects.jl" title="Permalink"></a></h2><p>This file contains the insect submodel, which calculates the likely insect biomass in a given location at a given time.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.insectbiomass-Tuple{Pixel, Agents.AgentBasedModel}" href="#Persefone.insectbiomass-Tuple{Pixel, Agents.AgentBasedModel}"><code>Persefone.insectbiomass</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">insectbiomass(pixel, model)</code></pre><p>Calculate the insect biomass in this location, using the factors configured in the <code>nature.insectmodel</code> settings (any combination of: &quot;season&quot;, &quot;habitat&quot;, &quot;weather&quot;, &quot;pesticides&quot;). Returns a float value in g/m².</p><p><strong>Biological note:</strong> this is a very approximate calculation! Insect biomass varies wildly in time and space and is hard to measure. This calculation is based on the idea of a parabolic seasonal development of insect abundance, modified by habitat suitability, weather, and pesticide application. Although it is based on empirical studies, it can only deliver a rough, order-of-magnitude estimation of likely insect biomass in a given location.</p><p><strong>Sources:</strong></p><ul><li>Odderskær et al. (1997). Skylark Reproduction in Pesticide Treated and Untreated Fields (32; Pesticides Research). Danish Environmental Protection Agency.</li><li>Grüebler et al. (2008). A predictive model of the density of airborne insects in agricultural environments. Agriculture, Ecosystems &amp; Environment, 123(1), 75–80. https://doi.org/10.1016/j.agee.2007.05.001</li><li>Paquette et al. (2013). Seasonal patterns in Tree Swallow prey (Diptera) abundance are affected by agricultural intensification. Ecological Applications, 23(1), 122–133. https://doi.org/10.1890/12-0068.1</li><li>Püttmanns et al. (2022). Habitat use and foraging parameters of breeding Skylarks indicate no seasonal decrease in food availability in heterogeneous farmland. Ecology and Evolution, 12(1), e8461. https://doi.org/10.1002/ece3.8461</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/insects.jl#L6-L26">source</a></section></article><h2 id="ecologicaldata.jl"><a class="docs-heading-anchor" href="#ecologicaldata.jl">ecologicaldata.jl</a><a id="ecologicaldata.jl-1"></a><a class="docs-heading-anchor-permalink" href="#ecologicaldata.jl" title="Permalink"></a></h2><p>This file contains a set of life-history related utility functions needed by species.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initecologicaldata-Tuple{Agents.AgentBasedModel}" href="#Persefone.initecologicaldata-Tuple{Agents.AgentBasedModel}"><code>Persefone.initecologicaldata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initecologicaldata()</code></pre><p>Create output files for each data group collected by the nature model.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/ecologicaldata.jl#L6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.saveindividualdata-Tuple{Agents.AgentBasedModel}" href="#Persefone.saveindividualdata-Tuple{Agents.AgentBasedModel}"><code>Persefone.saveindividualdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">saveindividualdata(model)</code></pre><p>Return a comma-separated set of lines (to be printed to <code>individuals.csv</code>), listing all properties of all animal individuals in the model. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter <code>nature.indoutfreq</code>. WARNING: Produces very big files!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/ecologicaldata.jl#L39-L46">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.savepopulationdata-Tuple{Agents.AgentBasedModel}" href="#Persefone.savepopulationdata-Tuple{Agents.AgentBasedModel}"><code>Persefone.savepopulationdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">savepopulationdata(model)</code></pre><p>Return a comma-separated set of lines (to be printed to <code>populations.csv</code>), giving the current date and population size for each animal species. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter <code>nature.popoutfreq</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/nature/ecologicaldata.jl#L18-L25">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="io.html">« Input and Output</a><a class="docs-footer-nextpage" href="energy.html">Dynamic Energy Budgets »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/odd.html b/docs/build/odd.html
index f4d6c70..e08ead3 100644
--- a/docs/build/odd.html
+++ b/docs/build/odd.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Overview, Design, Details (ODD) · Persefone</title><meta name="title" content="Overview, Design, Details (ODD) · Persefone"/><meta property="og:title" content="Overview, Design, Details (ODD) · Persefone"/><meta property="twitter:title" content="Overview, Design, Details (ODD) · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="odd.html">Overview, Design, Details (ODD)</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="odd.html">Overview, Design, Details (ODD)</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/odd.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Overview,-Design,-Details-(ODD)"><a class="docs-heading-anchor" href="#Overview,-Design,-Details-(ODD)">Overview, Design, Details (ODD)</a><a id="Overview,-Design,-Details-(ODD)-1"></a><a class="docs-heading-anchor-permalink" href="#Overview,-Design,-Details-(ODD)" title="Permalink"></a></h1><p><em>TODO</em></p></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Overview, Design, Details (ODD) · Persefone</title><meta name="title" content="Overview, Design, Details (ODD) · Persefone"/><meta property="og:title" content="Overview, Design, Details (ODD) · Persefone"/><meta property="twitter:title" content="Overview, Design, Details (ODD) · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="odd.html">Overview, Design, Details (ODD)</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="odd.html">Overview, Design, Details (ODD)</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/odd.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Overview,-Design,-Details-(ODD)"><a class="docs-heading-anchor" href="#Overview,-Design,-Details-(ODD)">Overview, Design, Details (ODD)</a><a id="Overview,-Design,-Details-(ODD)-1"></a><a class="docs-heading-anchor-permalink" href="#Overview,-Design,-Details-(ODD)" title="Permalink"></a></h1><p><em>TODO</em></p></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/search_index.js b/docs/build/search_index.js
index 2041f00..81dd378 100644
--- a/docs/build/search_index.js
+++ b/docs/build/search_index.js
@@ -1,3 +1,3 @@
 var documenterSearchIndex = {"docs":
-[{"location":"energy.html#Dynamic-Energy-Budgets","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"","category":"section"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"Persefone's nature module uses Kooijman's Dynamic Energy Budget theory to model energy flows within individuals.","category":"page"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"(Image: \"The standard model of the Dynamic Energy Budget theory\")","category":"page"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"The standard model of the Dynamic Energy Budget theory. (Fig. 1 from Sousa et al. (2010).)","category":"page"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"Sousa et al. (2010). Dynamic energy budget theory restores coherence in biology. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1557), 3413–3428.\nKooijman, S. A. L. M. (2009). Dynamic energy and mass budgets in biological systems (3rd ed). Cambridge University Press.\nSibly et al. (2013). Representing the acquisition and use of energy by individuals in agent-based models of animal populations. Methods in Ecology and Evolution, 4(2), 151–161.","category":"page"},{"location":"energy.html#energy.jl","page":"Dynamic Energy Budgets","title":"energy.jl","text":"","category":"section"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"Modules = [Persefone]\nPages = [\"nature/energy.jl\"]","category":"page"},{"location":"energy.html#Persefone.DEBparameters","page":"Dynamic Energy Budgets","title":"Persefone.DEBparameters","text":"DEBparameters\n\nAn immutable struct to save the parameter list for a species' Dynamic Energy Budget model. (See Sousa et al., 2010.)\n\n\n\n\n\n","category":"type"},{"location":"energy.html#Persefone.EnergyBudget","page":"Dynamic Energy Budgets","title":"Persefone.EnergyBudget","text":"EnergyBudget\n\nThis struct represents an individual's energy balance, as conceptualised by the Dynamic Energy Budget theory. Upon assimilation, energy is first stored as biomass in a reserve buffer, before being used for maintenance, growth, and reproduction. (Note that this is a simplified model form which ignores maturity as a separate buffer.)\n\nSources:\n\nMalishev & Kramer-Schadt (2021). Movement, models, and metabolism: Individual-based energy budget models as next-generation extensions for predicting animal movement outcomes across scales. Ecological Modelling, 441, 109413. https://doi.org/10.1016/j.ecolmodel.2020.109413\nMarques et al. (2018). The AmP project: Comparing species on the basis of dynamic energy budget parameters. PLOS Computational Biology,14(5), e1006100. https://doi.org/10.1371/journal.pcbi.1006100\nSibly et al. (2013). Representing the acquisition and use of energy by individuals in agent-based models of animal populations. Methods in Ecology and Evolution, 4(2), 151–161. https://doi.org/10.1111/2041-210x.12002\nSousa et al. (2010). Dynamic energy budget theory restores coherence in biology. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1557), 3413–3428. https://doi.org/10.1098/rstb.2010.0166\nKooijman, S. A. L. M. (2009). Dynamic energy and mass budgets in biological systems (3rd ed). Cambridge University Press. https://www.researchgate.net/profile/Edgar-Meza-3/post/Isthereatoxicokineticmodelfordaphniamagnaorotherzooplankton/attachment/59d62cf579197b807798b396/AS%3A348547653357569%401460111644286/download/Dynamic+Energy+Budget+theory+-+Kooijman.pdf\nsee also: Brown et al. (2004). Toward a metabolic theory of ecology. Ecology, 85(7), 1771–1789. https://doi.org/10.1890/03-9000\n\n\n\n\n\n","category":"type"},{"location":"energy.html#Persefone.feed!-Tuple{Float64, Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.feed!","text":"feed!(quantity, energybudget)\n\nConsume a given quantity of food. Expands the energy reserve by an amount determined by the assimilation rate. Returns true if successful, false if the reserve is already full.\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.growthrate-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.growthrate","text":"growthrate(energybudget)\n\nCalculate the specific growth rate r. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.investmentratio-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.investmentratio","text":"investmentratio(energybudget)\n\nCalculate the investment ratio g. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.maturitymaintenance-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.maturitymaintenance","text":"maturitymaintenance(energybudget)\n\nCalculate the specific maturity maintenance k_J. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.mobilisation-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.mobilisation","text":"mobilisation(energybudget)\n\nCalculate the mobilisation rate J_EC. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.reproduce!-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.reproduce!","text":"reproduce!(energybudget)\n\nIf there is sufficient energy in the offspring buffer of an adult, produce an embryo/egg, reducing the parent energy in the process. Returns the embryo's energy budget, or nothing if the conditions are not met.\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.scaledreservedensity-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.scaledreservedensity","text":"scaledreservedensity(energybudget)\n\nCalculate the scaled reserve density e. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.update!-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.update!","text":"update!(energybudget)\n\nCarry out a daily update of the energy budget. Mobilises reserves and allocates these to maintenance (prioritised), growth, and reproduction.\n\nReturn true if the individual has enough energy to survive, or false if the reserve is empty and it starves.\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.volumetriclength-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.volumetriclength","text":"volumetriclength(energybudget)\n\nCalculate the structural length in cm based on an individual's weight (assuming a density of 1 g/cm³ to calculate volume, see Kooijman 2009).\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Nature","page":"Nature","title":"Nature","text":"","category":"section"},{"location":"nature.html#nature.jl","page":"Nature","title":"nature.jl","text":"","category":"section"},{"location":"nature.html","page":"Nature","title":"Nature","text":"This file is responsible for managing the animal modules.","category":"page"},{"location":"nature.html","page":"Nature","title":"Nature","text":"Modules = [Persefone]\nPages = [\"nature/nature.jl\"]","category":"page"},{"location":"nature.html#Persefone.Animal","page":"Nature","title":"Persefone.Animal","text":"Animal\n\nThis is the generic agent type for all animals. Species are differentiated by trait dictionaries passed by them during initialisation. (Note that each trait variable can still be accessed as if it were a normal field name, i.e. the trait phase can be accessed and modified with animal.phase.)\n\n\n\n\n\n","category":"type"},{"location":"nature.html#Persefone.animalid-Tuple{Animal}","page":"Nature","title":"Persefone.animalid","text":"animalid(animal)\n\nA small utility function to return a string with the species name and ID of an animal.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.initnature!-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persefone.initnature!","text":"initnature!(model)\n\nInitialise the model with all simulated animal populations.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}","page":"Nature","title":"Persefone.stepagent!","text":"stepagent!(animal, model)\n\nUpdate an animal by one day, executing it's currently active phase function.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.@countanimals-Tuple","page":"Nature","title":"Persefone.@countanimals","text":"@countanimals(species=\"\", radius=0)\n\nCount the number of animals of the given species in this location. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@cropheight-Tuple{}","page":"Nature","title":"Persefone.@cropheight","text":"@cropheight\n\nReturn the height of the crop at this position, or 0 if there is no crop here. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@cropname-Tuple{}","page":"Nature","title":"Persefone.@cropname","text":"@cropname\n\nReturn the name of the local croptype, or nothing if there is no crop here. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@distanceto-Tuple{Any}","page":"Nature","title":"Persefone.@distanceto","text":"@distanceto(habitat)\n\nCalculate the distance to the closest habitat of the specified type or descriptor. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@distancetoedge-Tuple{}","page":"Nature","title":"Persefone.@distancetoedge","text":"@distancetoedge\n\nCalculate the distance to the closest neighbouring habitat. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@habitat-Tuple{Any}","page":"Nature","title":"Persefone.@habitat","text":"@habitat\n\nSpecify habitat suitability for spatial ecological processes.\n\nThis macro works by creating an anonymous function that takes in a model object and a position, and returns true or false depending on the conditions specified in the macro body.\n\nSeveral utility macros can be used within the body of @habitat as a short-hand for common expressions: @landcover, @cropname, @cropheight, @distanceto, @distancetoedge, @countanimals. The variables model and pos can be used for checks that don't have a macro available.\n\nTwo example uses of @habitat might look like this:\n\nmovementhabitat = @habitat(@landcover() in (grass agriculture soil))\n\nnestinghabitat = @habitat((@landcover() == grass || \n                           (@landcover() == agriculture && @cropname() != \"maize\" &&\n                            @cropheight() < 10)) &&\n                          @distanceto(forest) > 20)\n\nFor more complex habitat suitability checks, the use of this macro can be circumvented by directly creating an equivalent function.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}","page":"Nature","title":"Persefone.@initialise","text":"@initialise(habitatdescriptor; kwargs...)\n\nCall this macro within the body of @species. It passes the given habitat descriptor function and keyword arguments on to initpopulation when setting up the simulation.\n\nNote: if this macro is not used, the variable initialise! must be set manually in the species definition.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@kill-Tuple","page":"Nature","title":"Persefone.@kill","text":"@kill\n\nKill this animal (and immediately abort its current update). This is a thin wrapper around kill!, and passes on any arguments. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@landcover-Tuple{}","page":"Nature","title":"Persefone.@landcover","text":"@landcover\n\nReturns the local landcover. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@neighbours-Tuple{Any}","page":"Nature","title":"Persefone.@neighbours","text":"@neighbours(radius)\n\nReturn an iterator over all animals in the given radius around this animal, excluding itself. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@phase-Tuple{Any, Any}","page":"Nature","title":"Persefone.@phase","text":"@phase(name, body)\n\nThis macro is designed to be used within a species definition block (i.e. within the body of a call to @species).\n\nThe idea behind this is that species show very different behaviour during different phases of their lives. Therefore, @phase can be used define the behaviour for one such phase, and the conditions under which the animal transitions to another phase.\n\n@phase works by creating a function that will be called by the model if the animal is in the relevant phase. When it is called, it has access to the following variables:\n\nanimal a reference to the animal itself. This provides access to animal.age,   animal.sex, and animal.<trait> (where <trait> is a variable that was defined   in the top part of the species definition body).\npos gives the animal's current position as a coordinate tuple.\nmodel a reference to the model world (an object of type AgentBasedModel).   This allows access to model.date (the current simulation date) and   model.landscape (a two-dimensional array of pixels containing geographic   information).\n\nSeveral utility macros can be used within the body of @phase as a short-hand for common expressions: @trait, @setphase, @respond, @kill, @reproduce, @neighbours, @rand, @shuffle!.\n\nNote that the first phase that is defined in a species definition block will be the phase that animals are assigned at birth, unless the variable phase is explicitly defined by the user in the species definition block.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@reproduce-Tuple","page":"Nature","title":"Persefone.@reproduce","text":"@reproduce\n\nLet this animal reproduce. This is a thin wrapper around reproduce!, and passes on any arguments. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@respond-Tuple{Any, Any}","page":"Nature","title":"Persefone.@respond","text":"@respond(eventname, body)\n\nDefine how an animal responds to a landscape event that affects its current position. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@setphase-Tuple{Any}","page":"Nature","title":"Persefone.@setphase","text":"@setphase(newphase)\n\nSwitch this animal over to a different phase. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@species-Tuple{Any, Any}","page":"Nature","title":"Persefone.@species","text":"@species(name, body)\n\nA macro used to create new species definitions for the nature model. This is effectively a simple domain-specific language, establishing a custom syntax to describe species' biology:\n\n@species name begin\n\n    @initialise(@habitat(...))\n    speciesvar1 = 3.14\n    ...\n\n    @phase phase1 begin\n        ...\n    end\nend\n\nThe definition body (enclosed in the begin/end block) has two sections. First comes a call to @initialise, and optionally a list of species-specific parameters, which are assigned just like normal variables. Second come one or more phase definitions, that describe the behaviour of the species during various parts of its life cycle. (See the documentation to @initialise and @phase for details).\n\nCode in a species definition block can access the rest of the model using the model variable (an object of type AgentBasedModel).\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@trait-Tuple{Any}","page":"Nature","title":"Persefone.@trait","text":"@trait(traitname)\n\nA utility macro to quickly access an animal's trait value. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#populations.jl","page":"Nature","title":"populations.jl","text":"","category":"section"},{"location":"nature.html","page":"Nature","title":"Nature","text":"This file contains a set of utility functions for species, including initialisation, reproduction, and mortality.","category":"page"},{"location":"nature.html","page":"Nature","title":"Nature","text":"Modules = [Persefone]\nPages = [\"nature/populations.jl\"]","category":"page"},{"location":"nature.html#Persefone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Nature","title":"Persefone.countanimals","text":"countanimals(pos, model; species=\"\", radius=0)\n\nCount the number of animals in this location (optionally supplying a species name and radius).\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.initpopulation-Tuple{Function}","page":"Nature","title":"Persefone.initpopulation","text":"initpopulation(habitatdescriptor; popsize=-1, pairs=false, asexual=false)\n\nCreates a function that initialises individuals at random locations across the landscape. This can be used to create the initialise! variable in a species definition block.\n\nhabitatdescriptor is a function that determines whether a given location is suitable   or not (create this using @habitat).\nphase determines which life phase individuals will be assigned to. If this is nothing,   the species' default post-natal life stage will be used (although note that this is   probably not what you want).\npopsize determines the number of individuals that will be created. If this is zero or   negative, one individual will be created in every suitable location in the landscape.   If popsize is greater than the number of suitable locations, multiple individuals   will be created in one place. (Maximum population density can be set in the habitat   descriptor using the @countanimals macro.)\nIf pairs is true, a male and a female individual will be created in each selected   location, otherwise, only one individual will be created at a time.\nIf asexual is true, all created individuals are assigned the sex hermaphrodite,   otherwise, they are randomly assigned male of female. (If pairs is true, asexual   is ignored.)\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.initrandompopulation-Tuple{Int64}","page":"Nature","title":"Persefone.initrandompopulation","text":"initrandompopulation(popsize; kwargs...)\n\nA simplified version of initpopulation. Creates a function that initialises popsize individuals, spread at random across the landscape.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.kill!","page":"Nature","title":"Persefone.kill!","text":"kill(animal, model, probability=1.0, cause=\"\")\n\nKill this animal, optionally with a given percentage probability. Returns true if the animal dies, false if not.\n\n\n\n\n\n","category":"function"},{"location":"nature.html#Persefone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persefone.nearby_animals","text":"nearby_animals(animal, model, radius)\n\nReturn an iterator over all animals in the given radius around this animal, excluding itself.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persefone.nearby_animals","text":"nearby_animals(pos, model, radius)\n\nReturn an iterator over all animals in the given radius around this position.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.reproduce!","page":"Nature","title":"Persefone.reproduce!","text":"reproduce!(animal, model, n=1)\n\nProduce one or more offspring for the given animal at its current location.\n\n\n\n\n\n","category":"function"},{"location":"nature.html#insects.jl","page":"Nature","title":"insects.jl","text":"","category":"section"},{"location":"nature.html","page":"Nature","title":"Nature","text":"This file contains the insect submodel, which calculates the likely insect biomass in a given location at a given time.","category":"page"},{"location":"nature.html","page":"Nature","title":"Nature","text":"Modules = [Persefone]\nPages = [\"nature/insects.jl\"]","category":"page"},{"location":"nature.html#Persefone.insectbiomass-Tuple{Pixel, Agents.AgentBasedModel}","page":"Nature","title":"Persefone.insectbiomass","text":"insectbiomass(pixel, model)\n\nCalculate the insect biomass in this location, using the factors configured in the nature.insectmodel settings (any combination of: \"season\", \"habitat\", \"weather\", \"pesticides\"). Returns a float value in g/m².\n\nBiological note: this is a very approximate calculation! Insect biomass varies wildly in time and space and is hard to measure. This calculation is based on the idea of a parabolic seasonal development of insect abundance, modified by habitat suitability, weather, and pesticide application. Although it is based on empirical studies, it can only deliver a rough, order-of-magnitude estimation of likely insect biomass in a given location.\n\nSources:\n\nOdderskær et al. (1997). Skylark Reproduction in Pesticide Treated and Untreated Fields (32; Pesticides Research). Danish Environmental Protection Agency.\nGrüebler et al. (2008). A predictive model of the density of airborne insects in agricultural environments. Agriculture, Ecosystems & Environment, 123(1), 75–80. https://doi.org/10.1016/j.agee.2007.05.001\nPaquette et al. (2013). Seasonal patterns in Tree Swallow prey (Diptera) abundance are affected by agricultural intensification. Ecological Applications, 23(1), 122–133. https://doi.org/10.1890/12-0068.1\nPüttmanns et al. (2022). Habitat use and foraging parameters of breeding Skylarks indicate no seasonal decrease in food availability in heterogeneous farmland. Ecology and Evolution, 12(1), e8461. https://doi.org/10.1002/ece3.8461\n\n\n\n\n\n","category":"method"},{"location":"nature.html#ecologicaldata.jl","page":"Nature","title":"ecologicaldata.jl","text":"","category":"section"},{"location":"nature.html","page":"Nature","title":"Nature","text":"This file contains a set of life-history related utility functions needed by species.","category":"page"},{"location":"nature.html","page":"Nature","title":"Nature","text":"Modules = [Persefone]\nPages = [\"nature/ecologicaldata.jl\"]","category":"page"},{"location":"nature.html#Persefone.initecologicaldata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persefone.initecologicaldata","text":"initecologicaldata()\n\nCreate output files for each data group collected by the nature model.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.saveindividualdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persefone.saveindividualdata","text":"saveindividualdata(model)\n\nReturn a comma-separated set of lines (to be printed to individuals.csv), listing all properties of all animal individuals in the model. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter nature.indoutfreq. WARNING: Produces very big files!\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.savepopulationdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persefone.savepopulationdata","text":"savepopulationdata(model)\n\nReturn a comma-separated set of lines (to be printed to populations.csv), giving the current date and population size for each animal species. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter nature.popoutfreq.\n\n\n\n\n\n","category":"method"},{"location":"gui.html#Graphical-User-Interface","page":"Graphical User Interface","title":"Graphical User Interface","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Due to the computational demands of simulating many individuals at high temporal and spatial resolution, Persefone.jl is primarily designed to be run non-interactively on an HPC. However, to allow interactive exploratory simulations to be conducted while learning or developing the model, a graphical user interface is available as an additional package: Persefone Desktop.","category":"page"},{"location":"gui.html#Install-and-run","page":"Graphical User Interface","title":"Install and run","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"To install: Install Julia and download/clone  the repository. Open a Julia REPL  in the downloaded folder and execute the following to install all dependencies:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"using Pkg\nPkg.activate(\".\")\nPkg.instantiate()","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"To run: Run desktop.jl. Alternatively, open a Julia REPL in this folder and run:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"using Pkg\nPkg.activate(\".\")\nusing PersefoneDesktop\nlaunch()","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Note: Due to the necessary pre-compilation done by Julia, installing and launching the application can take quite a long time. (Start-up time with desktop.jl is currently about 2 minutes.) We will reduce this as much as possible in future releases.","category":"page"},{"location":"gui.html#User-interface","page":"Graphical User Interface","title":"User interface","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"(Image: Persefone.jl Desktop screenshot)","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"The main window component is the map view. This displays a land cover map of the simulated region: dark green are forests, light green grassland, yellow fields, red built-up areas and blue water. On it, little circles show the position of individual animals, with different species denoted by different colours.","category":"page"},{"location":"gui.html#Control-bar","page":"Graphical User Interface","title":"Control bar","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Back button: Rewind the simulation by one day.\nStep button: Advance the simulation by one day.\nRun button: Run the simulation until the button is pressed again or the end date is reached.\nProgress bar: Shows the percentage of time elapsed between the start and end dates of the simulation.\nSpeed slider: Set the time delay between each simulation step when running.\nDate: Shows the simulation date currently displayed on the map.","category":"page"},{"location":"gui.html#Menu-bar","page":"Graphical User Interface","title":"Menu bar","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Simulation:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"New simulation: Reset the model and start over.\nConfigure simulation: Change the model settings (not yet implemented).\nLoad saved state: Load a model object file saved by a previous simulation run.\nSave current state: Save a model object file for later use.\nQuit: Close the application.","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Data:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Show population graph: Show a window with a graph of population sizes over time in the current model run.\nSave simulation output: Save the model output data to file (saves both raw CSV data and generated graphics).","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Help:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Documentation: Open the Persefone.jl online documentation in a browser.\nWebsite: Open the main Persefone.jl website in a browser.\nAbout: Show a window with core information about the application.","category":"page"},{"location":"io.html#Input-and-Output","page":"Input and Output","title":"Input and Output","text":"","category":"section"},{"location":"io.html","page":"Input and Output","title":"Input and Output","text":"These functions are responsible for reading in all model configurations (passed by config file or commandline), administrating them during a run, and printing or plotting any output.","category":"page"},{"location":"io.html#input.jl","page":"Input and Output","title":"input.jl","text":"","category":"section"},{"location":"io.html","page":"Input and Output","title":"Input and Output","text":"Modules = [Persefone]\nPages = [\"core/input.jl\"]","category":"page"},{"location":"io.html#Persefone.PARAMFILE","page":"Input and Output","title":"Persefone.PARAMFILE","text":"The file that stores all default parameters: src/parameters.toml\n\n\n\n\n\n","category":"constant"},{"location":"io.html#Persefone.flattenTOML-Tuple{Any}","page":"Input and Output","title":"Persefone.flattenTOML","text":"flattenTOML(dict)\n\nAn internal utility function to convert the two-dimensional dict returned by TOML.parsefile() into a one-dimensional dict, so that instead of writing settings[\"domain\"][\"param\"] one can use settings[\"domain.param\"]. Can be reversed with prepareTOML.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.getsettings","page":"Input and Output","title":"Persefone.getsettings","text":"getsettings(configfile, seed=nothing)\n\nCombines all configuration options to produce a single settings dict. Precedence: commandline parameters - user config file - default values\n\n\n\n\n\n","category":"function"},{"location":"io.html#Persefone.loadmodelobject-Tuple{String}","page":"Input and Output","title":"Persefone.loadmodelobject","text":"loadmodelobject(fullfilename)\n\nDeserialise a model object that was previously saved with [savemodelobject](@ref).\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.parsecommandline-Tuple{}","page":"Input and Output","title":"Persefone.parsecommandline","text":"parsecommandline()\n\nCertain software parameters can be set via the commandline.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.preprocessparameters-Tuple{Dict{String, Any}, String}","page":"Input and Output","title":"Persefone.preprocessparameters","text":"preprocessparameters(settings)\n\nTake the raw input parameters and process them (convert types, perform checks, etc.). This is a helper function for getsettings.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.@param-Tuple{Any}","page":"Input and Output","title":"Persefone.@param","text":"@param(domainparam)\n\nReturn a configuration parameter from the global settings. The argument should be in the form <domain>.<parameter>, for example @param(core.outdir). Possible values for <domain> are core, nature, farm, or crop. For a full list of parameters, see src/parameters.toml.\n\nNote: this macro only works in a context where the model object is available!\n\n\n\n\n\n","category":"macro"},{"location":"io.html#Persefone.@rand-Tuple","page":"Input and Output","title":"Persefone.@rand","text":"@rand(args...)\n\nReturn a random number or element from the sample, using the model RNG. This is a utility wrapper that can only be used a context where the model object is available.\n\n\n\n\n\n","category":"macro"},{"location":"io.html#Persefone.@shuffle!-Tuple{Any}","page":"Input and Output","title":"Persefone.@shuffle!","text":"@shuffle!(collection)\n\nShuffle the given collection in place, using the model RNG. This is a utility wrapper that can only be used a context where the model object is available.\n\n\n\n\n\n","category":"macro"},{"location":"io.html#output.jl","page":"Input and Output","title":"output.jl","text":"","category":"section"},{"location":"io.html","page":"Input and Output","title":"Input and Output","text":"Modules = [Persefone]\nPages = [\"core/output.jl\"]","category":"page"},{"location":"io.html#Persefone.DataOutput","page":"Input and Output","title":"Persefone.DataOutput","text":"DataOutput\n\nA struct for organising model output. This is used to collect model data in an in-memory dataframe or for CSV output. Submodels can register their own output functions using newdataoutput!.\n\nStruct fields:     - name: a string identifier for the data collection (used as file name)     - header: a list of column names     - outputfunction: a function that takes a model object and returns data values to record (formatted as a vector of vectors)     - frequency: how often to call the output function (daily/monthly/yearly/end/never)     - plotfunction: a function that takes a model object and returns a Makie figure object (optional)\n\n\n\n\n\n","category":"type"},{"location":"io.html#Persefone.createdatadir-Tuple{String, Union{Bool, String}}","page":"Input and Output","title":"Persefone.createdatadir","text":"createdatadir(outdir, overwrite)\n\nCreates the output directory, dealing with possible conflicts.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.modellogger-Tuple{String, String}","page":"Input and Output","title":"Persefone.modellogger","text":"modellogger(loglevel, outdir)\n\nCreate a logger object that writes output both to screen and to a logfile. This object is stored as model.logger and can then be used with with_logger(). Note: requires createdatadir to be run first.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.newdataoutput!","page":"Input and Output","title":"Persefone.newdataoutput!","text":"newdataoutput!(model, name, header, outputfunction, frequency)\n\nCreate and register a new data output. This function must be called by all submodels that want to have their output functions called regularly.\n\n\n\n\n\n","category":"function"},{"location":"io.html#Persefone.outputdata","page":"Input and Output","title":"Persefone.outputdata","text":"outputdata(model, force=false)\n\nCycle through all registered data outputs and activate them according to their configured frequency. If force is true, activate all outputs regardless of their configuration.\n\n\n\n\n\n","category":"function"},{"location":"io.html#Persefone.prepareTOML-Tuple{Any}","page":"Input and Output","title":"Persefone.prepareTOML","text":"prepareTOML(dict)\n\nAn internal utility function to re-convert the one-dimensional dict created by flattenTOML into the two-dimensional dict needed by TOML.print, and convert any data types into TOML-compatible types where necessary.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.saveinputfiles-Tuple{Agents.AgentBasedModel}","page":"Input and Output","title":"Persefone.saveinputfiles","text":"saveinputfiles(model)\n\nCopy all input files into the output directory, including the actual parameter settings used. This allows replicating a run in future.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.savemodelobject-Tuple{Agents.AgentBasedModel, String}","page":"Input and Output","title":"Persefone.savemodelobject","text":"savemodelobject(model, filename)\n\nSerialise a model object and save it to file for later reference. Includes the current model and Julia versions for compatibility checking.\n\nWARNING: produces large files (>100 MB) and takes a while to execute.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.visualiseoutput","page":"Input and Output","title":"Persefone.visualiseoutput","text":"visualiseoutput(model)\n\nCycle through all data outputs and call their respective plot functions, saving each figure as a PDF.\n\n\n\n\n\n","category":"function"},{"location":"io.html#Persefone.withtestlogger-Tuple{Agents.AgentBasedModel}","page":"Input and Output","title":"Persefone.withtestlogger","text":"withtestlogger(model)\n\nReplace the model logger with the currently active logger. This is intended to be used in the testsuite to circumvent a Julia issue, where @test_logs doesn't work with local loggers.\n\n\n\n\n\n","category":"method"},{"location":"io.html#makieplots.jl","page":"Input and Output","title":"makieplots.jl","text":"","category":"section"},{"location":"io.html","page":"Input and Output","title":"Input and Output","text":"Modules = [Persefone]\nPages = [\"analysis/makieplots.jl\"]","category":"page"},{"location":"io.html#Persefone.gettickmarks-Tuple{Any}","page":"Input and Output","title":"Persefone.gettickmarks","text":"gettickmarks(dates)\n\nGiven a vector of dates, construct a selection to use as tick mark locations. Helper function for [populationtrends](@ref)\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.populationtrends-Tuple{Agents.AgentBasedModel}","page":"Input and Output","title":"Persefone.populationtrends","text":"populationtrends(model)\n\nPlot a line graph of population sizes of each species over time. Returns a Makie figure object.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.visualisemap","page":"Input and Output","title":"Persefone.visualisemap","text":"visualisemap(model, date, landcovermap)\n\nDraw the model's land cover map and plot all individuals as points on it at the specified date. If no date is passed, use the last date for which data are available. Optionally, you can pass a landcover map image (this is needed to reduce the frequency of disk I/O for Persefone Desktop). Returns a Makie figure object.\n\n\n\n\n\n","category":"function"},{"location":"config.html#Configuration","page":"Configuration","title":"Configuration","text":"","category":"section"},{"location":"config.html","page":"Configuration","title":"Configuration","text":"Persefone requires three input files: a configuration file and two map files.  How to generate the map files is documented elsewhere. The configuration file defines parameter values and looks like this (see src/parameters.toml for the default):","category":"page"},{"location":"config.html","page":"Configuration","title":"Configuration","text":"### Persefone.jl - a model of agricultural landscapes and ecosystems in Europe.\n###\n### This is the default configuration file for Persefone, containing all model parameters.\n### The syntax is described here: https://toml.io/en/\n\n[core]\nconfigfile = \"src/parameters.toml\" # location of the configuration file\noutdir = \"results\" # location and name of the output folder\noverwrite = \"ask\" # overwrite the output directory? (true/false/\"ask\")\ncsvoutput = true # save collected data in CSV files\nvisualise = true # generate result graphs\nstoredata = true # keep collected data in memory\nloglevel = \"debug\" # verbosity level: \"debug\", \"info\", \"warn\"\nprocessors = 2 # number of processors to use on parallel runs\nseed = 2 # seed value for the RNG (0 -> random value)\n# dates to start and end the simulation\nstartdate = 2022-01-01\nenddate = 2022-12-31\n\n[world]\nlandcovermap = \"data/regions/jena/landcover.tif\" # location of the landcover map\nfarmfieldsmap = \"data/regions/jena/fields.tif\" # location of the field geometry map\nweatherfile = \"data/regions/jena/weather.csv\" # location of the weather data file\n\t\n[farm]\nfarmmodel = \"FieldManager\" # which version of the farm model to use (not yet implemented)\n\n[nature]\ntargetspecies = [\"Wolpertinger\", \"Wyvern\"] # list of target species to simulate\npopoutfreq = \"daily\" # output frequency population-level data, daily/monthly/yearly/end/never\nindoutfreq = \"end\" # output frequency individual-level data, daily/monthly/yearly/end/never\ninsectmodel = [\"season\", \"habitat\", \"pesticides\", \"weather\"] # factors affecting insect growth\n\t\n[crop]\ncropmodel = \"almass\" # crop growth model to use, \"almass\" or \"aquacrop\"\ncropfile = \"data/crops/almass/crop_data_general.csv\" # file with general crop parameters\ngrowthfile = \"data/crops/almass/almass_crop_growth_curves.csv\" # file with crop growth parameters\t","category":"page"},{"location":"config.html","page":"Configuration","title":"Configuration","text":"info: Parameter scanning\nYou can set any parameter to a list of different values, e.g. seed = [1,2,3]. Persefone will then set up and run multiple simulations, one for every possible combination of parameters that you entered (i.e. do a full-factorial simulation experiment).","category":"page"},{"location":"using.html#Usage","page":"Usage","title":"Usage","text":"","category":"section"},{"location":"using.html","page":"Usage","title":"Usage","text":"This page describes how to run Persefone.jl as a command line application or Julia package. To use it with a graphical user interface, see here.","category":"page"},{"location":"using.html#Installation","page":"Usage","title":"Installation","text":"","category":"section"},{"location":"using.html","page":"Usage","title":"Usage","text":"Install the latest version of the Julia programming  language (1.9+). The recommended editors are VSCode or Emacs. To install the package dependencies, open a Julia REPL in this folder and run:","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"using Pkg\nPkg.activate(\".\")\nPkg.instantiate()","category":"page"},{"location":"using.html#Running-from-the-command-line","page":"Usage","title":"Running from the command line","text":"","category":"section"},{"location":"using.html","page":"Usage","title":"Usage","text":"This is the normal mode of operation. Simply execute run.jl in a terminal, typically like  so (in Linux):","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"> julia run.jl -c <config>","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"where <config> specifies the configuration file to use. The recommended workflow is to copy scr/parameters.toml to a location of your choice and edit the copy to suit your requirements. The adapted config file can then be passed to run.jl. (If no configuration file is specified, Persefone will run with its default settings.)","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"The full list of commandline arguments is:","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"usage: run.jl [-c CONFIGFILE] [-s SEED] [-o OUTDIR] [-l LOGLEVEL] \n              [--version] [-h]\n\noptional arguments:\n  -c, --configfile CONFIGFILE\n                        name of the configuration file\n  -s, --seed SEED       inital random seed (type: Int64)\n  -o, --outdir OUTDIR   location of the output directory\n  -l, --loglevel LOGLEVEL\n                        verbosity: \"debug\", \"info\", or \"quiet\"\n  --version             show version information and exit\n  -h, --help            show this help message and exit","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"To run the test suite, switch to the test directory and execute runtests.jl.","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"If you are on Linux or MacOS, you can also use make:","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"> make run       # run a simulation with default values\n> make test      # run the test suite\n> make profile   # run and profile a default simulation\n> make docs      # build the documentation\n> make release   # create a release","category":"page"},{"location":"using.html#Running-from-within-Julia","page":"Usage","title":"Running from within Julia","text":"","category":"section"},{"location":"using.html","page":"Usage","title":"Usage","text":"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:","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"using Pkg\nPkg.activate(\".\") # assuming you're in the Persefone root folder\nusing Persefone","category":"page"},{"location":"using.html","page":"Usage","title":"Usage","text":"You can then access all Persefone functions, such as simulate, initialise, stepsimulation!, simulate!, or visualiseoutput. (See src/Persefone.jl for a list of exported  functions.)","category":"page"},{"location":"architecture.html#Source-code-architecture","page":"Source code architecture","title":"Source code architecture","text":"","category":"section"},{"location":"architecture.html#Model-components","page":"Source code architecture","title":"Model components","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"(Image: \"model architecture\")","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"Persefone is divided into four components, three of which are semi-independent submodels:","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"core: This is the foundation of the model software, which sets up and executes simulation runs. It also reads in the configuration file and landscape maps, and provides data output functionality. (Eventually, it will also provide weather data.)\nnature: This is an individual-based model of species in agricultural landscapes. It defines the Animal agent type, and a set of macros that can be used to rapidly create new species. It also includes ecological process functions that are useful for all species.\nfarm: This is an agent-based model of farmer decision making. It is not yet implemented, but will provide the Farmer agent type.\ncrop: This is a mathematical growth model for various crops. It is not yet implemented, but already provides the agent type FarmPlot, representing one field and its associated extent and crop type.","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"Conceptually, core provides functionality that is needed by all of the submodels. Decisions made by Farmers affect the FarmPlots they own, and (directly or indirectly) the Animals in the model landscape.","category":"page"},{"location":"architecture.html#Important-implementation-details","page":"Source code architecture","title":"Important implementation details","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"(Image: \"the model object\")","category":"page"},{"location":"architecture.html#The-model-object","page":"Source code architecture","title":"The model object","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"A cursory reading of the source code will quickly show that most functions take an  AgentBasedModel object as one of their arguments. This is the key data structure  of Agents.jl, and holds all state that is in any way relevant to a simulation run. (Persefone has a strict \"no global state\" policy to avoid state-dependent bugs and allow parallelisation.) The model object gives access to all agent instances (via model[id], where id is the unique identifier of this agent). It also stores the configuration (model.settings), the landscape (model.landscape, a matrix of Pixel objects that store the local land cover, amongst other things), and the current simulation date (model.date). (See Persefone.initmodel for details.)","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"For more information about working with agent objects, see the  Agents.jl API.","category":"page"},{"location":"architecture.html#Model-configuration/the-@param-macro","page":"Source code architecture","title":"Model configuration/the @param macro","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"The model is configured via a TOML file, the default version of which is at  src/parameters.toml. An individual run can be configured using a user-defined configuration file, commandline arguments, or function calls (when Persefone is used as a package rather than an application). During a model run, the @param macro can be used to access parameter values.  Note that parameter names are prepended with the name of the component they are associated  with. For example, the outdir parameter belongs to the [core] section of the TOML file,  and must therefore be referenced as  @param(core.outdir). (See  src/core/input.jl  for details.)","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"info: @param and other macros\nAs @param(parameter) expands to model.settings[\"parameter\"], it can obviously only be used in a context where the model object is actually available. (This is the case for most functions in Persefone, but not for all.) Similarly, many of the nature macros depend on specific variables being available where they are called, and can therefore only be used in specific contexts (this is indicated in their documentation).","category":"page"},{"location":"architecture.html#Output-data","page":"Source code architecture","title":"Output data","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"Persefone can output model data into text files with a specified frequency (daily, monthly, yearly, or at the simulation end). Submodels can use Persefone.newdataoutput! to plug into this system. For an example of how to use  this, see src/nature/ecologicaldata.jl.  (See src/core/output.jl for details.)","category":"page"},{"location":"architecture.html#Farm-events","page":"Source code architecture","title":"Farm events","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"The FarmEvent struct is used to communicate farming-related events between  submodels. An event can be triggered with createevent! and affects all pixels  within a FarmPlot. (See  src/core/landscape.jl  for details.)","category":"page"},{"location":"architecture.html#Random-numbers-and-logging","page":"Source code architecture","title":"Random numbers and logging","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"By default in Julia, the random number generator (RNG) and the system logger are two globally accessible variables. As Persefone needs to avoid all global data (since this would interfere with reproducibility in parallel runs), the model object stores a  local logger and a local RNG. The local logger generally does not change the way the  model uses log statements, it is  only relevant for some functions in src/core/simulation.jl.","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"info: Using the model RNG\nWhenever you need to use a random number,  you must use the model.rng. The easiest way to do this is with the @rand  and @shuffle! macros. (Note that these, too, require access to the model object.)","category":"page"},{"location":"species.html#Species","page":"Species","title":"Species","text":"","category":"section"},{"location":"species.html","page":"Species","title":"Species","text":"The ecological submodel in Persefone simulates a range of species in agricultural landscapes.","category":"page"},{"location":"species.html#Skylark","page":"Species","title":"Skylark","text":"","category":"section"},{"location":"species.html","page":"Species","title":"Species","text":"Modules = [Persefone]\nPages = [\"nature/species/skylark.jl\"]","category":"page"},{"location":"species-dsl.html#Defining-new-species","page":"Defining new species","title":"Defining new species","text":"","category":"section"},{"location":"species-dsl.html#The-Persefone-species-DSL","page":"Defining new species","title":"The Persefone species DSL","text":"","category":"section"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"In order to make implementing new species as easy as possible, Persefone includes a domain-specific language (DSL) built from a collection of macros and functions.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Here is an example of what this looks like, using a hypothetical mermaid species:","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"@species Mermaid begin\n    ageofmaturity = 2\n    pesticidemortality = 1.0\n    @initialise(@habitat(@landcover() == water), pairs=true)\n\t\n    @phase life begin\n        @debug \"$(animalid(animal)) is swimming happily in its pond.\"\n        @respond pesticide @kill(@trait(pesticidemortality), \"poisoning\")\n        @respond harvest @setphase(drought)\n        @debug \"Animal: $animal\"\n        if @trait(sex) == female && @countanimals() < 3 &&\n            @trait(age) >= @trait(ageofmaturity) && @landcover() == water\n            @reproduce()\n        end\n    end\n\t\n    @phase drought begin\n        n = sum(1 for a in @neighbours(0))\n        @debug \"$(animalid(animal)) is experiencing drought with $n neighbour(s).\"\n        @respond sowing @setphase(life)\n    end\nend","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"The two most important macros are @species and @phase,  followed by @initialise, @trait, @respond,  and @habitat. Other macros provide convenience wrappers for common  functions. (See src/nature/nature.jl for details.)","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"The top-level macro is @species. This takes two arguments: a species  name and a definition block (enclosed in begin and end tags). At the start of the definition block, species-specific variables can be defined that should be available throughout a species' lifetime. Code in this section has access to the model object and can thus reference the current model state. In this section, the user also has to call the @initialise macro. This wraps the  Persefone.initpopulation function, and takes a habitat descriptor  (see @habitat below) and several options to specify how the species'  population should be distributed in the landscape during model initialisation.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Following this section, each species must define one or more @phase blocks. The concept behind this is that species show different behaviours at different phases of their lifecycle. Each @phase block defines the behaviour in one of these phases. (Technically, it defines a function that will be called daily, so long as the species' phase variable is set to the name of this phase.) Code in this section has access to the model object as well as an animal object, which is the currently active animal agent. Properties of the animal agent, regardless of whether they were defined by the user or by Persefone, can be accessed using the @trait macro. Within a phase block, @respond  can be used to define the species' response to a FarmEvent that affects  the species' current location, while a variety of other macros provide wrappers to  ecological process functions from src/nature/populations.jl.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Another important macro is @habitat. This defines a \"habitat descriptor\", i.e. a predicate function that tests whether or not a given landscape pixel is  suitable for a specified purpose. Such habitat descriptors are used as arguments to various functions, for example for population initialisation or movement. The argument to @habitat consists of a logical expression, which has access to the animal's current position (the pos tuple variable) and the model. Various macros are available to easily reference information about the current location, such as @landcover or @distancetoedge.","category":"page"},{"location":"species-dsl.html#Implementation-details","page":"Defining new species","title":"Implementation details","text":"","category":"section"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Due to a known performance problem  with multi-agent models, the underlying implementation of species is  rather complicated (see src/nature/nature.jl for details.)","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Rather than creating a new type/struct for each species, all Animal agents have the same type. Instead, they are differentiated by a traits dict, which stores both species-specific parameters and run-time variables. Note that due to a redefinition of the getproperty()/setproperty!() methods, variables from the trait dict can be accessed and modified just like normal struct fields (i.e. although phase is defined in the dict, not the struct, animal.phase = \"newphase\" works just fine - one does not have to use animal.traits[\"phase\"] = \"newphase\".)","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Under the hood, the @species macro generates a function (with the name of the species), which in turn creates the trait dict when called. Thus, adding a new animal agent to the model involves instantiating an Animal object, then calling the relevant species function and attaching the returned dict to the agent object.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Similarly, the @phase macro too works by defining a new function, which is stored in the species' trait dict. These functions take an animal object and the model object as input, and define what the species does during its daily update.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Once again, @habitat creates a function that takes model and pos as input and returns a boolean response. Functions that require a habitat descriptor thus take in this (anonymous) function and call it internally.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Finally, the @initialise macro is a wrapper around  Persefone.initpopulation, which (yet again) creates a function that  specifies how a species' population is to be initialised at the beginning of a  simulation run. This function is stored in the species trait dict and accessed  during model setup.","category":"page"},{"location":"developing.html#Developing-Persefone","page":"Developing Persefone","title":"Developing Persefone","text":"","category":"section"},{"location":"developing.html#Workflow","page":"Developing Persefone","title":"Workflow","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Pull the current version from the master branch on Gitlab:  https://git.idiv.de/xo30xoqa/persephone.\nIf you are working on a new feature, create a new branch to avoid breaking the master branch. (The master branch on Github should always be in a runnable and error-free state.)\nImplement your changes.\nRun an example simulation and the test suite to make sure everything works without crashing (make run and make test on Linux, or execute run.jl and test/runtests.jl manually.)\nCommit your work frequently, and try to keep each commit small. Don't forget to add relevant tests to the test suite.\nOnce your satisfied with your work, do another pull/merge from the master branch in case somebody else changed the branch in the meantime. Then merge your work into master and push to the Gitlab server.\nRepeat :-)","category":"page"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"The Gitlab issue tracker can be used  to create, discuss, and assign tasks, as well as to monitor progress towards milestones/releases.  Once we have a first release, we will start using semantic versioning.","category":"page"},{"location":"developing.html#Libraries","page":"Developing Persefone","title":"Libraries","text":"","category":"section"},{"location":"developing.html#Agents.jl","page":"Developing Persefone","title":"Agents.jl","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Our model uses Agents.jl as a framework. Their repository can be used to inspect the source code or submit bug reports (the authors are quick to respond). Questions can be asked at the  Julia Discourse forum.","category":"page"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Tutorial on collaborating on Julia packages:  https://www.matecdev.com/posts/julia-package-collaboration.html.","category":"page"},{"location":"developing.html#Revise.jl","page":"Developing Persefone","title":"Revise.jl","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Revise.jl allows one to reload code without restarting the Julia interpreter. Get it with Pkg.add(\"Revise\"), then  add using Revise to .julia/config/startup.jl to have it automatically available.","category":"page"},{"location":"developing.html#Test","page":"Developing Persefone","title":"Test","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Persefone uses the inbuilt Julia testing framework. All new functions should have appropriate tests written for them in the appropriate file in the test directory. (See test/runtests.jl for details.) There are three ways to run the test suite: in the terminal, executing make test or cd test; julia runtests.jl; or in the Julia REPL,  Pkg.activate(\".\"); Pkg.test().","category":"page"},{"location":"developing.html#Documenter.jl","page":"Developing Persefone","title":"Documenter.jl","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"The HTML documentation is generated using Documenter.jl. Therefore, all new functions should have docstrings attached. New files need to be integrated into the relevant documentation source files in docs/src, and if necessary into docs/builddocs.jl. To build the documentation, run make docs, or cd docs; julia builddocs.jl (if using the latter, don't forget to update the date and commit in docs/src/index.md).","category":"page"},{"location":"developing.html#Julia-editors","page":"Developing Persefone","title":"Julia editors","text":"","category":"section"},{"location":"developing.html#Emacs","page":"Developing Persefone","title":"Emacs","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"There are a couple of addons that make working with Julia much nicer in Emacs:","category":"page"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"julia-mode gives syntax highlighting. Install with M-x package-install julia-mode.\njulia-snail provides IDE-like features,  especially a fully-functional REPL and the ability to evaluate code straight from inside a buffer. Note that the installation can be somewhat tricky. You first need to manually install all the dependencies of its dependency vterm, then install vterm itself with M-x package-install vterm, before you can do M-x package-install julia-snail. Then add it to your init.el with (require 'julia-snail) and (add-hook 'julia-mode-hook #'julia-snail-mode).\ncompany-mode integrates with Snail to give code  completion. Install with M-x package-install company, then add  (add-hook 'julia-mode-hook #'company-mode) and  (global-set-key (kbd \"C-<tab>\") 'company-complete) to your init.el.\nmagit is a great git interface for Emacs. Install with M-x package-install magit and add (global-set-key (kbd \"C-x g\") 'magit-status) to your init.el.","category":"page"},{"location":"developing.html#VSCode","page":"Developing Persefone","title":"VSCode","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"See here.","category":"page"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"TODO: add more detail.","category":"page"},{"location":"simulation.html#Simulation","page":"Simulation","title":"Simulation","text":"","category":"section"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"The core and world directories hold source files that are important for all submodels,  including scheduling, landscape, weather, and input/output functions.","category":"page"},{"location":"simulation.html#simulation.jl","page":"Simulation","title":"simulation.jl","text":"","category":"section"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"This file includes the basal functions for initialising and running simulations.","category":"page"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"Modules = [Persefone]\nPages = [\"core/simulation.jl\"]","category":"page"},{"location":"simulation.html#Persefone.finalise!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.finalise!","text":"finalise!(model)\n\nWrap up the simulation. Currently doesn't do anything except print some information.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.initialise","page":"Simulation","title":"Persefone.initialise","text":"initialise(config=PARAMFILE, seed=nothing)\n\nInitialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object(s). Optionally allows specifying the configuration file and overriding the seed parameter. This returns a single model object, unless the config file contains multiple values for one or more parameters, in which case it creates a full-factorial simulation experiment and returns a vector of model objects.\n\n\n\n\n\n","category":"function"},{"location":"simulation.html#Persefone.initmodel-Tuple{Dict{String, Any}}","page":"Simulation","title":"Persefone.initmodel","text":"initmodel(settings)\n\nInitialise a model object using a ready-made settings dict. This is a helper function for initialise().\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.paramscan-Tuple{Dict{String, Any}, Vector{String}}","page":"Simulation","title":"Persefone.paramscan","text":"paramscan(settings)\n\nCreate a list of settings dicts, covering all possible parameter combinations given by the input settings (i.e. a full-factorial experiment). This is a helper function for initialise().\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.simulate","page":"Simulation","title":"Persefone.simulate","text":"simulate(config=PARAMFILE, seed=nothing)\n\nInitialise one or more model objects and carry out a full simulation experiment, optionally specifying a configuration file and a seed for the RNG.\n\nThis is the default way to run a Persefone simulation.\n\n\n\n\n\n","category":"function"},{"location":"simulation.html#Persefone.simulate!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.simulate!","text":"simulate!(model)\n\nCarry out a complete simulation run using a pre-initialised model object.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.stepsimulation!","text":"stepsimulation!(model)\n\nExecute one update of the model.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#landscape.jl","page":"Simulation","title":"landscape.jl","text":"","category":"section"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"This file manages the landscape maps that underlie the model.","category":"page"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"Modules = [Persefone]\nPages = [\"world/landscape.jl\"]","category":"page"},{"location":"simulation.html#Persefone.EventType","page":"Simulation","title":"Persefone.EventType","text":"The types of landscape event that can be simulated\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.FarmEvent","page":"Simulation","title":"Persefone.FarmEvent","text":"FarmEvent\n\nA data structure to define a landscape event, giving its type, spatial extent, and duration.\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.LandCover","page":"Simulation","title":"Persefone.LandCover","text":"The land cover classes encoded in the Mundialis Sentinel data.\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.Pixel","page":"Simulation","title":"Persefone.Pixel","text":"Pixel\n\nA pixel is a simple data structure to combine land use and ownership information in a single object. The model landscape consists of a matrix of pixels. (Note: further landscape information may be added here in future.)\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.createevent!","page":"Simulation","title":"Persefone.createevent!","text":"createevent!(model, pixels, name, duration=1)\n\nAdd a farm event to the specified pixels (a vector of position tuples) for a given duration.\n\n\n\n\n\n","category":"function"},{"location":"simulation.html#Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}","page":"Simulation","title":"Persefone.distanceto","text":"distanceto(pos, model, habitatdescriptor)\n\nCalculate the distance from the given location to the closest location matching the habitat descriptor function. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persefone.LandCover}","page":"Simulation","title":"Persefone.distanceto","text":"distanceto(pos, model, habitattype)\n\nCalculate the distance from the given location to the closest habitat of the specified type. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.distancetoedge","text":"distancetoedge(pos, model)\n\nCalculate the distance from the given location to the closest neighbouring habitat. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.farmplot","text":"farmplot(position, model)\n\nReturn the farm plot at this position, or nothing if there is none (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.initlandscape-Tuple{String, String}","page":"Simulation","title":"Persefone.initlandscape","text":"initlandscape(landcovermap, farmfieldsmap)\n\nInitialise the model landscape based on the map files specified in the configuration. Returns a matrix of pixels.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.landcover","text":"landcover(position, model)\n\nReturn the land cover class at this position (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.updateevents!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.updateevents!","text":"updateevents!(model)\n\nCycle through the list of events, removing those that have expired.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#weather.jl","page":"Simulation","title":"weather.jl","text":"","category":"section"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"This file reads in weather data and makes it available to the model.","category":"page"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"Modules = [Persefone]\nPages = [\"world/weather.jl\"]","category":"page"},{"location":"simulation.html#Persefone.Weather","page":"Simulation","title":"Persefone.Weather","text":"Weather\n\nA single weather datum, combining the observations from one day.\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.initweather-Tuple{String, Dates.Date, Dates.Date}","page":"Simulation","title":"Persefone.initweather","text":"initweather(weatherfile, startdate, enddate)\n\nLoad a weather file, extract the values that are relevant to this model run (specified by start and end dates), and return a dictionary of Weather objects mapped to dates.\n\nNote: This requires a weather file in the format produced by data/extract_weather_data.R.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.maxtemp-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.maxtemp","text":"maxtemp(model)\n\nReturn today's maximum temperature in °C.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.meantemp-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.meantemp","text":"meantemp(model)\n\nReturn today's mean temperature in °C.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.mintemp-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.mintemp","text":"mintemp(model)\n\nReturn today's minimum temperature in °C.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.precipitation-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.precipitation","text":"precipitation(model)\n\nReturn today's total precipitation in mm.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.sunshine-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.sunshine","text":"sunshine(model)\n\nReturn today's sunshine duration in hours.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.vapourpressure-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.vapourpressure","text":"vapourpressure(model)\n\nReturn today's average vapour pressure in hPa.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.windspeed-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.windspeed","text":"windspeed(model)\n\nReturn today's average windspeed in m/s.\n\n\n\n\n\n","category":"method"},{"location":"farm.html#Farm-submodel","page":"Farm submodel","title":"Farm submodel","text":"","category":"section"},{"location":"farm.html","page":"Farm submodel","title":"Farm submodel","text":"Eventually, the aim is to create a full socio-economic farm decision model for Persefone. However, for the time being, we will restrict ourselves to a simple model that executes typical farm operations and crop rotations.","category":"page"},{"location":"farm.html#farm.jl","page":"Farm submodel","title":"farm.jl","text":"","category":"section"},{"location":"farm.html","page":"Farm submodel","title":"Farm submodel","text":"This file is responsible for managing the farm module(s).","category":"page"},{"location":"farm.html","page":"Farm submodel","title":"Farm submodel","text":"Modules = [Persefone]\nPages = [\"farm/farm.jl\"]","category":"page"},{"location":"farm.html#Persefone.Farmer","page":"Farm submodel","title":"Persefone.Farmer","text":"Farmer\n\nThis is the agent type for the farm ABM. (Not yet implemented.)\n\n\n\n\n\n","category":"type"},{"location":"farm.html#Persefone.initfarms!-Tuple{Agents.AgentBasedModel}","page":"Farm submodel","title":"Persefone.initfarms!","text":"initfarms!(model)\n\nInitialise the model with a set of farm agents.\n\n\n\n\n\n","category":"method"},{"location":"farm.html#Persefone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}","page":"Farm submodel","title":"Persefone.stepagent!","text":"stepagent!(farmer, model)\n\nUpdate a farmer by one day.\n\n\n\n\n\n","category":"method"},{"location":"adapting.html#Adapting-Persefone","page":"Adapting Persefone","title":"Adapting Persefone","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"A key development goal of Persefone is to be FAIR: findable, accessible, interoperable, and reusable. We aim to build a model that is both easy  to use and easy to adapt to new situations.","category":"page"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"There are multiple ways to adapt Persefone for a new modelling study:","category":"page"},{"location":"adapting.html#Changing-the-parameters","page":"Adapting Persefone","title":"Changing the parameters","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"The simplest way to adapt Persefone is simply by changing the parameters. Copy src/parameters.toml to a new location, adjust it to your needs, and run the model using julia run.jl -c <configfile>.","category":"page"},{"location":"adapting.html#Changing-the-region","page":"Adapting Persefone","title":"Changing the region","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"To apply Persefone to a new region, you need to create new input maps of land cover and farmplots. How to do so is described here.","category":"page"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"You may also need to change aspects of the farm submodel. This is not yet implemented.","category":"page"},{"location":"adapting.html#Adding-new-animal-species","page":"Adapting Persefone","title":"Adding new animal species","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"To implement a new species to the nature submodel, add a new file to the  src/nature/species directory and include it in src/Persefone.jl, as well as adding the name of the species to the nature.targetspecies parameter. In the new file, implement the species using the @species syntax as described here.","category":"page"},{"location":"adapting.html#Adding-new-crop-species","page":"Adapting Persefone","title":"Adding new crop species","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"Crop growth is not yet implemented.","category":"page"},{"location":"adapting.html#Adding-new-farmer-behaviour","page":"Adapting Persefone","title":"Adding new farmer behaviour","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"Farmer behaviour is not yet implemented.","category":"page"},{"location":"adapting.html#Adding-a-new-submodel","page":"Adapting Persefone","title":"Adding a new submodel","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"To add a new submodel in addition to the existing ones (nature, crop, and farm), you need to familiarise yourself with the software architecture. In particular, you need to understand how initialisation and scheduling works in src/core/simulation.jl, and what information is stored in the model object.","category":"page"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"If you want to add a new agent type, use Agents.jl's  @agent macro. (But be aware that Persefone already has three agent types and you may encounter performance problems.) Having implemented the new agent type, add it to the model objects type definition and scheduler, and write an initialisation function and a stepagent! function. (See Persefone.initmodel and stepsimulation! for details.)","category":"page"},{"location":"adapting.html#Linking-to-another-model","page":"Adapting Persefone","title":"Linking to another model","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"Persefone can also be used as a software library and be called from another application. For this purpose, it is set up as a Julia package, with a module exporting various model functions, types, and macros (see  src/Persefone.jl). Of particular interest are the functions simulate (set up and run a complete simulation based on a config file), initialise (create one or more model objects from a config file), simulate! (do a simulation run with an existing model object), and stepsimulation! (update a model object by one time step).","category":"page"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"To interface with Julia from another language, see the Julia docs here and here.","category":"page"},{"location":"odd.html#Overview,-Design,-Details-(ODD)","page":"Overview, Design, Details (ODD)","title":"Overview, Design, Details (ODD)","text":"","category":"section"},{"location":"odd.html","page":"Overview, Design, Details (ODD)","title":"Overview, Design, Details (ODD)","text":"TODO","category":"page"},{"location":"gis.html#Maps-and-weather-data","page":"Maps and weather data","title":"Maps and weather data","text":"","category":"section"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Persefone currently requires two separate map input files: one for land cover, the other for field geometry. Additionally, a weather input file is needed.  This documents describe how to obtain and process the data needed for each  of these.","category":"page"},{"location":"gis.html#Land-cover-maps","page":"Maps and weather data","title":"Land cover maps","text":"","category":"section"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Land cover maps for Germany at 10m resolution can be obtained from  Mundialis. These are generated annually from Sentinel data and comprise the following  land cover classes:","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"10: forest\n20: low vegetation\n30: water\n40: built-up\n50: bare soil\n60: agriculture","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"To create a Persefone map input file, you need to crop the national Mundialis map to the extent that you want to simulate (suggestion: approx. 10x10km is a  reasonable size).","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"To do so, download the Mundialis map and import it into QGIS. Then create a new vector layer and create a rectangle feature to delimit the extent of your region. Then go to Raster -> Extraction -> Clip Raster by Extent. Select the Mundialis map as the input layer, set the clipping extent by choosing your region vector layer under Calculate from Layer and specify the output file name before clicking Run. This will generate a TIF file that you can pass to Persefone as the landcovermap parameter.","category":"page"},{"location":"gis.html#Field-ID-maps","page":"Maps and weather data","title":"Field ID maps","text":"","category":"section"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"In addition to the land cover data explained above, Persefone also needs information about agricultural field boundaries in order to assign these to the farming agents. Unfortunately, getting this is rather more complicated.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"In the EU, every country runs a Land Parcel Information System (LPIS) to administer CAP payments. In Germany, this is called InVeKoS and is run by the Länder. For example, you can view and download the InVeKoS data for Thüringen here. This gives you a vector layer which can be loaded into QGIS. However, it needs to be converted to a raster layer and cropped to your region extent before it can be used in Persefone.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"The first thing to do is to make sure that the vector layer has a numeric (!) field with a unique identifier for each field block (check the attribute table).  The Thüringen data has the FBI (\"Feldblockident\") field, but this is a string value and therefore not usable by the rasteriser. So, we set the vector layer to edit mode, open the field calculator, enter the information for a new field  (call it \"FID\" and set it to a 32-bit integer), and enter @row_number in the  expression field. Then save the layer and close the calculator.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Secondly, you need to filter out all non-field/non-grassland plot types. (LPIS also has data on forests and various landscape elements that are not relevant to our use case.) Assuming you're working with the Thüringen InVeKoS data (other data sets may have a different structure), right-click on the layer name in QGIS' layer overview and click on \"Filter...\". Then, enter this expression in the query builder: \"BNK\" = 'AL' OR \"BNK\" = 'GL' and click \"OK\". This will select only field and grassland plots.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Next, open the rasteriser (Raster -> Conversion -> Rasterize). Select your FID field as the \"Field to use for a burn-in value\", and your land cover map (as created above - this ensures the two layers match) as the output extent. Make sure  the \"fixed value to burn\" is \"Not set\". Then choose \"Georeferenced units\" as the  \"Out raster size units\" and set horizontal and vertical resolution to 10.0. In  the advanced parameters, set the output data type to UInt32. Finally, enter an  output file name and run. The resulting TIF file can be passed to Persefone as the farmfieldmap parameter.","category":"page"},{"location":"gis.html#Weather-data","page":"Maps and weather data","title":"Weather data","text":"","category":"section"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Currently, Persefone uses historical weather data from the closes weather station as its weather input. (In future, this may be changed to a more detailed raster input, which could then also provide future weather predictions under climate change.) Weather data can be downloaded from the German weather service (DWD). The relevant data are in the folder daily/kl/historical.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"The description of this data set and the list of weather stations can be found in the Persefone repository, in the docs folder (or downloaded from the link above). Using the list of weather stations, select the one closest to the area of study. Note that not all stations were continuously in operation; make sure that the selected station covers the years of interest.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Region Jena: station number 02444 (\"Jena (Sternwarte)\")\nRegion Eichsfeld:\nRegion Thüringer Becken:\nRegion Hohenlohe:\nRegion Bodensee:\nRegion Nördlicher Oberrhein:","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"From the link above, download the ZIP file associated with the station number. Check the included meta-data if there is any important missing data, or other relevant information (e.g. the station moved position).","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Then use data/extract_weather_data.R to process the data into the format needed by Persefone:","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"library(tidyverse)\n\n## replace this with the correct file name\nweatherfile = \"produkt_klima_tag_18210101_20221231_02444.txt\"\n\ndata = read.table(weatherfile, sep=\";\", header=T)\n\nweather = data %>%\n    ## drop values before 2000 to save space\n    filter(MESS_DATUM>=20000101) %>%\n    ## select relevant variables and convert place-holder values to NA\n    select(MESS_DATUM, FM, RSK, SDK, VPM, TMK, TXK, TNK) %>%\n    mutate(date=MESS_DATUM, MESS_DATUM=NULL,\n           mean_windspeed=na_if(FM, -999), FM=NULL,\n           precipitation=na_if(RSK, -999), RSK=NULL,\n           sunshine_hours=na_if(SDK, -999), SDK=NULL,\n           mean_vapour_pressure=na_if(VPM, -999), VPM=NULL,\n           mean_temperature=na_if(TMK, -999), TMK=NULL,\n           max_temperature=na_if(TXK, -999), TXK=NULL,\n           min_temperature=na_if(TNK, -999), TNK=NULL)\n\n## replace with the desired file name\nwrite.csv(weather, file=\"weather_jena.csv\", row.names=FALSE)","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Note: for calculating the reference evapotranspiration ET_0 (needed for the AquaCrop model),  use the FAO Penman-Monteith equation.","category":"page"},{"location":"crops.html#Crop-submodel","page":"Crop submodel","title":"Crop submodel","text":"","category":"section"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"Eventually, the plan is to have Persefone include a reimplementation of the AquaCrop model,  a well-established crop growth model developed by the FAO. Until then, we are using the crop growth submodel used in ALMaSS.","category":"page"},{"location":"crops.html#farmplot.jl","page":"Crop submodel","title":"farmplot.jl","text":"","category":"section"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"This file is responsible for the farm plots, i.e. the indidivual fields that farmers manage.","category":"page"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"Modules = [Persefone]\nPages = [\"crop/farmplot.jl\"]","category":"page"},{"location":"crops.html#Persefone.FarmPlot","page":"Crop submodel","title":"Persefone.FarmPlot","text":"FarmPlot\n\nThis represents one field, i.e. a collection of pixels with the same management. This is the spatial unit with which the crop growth model and the farm model work.\n\n\n\n\n\n","category":"type"},{"location":"crops.html#Persefone.averagefieldsize-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.averagefieldsize","text":"averagefieldsize(model)\n\nCalculate the average field size in hectares for the model landscape.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.cropheight","text":"cropheight(model, position)\n\nReturn the height of the crop at this position, or nothing if there is no crop here (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.cropname-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.cropname","text":"cropname(model, position)\n\nReturn the name of the crop at this position, or nothing if there is no crop here (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.croptype","text":"croptype(model, position)\n\nReturn the crop at this position, or nothing if there is no crop here (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.growcrop!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.growcrop!","text":"growcrop!(farmplot, model)\n\nApply the relevant crop growth model to update the plants on this farm plot. Currently only supports the ALMaSS crop growth model by Topping et al.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.harvest!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.harvest!","text":"harvest!(farmplot, model)\n\nHarvest the crop on this farmplot.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.initfields!-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.initfields!","text":"initfields!(model)\n\nInitialise the model with its farm plots.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.sow!-Tuple{String, FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.sow!","text":"sow!(cropname, farmplot, model)\n\nSow the specified crop on this farmplot.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.stepagent!","text":"stepagent!(farmplot, model)\n\nUpdate a farm plot by one day.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#crops.jl","page":"Crop submodel","title":"crops.jl","text":"","category":"section"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"This includes the types and functions needed for all crop growth model, which are also referenced by the other submodels.","category":"page"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"Modules = [Persefone]\nPages = [\"crop/crops.jl\"]","category":"page"},{"location":"crops.html#Persefone.CropCurveParams","page":"Crop submodel","title":"Persefone.CropCurveParams","text":"CropCurveParams\n\nThe values in this struct define one crop growth curve.\n\n\n\n\n\n","category":"type"},{"location":"crops.html#Persefone.CropType","page":"Crop submodel","title":"Persefone.CropType","text":"CropType\n\nThe type struct for all crops. Currently follows the crop growth model as implemented in ALMaSS.\n\n\n\n\n\n","category":"type"},{"location":"crops.html#Persefone.GrowthPhase","page":"Crop submodel","title":"Persefone.GrowthPhase","text":"GrowthPhase\n\nALMaSS crop growth curves are split into five phases, triggered by seasonal dates or agricultural events.\n\n\n\n\n\n","category":"type"},{"location":"crops.html#Base.tryparse-Tuple{Type{Persefone.GrowthPhase}, String}","page":"Crop submodel","title":"Base.tryparse","text":"Base.tryparse(type, str)\n\nExtend tryparse to allow parsing GrowthPhase values. (Needed to read in the CSV parameter file.)\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.buildgrowthcurve-Tuple{Vector{CSV.Row}}","page":"Crop submodel","title":"Persefone.buildgrowthcurve","text":"buildgrowthcurve(data)\n\nConvert a list of rows from the crop growth data into a CropCurveParams object.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.readcropparameters-Tuple{String, String}","page":"Crop submodel","title":"Persefone.readcropparameters","text":"readcropparameters(generalcropfile, cropgrowthfile)\n\nParse a CSV file containing the required parameter values for each crop (as produced from the original ALMaSS file by convert_almass_data.py).\n\n\n\n\n\n","category":"method"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"CurrentModule = Persefone","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"(Image: Persefone.jl splash screen)","category":"page"},{"location":"index.html#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Persefone.jl models agricultural practice and how it impacts  animal species at a landscape scale. It includes a farm submodel, a crop growth submodel,  and individual-based models of multiple indicator species. Its aim is to investigate how  changes in farm operations (e.g. through policy changes in the CAP) influence biodiversity.","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"The model is open-source software licensed under the terms of the MIT license and available on Gitlab.","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Last updated: 2023-10-27 (commit 9f4a9c7)","category":"page"}]
+[{"location":"energy.html#Dynamic-Energy-Budgets","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"","category":"section"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"Persefone's nature module uses Kooijman's Dynamic Energy Budget theory to model energy flows within individuals.","category":"page"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"(Image: \"The standard model of the Dynamic Energy Budget theory\")","category":"page"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"The standard model of the Dynamic Energy Budget theory. (Fig. 1 from Sousa et al. (2010).)","category":"page"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"Sousa et al. (2010). Dynamic energy budget theory restores coherence in biology. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1557), 3413–3428.\nKooijman, S. A. L. M. (2009). Dynamic energy and mass budgets in biological systems (3rd ed). Cambridge University Press.\nSibly et al. (2013). Representing the acquisition and use of energy by individuals in agent-based models of animal populations. Methods in Ecology and Evolution, 4(2), 151–161.","category":"page"},{"location":"energy.html#energy.jl","page":"Dynamic Energy Budgets","title":"energy.jl","text":"","category":"section"},{"location":"energy.html","page":"Dynamic Energy Budgets","title":"Dynamic Energy Budgets","text":"Modules = [Persefone]\nPages = [\"nature/energy.jl\"]","category":"page"},{"location":"energy.html#Persefone.DEBparameters","page":"Dynamic Energy Budgets","title":"Persefone.DEBparameters","text":"DEBparameters\n\nAn immutable struct to save the parameter list for a species' Dynamic Energy Budget model. (See Sousa et al., 2010.)\n\n\n\n\n\n","category":"type"},{"location":"energy.html#Persefone.EnergyBudget","page":"Dynamic Energy Budgets","title":"Persefone.EnergyBudget","text":"EnergyBudget\n\nThis struct represents an individual's energy balance, as conceptualised by the Dynamic Energy Budget theory. Upon assimilation, energy is first stored as biomass in a reserve buffer, before being used for maintenance, growth, and reproduction. (Note that this is a simplified model form which ignores maturity as a separate buffer.)\n\nSources:\n\nMalishev & Kramer-Schadt (2021). Movement, models, and metabolism: Individual-based energy budget models as next-generation extensions for predicting animal movement outcomes across scales. Ecological Modelling, 441, 109413. https://doi.org/10.1016/j.ecolmodel.2020.109413\nMarques et al. (2018). The AmP project: Comparing species on the basis of dynamic energy budget parameters. PLOS Computational Biology,14(5), e1006100. https://doi.org/10.1371/journal.pcbi.1006100\nSibly et al. (2013). Representing the acquisition and use of energy by individuals in agent-based models of animal populations. Methods in Ecology and Evolution, 4(2), 151–161. https://doi.org/10.1111/2041-210x.12002\nSousa et al. (2010). Dynamic energy budget theory restores coherence in biology. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1557), 3413–3428. https://doi.org/10.1098/rstb.2010.0166\nKooijman, S. A. L. M. (2009). Dynamic energy and mass budgets in biological systems (3rd ed). Cambridge University Press. https://www.researchgate.net/profile/Edgar-Meza-3/post/Isthereatoxicokineticmodelfordaphniamagnaorotherzooplankton/attachment/59d62cf579197b807798b396/AS%3A348547653357569%401460111644286/download/Dynamic+Energy+Budget+theory+-+Kooijman.pdf\nsee also: Brown et al. (2004). Toward a metabolic theory of ecology. Ecology, 85(7), 1771–1789. https://doi.org/10.1890/03-9000\n\n\n\n\n\n","category":"type"},{"location":"energy.html#Persefone.feed!-Tuple{Float64, Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.feed!","text":"feed!(quantity, energybudget)\n\nConsume a given quantity of food. Expands the energy reserve by an amount determined by the assimilation rate. Returns true if successful, false if the reserve is already full.\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.growthrate-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.growthrate","text":"growthrate(energybudget)\n\nCalculate the specific growth rate r. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.investmentratio-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.investmentratio","text":"investmentratio(energybudget)\n\nCalculate the investment ratio g. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.maturitymaintenance-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.maturitymaintenance","text":"maturitymaintenance(energybudget)\n\nCalculate the specific maturity maintenance k_J. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.mobilisation-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.mobilisation","text":"mobilisation(energybudget)\n\nCalculate the mobilisation rate J_EC. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.reproduce!-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.reproduce!","text":"reproduce!(energybudget)\n\nIf there is sufficient energy in the offspring buffer of an adult, produce an embryo/egg, reducing the parent energy in the process. Returns the embryo's energy budget, or nothing if the conditions are not met.\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.scaledreservedensity-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.scaledreservedensity","text":"scaledreservedensity(energybudget)\n\nCalculate the scaled reserve density e. (Internal function.)\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.update!-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.update!","text":"update!(energybudget)\n\nCarry out a daily update of the energy budget. Mobilises reserves and allocates these to maintenance (prioritised), growth, and reproduction.\n\nReturn true if the individual has enough energy to survive, or false if the reserve is empty and it starves.\n\n\n\n\n\n","category":"method"},{"location":"energy.html#Persefone.volumetriclength-Tuple{Persefone.EnergyBudget}","page":"Dynamic Energy Budgets","title":"Persefone.volumetriclength","text":"volumetriclength(energybudget)\n\nCalculate the structural length in cm based on an individual's weight (assuming a density of 1 g/cm³ to calculate volume, see Kooijman 2009).\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Nature","page":"Nature","title":"Nature","text":"","category":"section"},{"location":"nature.html#nature.jl","page":"Nature","title":"nature.jl","text":"","category":"section"},{"location":"nature.html","page":"Nature","title":"Nature","text":"This file is responsible for managing the animal modules.","category":"page"},{"location":"nature.html","page":"Nature","title":"Nature","text":"Modules = [Persefone]\nPages = [\"nature/nature.jl\"]","category":"page"},{"location":"nature.html#Persefone.Animal","page":"Nature","title":"Persefone.Animal","text":"Animal\n\nThis is the generic agent type for all animals. Species are differentiated by trait dictionaries passed by them during initialisation. (Note that each trait variable can still be accessed as if it were a normal field name, i.e. the trait phase can be accessed and modified with animal.phase.)\n\n\n\n\n\n","category":"type"},{"location":"nature.html#Persefone.animalid-Tuple{Animal}","page":"Nature","title":"Persefone.animalid","text":"animalid(animal)\n\nA small utility function to return a string with the species name and ID of an animal.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.initnature!-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persefone.initnature!","text":"initnature!(model)\n\nInitialise the model with all simulated animal populations.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}","page":"Nature","title":"Persefone.stepagent!","text":"stepagent!(animal, model)\n\nUpdate an animal by one day, executing it's currently active phase function.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.@countanimals-Tuple","page":"Nature","title":"Persefone.@countanimals","text":"@countanimals(species=\"\", radius=0)\n\nCount the number of animals of the given species in this location. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@cropheight-Tuple{}","page":"Nature","title":"Persefone.@cropheight","text":"@cropheight\n\nReturn the height of the crop at this position, or 0 if there is no crop here. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@cropname-Tuple{}","page":"Nature","title":"Persefone.@cropname","text":"@cropname\n\nReturn the name of the local croptype, or nothing if there is no crop here. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@distanceto-Tuple{Any}","page":"Nature","title":"Persefone.@distanceto","text":"@distanceto(habitat)\n\nCalculate the distance to the closest habitat of the specified type or descriptor. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@distancetoedge-Tuple{}","page":"Nature","title":"Persefone.@distancetoedge","text":"@distancetoedge\n\nCalculate the distance to the closest neighbouring habitat. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@habitat-Tuple{Any}","page":"Nature","title":"Persefone.@habitat","text":"@habitat\n\nSpecify habitat suitability for spatial ecological processes.\n\nThis macro works by creating an anonymous function that takes in a model object and a position, and returns true or false depending on the conditions specified in the macro body.\n\nSeveral utility macros can be used within the body of @habitat as a short-hand for common expressions: @landcover, @cropname, @cropheight, @distanceto, @distancetoedge, @countanimals. The variables model and pos can be used for checks that don't have a macro available.\n\nTwo example uses of @habitat might look like this:\n\nmovementhabitat = @habitat(@landcover() in (grass agriculture soil))\n\nnestinghabitat = @habitat((@landcover() == grass || \n                           (@landcover() == agriculture && @cropname() != \"maize\" &&\n                            @cropheight() < 10)) &&\n                          @distanceto(forest) > 20)\n\nFor more complex habitat suitability checks, the use of this macro can be circumvented by directly creating an equivalent function.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}","page":"Nature","title":"Persefone.@initialise","text":"@initialise(habitatdescriptor; kwargs...)\n\nCall this macro within the body of @species. It passes the given habitat descriptor function and keyword arguments on to initpopulation when setting up the simulation.\n\nNote: if this macro is not used, the variable initialise! must be set manually in the species definition.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@kill-Tuple","page":"Nature","title":"Persefone.@kill","text":"@kill\n\nKill this animal (and immediately abort its current update). This is a thin wrapper around kill!, and passes on any arguments. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@landcover-Tuple{}","page":"Nature","title":"Persefone.@landcover","text":"@landcover\n\nReturns the local landcover. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@neighbours-Tuple{Any}","page":"Nature","title":"Persefone.@neighbours","text":"@neighbours(radius)\n\nReturn an iterator over all animals in the given radius around this animal, excluding itself. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@phase-Tuple{Any, Any}","page":"Nature","title":"Persefone.@phase","text":"@phase(name, body)\n\nThis macro is designed to be used within a species definition block (i.e. within the body of a call to @species).\n\nThe idea behind this is that species show very different behaviour during different phases of their lives. Therefore, @phase can be used define the behaviour for one such phase, and the conditions under which the animal transitions to another phase.\n\n@phase works by creating a function that will be called by the model if the animal is in the relevant phase. When it is called, it has access to the following variables:\n\nanimal a reference to the animal itself. This provides access to animal.age,   animal.sex, and animal.<trait> (where <trait> is a variable that was defined   in the top part of the species definition body).\npos gives the animal's current position as a coordinate tuple.\nmodel a reference to the model world (an object of type AgentBasedModel).   This allows access to model.date (the current simulation date) and   model.landscape (a two-dimensional array of pixels containing geographic   information).\n\nSeveral utility macros can be used within the body of @phase as a short-hand for common expressions: @trait, @setphase, @respond, @kill, @reproduce, @neighbours, @rand, @shuffle!.\n\nNote that the first phase that is defined in a species definition block will be the phase that animals are assigned at birth, unless the variable phase is explicitly defined by the user in the species definition block.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@reproduce-Tuple","page":"Nature","title":"Persefone.@reproduce","text":"@reproduce\n\nLet this animal reproduce. This is a thin wrapper around reproduce!, and passes on any arguments. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@respond-Tuple{Any, Any}","page":"Nature","title":"Persefone.@respond","text":"@respond(eventname, body)\n\nDefine how an animal responds to a landscape event that affects its current position. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@setphase-Tuple{Any}","page":"Nature","title":"Persefone.@setphase","text":"@setphase(newphase)\n\nSwitch this animal over to a different phase. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@species-Tuple{Any, Any}","page":"Nature","title":"Persefone.@species","text":"@species(name, body)\n\nA macro used to create new species definitions for the nature model. This is effectively a simple domain-specific language, establishing a custom syntax to describe species' biology:\n\n@species name begin\n\n    @initialise(@habitat(...))\n    speciesvar1 = 3.14\n    ...\n\n    @phase phase1 begin\n        ...\n    end\nend\n\nThe definition body (enclosed in the begin/end block) has two sections. First comes a call to @initialise, and optionally a list of species-specific parameters, which are assigned just like normal variables. Second come one or more phase definitions, that describe the behaviour of the species during various parts of its life cycle. (See the documentation to @initialise and @phase for details).\n\nCode in a species definition block can access the rest of the model using the model variable (an object of type AgentBasedModel).\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#Persefone.@trait-Tuple{Any}","page":"Nature","title":"Persefone.@trait","text":"@trait(traitname)\n\nA utility macro to quickly access an animal's trait value. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature.html#populations.jl","page":"Nature","title":"populations.jl","text":"","category":"section"},{"location":"nature.html","page":"Nature","title":"Nature","text":"This file contains a set of utility functions for species, including initialisation, reproduction, and mortality.","category":"page"},{"location":"nature.html","page":"Nature","title":"Nature","text":"Modules = [Persefone]\nPages = [\"nature/populations.jl\"]","category":"page"},{"location":"nature.html#Persefone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Nature","title":"Persefone.countanimals","text":"countanimals(pos, model; species=\"\", radius=0)\n\nCount the number of animals in this location (optionally supplying a species name and radius).\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.initpopulation-Tuple{Function}","page":"Nature","title":"Persefone.initpopulation","text":"initpopulation(habitatdescriptor; popsize=-1, pairs=false, asexual=false)\n\nCreates a function that initialises individuals at random locations across the landscape. This can be used to create the initialise! variable in a species definition block.\n\nhabitatdescriptor is a function that determines whether a given location is suitable   or not (create this using @habitat).\nphase determines which life phase individuals will be assigned to. If this is nothing,   the species' default post-natal life stage will be used (although note that this is   probably not what you want).\npopsize determines the number of individuals that will be created. If this is zero or   negative, one individual will be created in every suitable location in the landscape.   If popsize is greater than the number of suitable locations, multiple individuals   will be created in one place. (Maximum population density can be set in the habitat   descriptor using the @countanimals macro.)\nIf pairs is true, a male and a female individual will be created in each selected   location, otherwise, only one individual will be created at a time.\nIf asexual is true, all created individuals are assigned the sex hermaphrodite,   otherwise, they are randomly assigned male of female. (If pairs is true, asexual   is ignored.)\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.initrandompopulation-Tuple{Int64}","page":"Nature","title":"Persefone.initrandompopulation","text":"initrandompopulation(popsize; kwargs...)\n\nA simplified version of initpopulation. Creates a function that initialises popsize individuals, spread at random across the landscape.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.kill!","page":"Nature","title":"Persefone.kill!","text":"kill(animal, model, probability=1.0, cause=\"\")\n\nKill this animal, optionally with a given percentage probability. Returns true if the animal dies, false if not.\n\n\n\n\n\n","category":"function"},{"location":"nature.html#Persefone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persefone.nearby_animals","text":"nearby_animals(animal, model, radius)\n\nReturn an iterator over all animals in the given radius around this animal, excluding itself.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persefone.nearby_animals","text":"nearby_animals(pos, model, radius)\n\nReturn an iterator over all animals in the given radius around this position.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.reproduce!","page":"Nature","title":"Persefone.reproduce!","text":"reproduce!(animal, model, n=1)\n\nProduce one or more offspring for the given animal at its current location.\n\n\n\n\n\n","category":"function"},{"location":"nature.html#insects.jl","page":"Nature","title":"insects.jl","text":"","category":"section"},{"location":"nature.html","page":"Nature","title":"Nature","text":"This file contains the insect submodel, which calculates the likely insect biomass in a given location at a given time.","category":"page"},{"location":"nature.html","page":"Nature","title":"Nature","text":"Modules = [Persefone]\nPages = [\"nature/insects.jl\"]","category":"page"},{"location":"nature.html#Persefone.insectbiomass-Tuple{Pixel, Agents.AgentBasedModel}","page":"Nature","title":"Persefone.insectbiomass","text":"insectbiomass(pixel, model)\n\nCalculate the insect biomass in this location, using the factors configured in the nature.insectmodel settings (any combination of: \"season\", \"habitat\", \"weather\", \"pesticides\"). Returns a float value in g/m².\n\nBiological note: this is a very approximate calculation! Insect biomass varies wildly in time and space and is hard to measure. This calculation is based on the idea of a parabolic seasonal development of insect abundance, modified by habitat suitability, weather, and pesticide application. Although it is based on empirical studies, it can only deliver a rough, order-of-magnitude estimation of likely insect biomass in a given location.\n\nSources:\n\nOdderskær et al. (1997). Skylark Reproduction in Pesticide Treated and Untreated Fields (32; Pesticides Research). Danish Environmental Protection Agency.\nGrüebler et al. (2008). A predictive model of the density of airborne insects in agricultural environments. Agriculture, Ecosystems & Environment, 123(1), 75–80. https://doi.org/10.1016/j.agee.2007.05.001\nPaquette et al. (2013). Seasonal patterns in Tree Swallow prey (Diptera) abundance are affected by agricultural intensification. Ecological Applications, 23(1), 122–133. https://doi.org/10.1890/12-0068.1\nPüttmanns et al. (2022). Habitat use and foraging parameters of breeding Skylarks indicate no seasonal decrease in food availability in heterogeneous farmland. Ecology and Evolution, 12(1), e8461. https://doi.org/10.1002/ece3.8461\n\n\n\n\n\n","category":"method"},{"location":"nature.html#ecologicaldata.jl","page":"Nature","title":"ecologicaldata.jl","text":"","category":"section"},{"location":"nature.html","page":"Nature","title":"Nature","text":"This file contains a set of life-history related utility functions needed by species.","category":"page"},{"location":"nature.html","page":"Nature","title":"Nature","text":"Modules = [Persefone]\nPages = [\"nature/ecologicaldata.jl\"]","category":"page"},{"location":"nature.html#Persefone.initecologicaldata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persefone.initecologicaldata","text":"initecologicaldata()\n\nCreate output files for each data group collected by the nature model.\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.saveindividualdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persefone.saveindividualdata","text":"saveindividualdata(model)\n\nReturn a comma-separated set of lines (to be printed to individuals.csv), listing all properties of all animal individuals in the model. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter nature.indoutfreq. WARNING: Produces very big files!\n\n\n\n\n\n","category":"method"},{"location":"nature.html#Persefone.savepopulationdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persefone.savepopulationdata","text":"savepopulationdata(model)\n\nReturn a comma-separated set of lines (to be printed to populations.csv), giving the current date and population size for each animal species. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter nature.popoutfreq.\n\n\n\n\n\n","category":"method"},{"location":"gui.html#Graphical-User-Interface","page":"Graphical User Interface","title":"Graphical User Interface","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Due to the computational demands of simulating many individuals at high temporal and spatial resolution, Persefone.jl is primarily designed to be run non-interactively on an HPC. However, to allow interactive exploratory simulations to be conducted while learning or developing the model, a graphical user interface is available as an additional package: Persefone Desktop.","category":"page"},{"location":"gui.html#Install-and-run","page":"Graphical User Interface","title":"Install and run","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"To install: Install Julia and download/clone  the repository. Open a Julia REPL  in the downloaded folder and execute the following to install all dependencies:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"using Pkg\nPkg.activate(\".\")\nPkg.instantiate()","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"To run: Run desktop.jl. Alternatively, open a Julia REPL in this folder and run:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"using Pkg\nPkg.activate(\".\")\nusing PersefoneDesktop\nlaunch()","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Note: Due to the necessary pre-compilation done by Julia, installing and launching the application can take quite a long time. (Start-up time with desktop.jl is currently about 2 minutes.) We will reduce this as much as possible in future releases.","category":"page"},{"location":"gui.html#User-interface","page":"Graphical User Interface","title":"User interface","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"(Image: Persefone.jl Desktop screenshot)","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"The main window component is the map view. This displays a land cover map of the simulated region: dark green are forests, light green grassland, yellow fields, red built-up areas and blue water. On it, little circles show the position of individual animals, with different species denoted by different colours.","category":"page"},{"location":"gui.html#Control-bar","page":"Graphical User Interface","title":"Control bar","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Back button: Rewind the simulation by one day.\nStep button: Advance the simulation by one day.\nRun button: Run the simulation until the button is pressed again or the end date is reached.\nProgress bar: Shows the percentage of time elapsed between the start and end dates of the simulation.\nSpeed slider: Set the time delay between each simulation step when running.\nDate: Shows the simulation date currently displayed on the map.","category":"page"},{"location":"gui.html#Menu-bar","page":"Graphical User Interface","title":"Menu bar","text":"","category":"section"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Simulation:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"New simulation: Reset the model and start over.\nConfigure simulation: Change the model settings (not yet implemented).\nLoad saved state: Load a model object file saved by a previous simulation run.\nSave current state: Save a model object file for later use.\nQuit: Close the application.","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Data:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Show population graph: Show a window with a graph of population sizes over time in the current model run.\nSave simulation output: Save the model output data to file (saves both raw CSV data and generated graphics).","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Help:","category":"page"},{"location":"gui.html","page":"Graphical User Interface","title":"Graphical User Interface","text":"Documentation: Open the Persefone.jl online documentation in a browser.\nWebsite: Open the main Persefone.jl website in a browser.\nAbout: Show a window with core information about the application.","category":"page"},{"location":"io.html#Input-and-Output","page":"Input and Output","title":"Input and Output","text":"","category":"section"},{"location":"io.html","page":"Input and Output","title":"Input and Output","text":"These functions are responsible for reading in all model configurations (passed by config file or commandline), administrating them during a run, and printing or plotting any output.","category":"page"},{"location":"io.html#input.jl","page":"Input and Output","title":"input.jl","text":"","category":"section"},{"location":"io.html","page":"Input and Output","title":"Input and Output","text":"Modules = [Persefone]\nPages = [\"core/input.jl\"]","category":"page"},{"location":"io.html#Persefone.PARAMFILE","page":"Input and Output","title":"Persefone.PARAMFILE","text":"The file that stores all default parameters: src/parameters.toml\n\n\n\n\n\n","category":"constant"},{"location":"io.html#Persefone.flattenTOML-Tuple{Any}","page":"Input and Output","title":"Persefone.flattenTOML","text":"flattenTOML(dict)\n\nAn internal utility function to convert the two-dimensional dict returned by TOML.parsefile() into a one-dimensional dict, so that instead of writing settings[\"domain\"][\"param\"] one can use settings[\"domain.param\"]. Can be reversed with prepareTOML.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.getsettings","page":"Input and Output","title":"Persefone.getsettings","text":"getsettings(configfile, seed=nothing)\n\nCombines all configuration options to produce a single settings dict. Precedence: commandline parameters - user config file - default values\n\n\n\n\n\n","category":"function"},{"location":"io.html#Persefone.loadmodelobject-Tuple{String}","page":"Input and Output","title":"Persefone.loadmodelobject","text":"loadmodelobject(fullfilename)\n\nDeserialise a model object that was previously saved with [savemodelobject](@ref).\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.parsecommandline-Tuple{}","page":"Input and Output","title":"Persefone.parsecommandline","text":"parsecommandline()\n\nCertain software parameters can be set via the commandline.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.preprocessparameters-Tuple{Dict{String, Any}, String}","page":"Input and Output","title":"Persefone.preprocessparameters","text":"preprocessparameters(settings)\n\nTake the raw input parameters and process them (convert types, perform checks, etc.). This is a helper function for getsettings.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.@param-Tuple{Any}","page":"Input and Output","title":"Persefone.@param","text":"@param(domainparam)\n\nReturn a configuration parameter from the global settings. The argument should be in the form <domain>.<parameter>, for example @param(core.outdir). Possible values for <domain> are core, nature, farm, or crop. For a full list of parameters, see src/parameters.toml.\n\nNote: this macro only works in a context where the model object is available!\n\n\n\n\n\n","category":"macro"},{"location":"io.html#Persefone.@rand-Tuple","page":"Input and Output","title":"Persefone.@rand","text":"@rand(args...)\n\nReturn a random number or element from the sample, using the model RNG. This is a utility wrapper that can only be used a context where the model object is available.\n\n\n\n\n\n","category":"macro"},{"location":"io.html#Persefone.@shuffle!-Tuple{Any}","page":"Input and Output","title":"Persefone.@shuffle!","text":"@shuffle!(collection)\n\nShuffle the given collection in place, using the model RNG. This is a utility wrapper that can only be used a context where the model object is available.\n\n\n\n\n\n","category":"macro"},{"location":"io.html#output.jl","page":"Input and Output","title":"output.jl","text":"","category":"section"},{"location":"io.html","page":"Input and Output","title":"Input and Output","text":"Modules = [Persefone]\nPages = [\"core/output.jl\"]","category":"page"},{"location":"io.html#Persefone.DataOutput","page":"Input and Output","title":"Persefone.DataOutput","text":"DataOutput\n\nA struct for organising model output. This is used to collect model data in an in-memory dataframe or for CSV output. Submodels can register their own output functions using newdataoutput!.\n\nStruct fields:     - name: a string identifier for the data collection (used as file name)     - header: a list of column names     - outputfunction: a function that takes a model object and returns data values to record (formatted as a vector of vectors)     - frequency: how often to call the output function (daily/monthly/yearly/end/never)     - plotfunction: a function that takes a model object and returns a Makie figure object (optional)\n\n\n\n\n\n","category":"type"},{"location":"io.html#Persefone.createdatadir-Tuple{String, Union{Bool, String}}","page":"Input and Output","title":"Persefone.createdatadir","text":"createdatadir(outdir, overwrite)\n\nCreates the output directory, dealing with possible conflicts.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.modellogger-Tuple{String, String}","page":"Input and Output","title":"Persefone.modellogger","text":"modellogger(loglevel, outdir)\n\nCreate a logger object that writes output both to screen and to a logfile. This object is stored as model.logger and can then be used with with_logger(). Note: requires createdatadir to be run first.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.newdataoutput!","page":"Input and Output","title":"Persefone.newdataoutput!","text":"newdataoutput!(model, name, header, outputfunction, frequency)\n\nCreate and register a new data output. This function must be called by all submodels that want to have their output functions called regularly.\n\n\n\n\n\n","category":"function"},{"location":"io.html#Persefone.outputdata","page":"Input and Output","title":"Persefone.outputdata","text":"outputdata(model, force=false)\n\nCycle through all registered data outputs and activate them according to their configured frequency. If force is true, activate all outputs regardless of their configuration.\n\n\n\n\n\n","category":"function"},{"location":"io.html#Persefone.prepareTOML-Tuple{Any}","page":"Input and Output","title":"Persefone.prepareTOML","text":"prepareTOML(dict)\n\nAn internal utility function to re-convert the one-dimensional dict created by flattenTOML into the two-dimensional dict needed by TOML.print, and convert any data types into TOML-compatible types where necessary.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.saveinputfiles-Tuple{Agents.AgentBasedModel}","page":"Input and Output","title":"Persefone.saveinputfiles","text":"saveinputfiles(model)\n\nCopy all input files into the output directory, including the actual parameter settings used. This allows replicating a run in future.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.savemodelobject-Tuple{Agents.AgentBasedModel, String}","page":"Input and Output","title":"Persefone.savemodelobject","text":"savemodelobject(model, filename)\n\nSerialise a model object and save it to file for later reference. Includes the current model and Julia versions for compatibility checking.\n\nWARNING: produces large files (>100 MB) and takes a while to execute.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.visualiseoutput","page":"Input and Output","title":"Persefone.visualiseoutput","text":"visualiseoutput(model)\n\nCycle through all data outputs and call their respective plot functions, saving each figure as a PDF.\n\n\n\n\n\n","category":"function"},{"location":"io.html#Persefone.withtestlogger-Tuple{Agents.AgentBasedModel}","page":"Input and Output","title":"Persefone.withtestlogger","text":"withtestlogger(model)\n\nReplace the model logger with the currently active logger. This is intended to be used in the testsuite to circumvent a Julia issue, where @test_logs doesn't work with local loggers.\n\n\n\n\n\n","category":"method"},{"location":"io.html#makieplots.jl","page":"Input and Output","title":"makieplots.jl","text":"","category":"section"},{"location":"io.html","page":"Input and Output","title":"Input and Output","text":"Modules = [Persefone]\nPages = [\"analysis/makieplots.jl\"]","category":"page"},{"location":"io.html#Persefone.gettickmarks-Tuple{Any}","page":"Input and Output","title":"Persefone.gettickmarks","text":"gettickmarks(dates)\n\nGiven a vector of dates, construct a selection to use as tick mark locations. Helper function for [populationtrends](@ref)\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.populationtrends-Tuple{Agents.AgentBasedModel}","page":"Input and Output","title":"Persefone.populationtrends","text":"populationtrends(model)\n\nPlot a line graph of population sizes of each species over time. Returns a Makie figure object.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.visualisemap","page":"Input and Output","title":"Persefone.visualisemap","text":"visualisemap(model, date, landcovermap)\n\nDraw the model's land cover map and plot all individuals as points on it at the specified date. If no date is passed, use the last date for which data are available. Optionally, you can pass a landcover map image (this is needed to reduce the frequency of disk I/O for Persefone Desktop). Returns a Makie figure object.\n\n\n\n\n\n","category":"function"},{"location":"config.html#Configuration","page":"Configuration","title":"Configuration","text":"","category":"section"},{"location":"config.html","page":"Configuration","title":"Configuration","text":"Persefone requires three input files: a configuration file and two map files.  How to generate the map files is documented elsewhere. The configuration file defines parameter values and looks like this (see src/parameters.toml for the default):","category":"page"},{"location":"config.html","page":"Configuration","title":"Configuration","text":"### Persefone.jl - a model of agricultural landscapes and ecosystems in Europe.\n###\n### This is the default configuration file for Persefone, containing all model parameters.\n### The syntax is described here: https://toml.io/en/\n\n[core]\nconfigfile = \"src/parameters.toml\" # location of the configuration file\noutdir = \"results\" # location and name of the output folder\noverwrite = \"ask\" # overwrite the output directory? (true/false/\"ask\")\ncsvoutput = true # save collected data in CSV files\nvisualise = true # generate result graphs\nstoredata = true # keep collected data in memory\nloglevel = \"debug\" # verbosity level: \"debug\", \"info\", \"warn\"\nprocessors = 2 # number of processors to use on parallel runs\nseed = 2 # seed value for the RNG (0 -> random value)\n# dates to start and end the simulation\nstartdate = 2022-01-01\nenddate = 2022-12-31\n\n[world]\nlandcovermap = \"data/regions/jena/landcover.tif\" # location of the landcover map\nfarmfieldsmap = \"data/regions/jena/fields.tif\" # location of the field geometry map\nweatherfile = \"data/regions/jena/weather.csv\" # location of the weather data file\n\t\n[farm]\nfarmmodel = \"FieldManager\" # which version of the farm model to use (not yet implemented)\n\n[nature]\ntargetspecies = [\"Wolpertinger\", \"Wyvern\"] # list of target species to simulate\npopoutfreq = \"daily\" # output frequency population-level data, daily/monthly/yearly/end/never\nindoutfreq = \"end\" # output frequency individual-level data, daily/monthly/yearly/end/never\ninsectmodel = [\"season\", \"habitat\", \"pesticides\", \"weather\"] # factors affecting insect growth\n\t\n[crop]\ncropmodel = \"almass\" # crop growth model to use, \"almass\" or \"aquacrop\"\ncropfile = \"data/crops/almass/crop_data_general.csv\" # file with general crop parameters\ngrowthfile = \"data/crops/almass/almass_crop_growth_curves.csv\" # file with crop growth parameters\t","category":"page"},{"location":"config.html","page":"Configuration","title":"Configuration","text":"info: Parameter scanning\nYou can set any parameter to a list of different values, e.g. seed = [1,2,3]. Persefone will then set up and run multiple simulations, one for every possible combination of parameters that you entered (i.e. do a full-factorial simulation experiment).","category":"page"},{"location":"using.html#The-Persefone.jl-Package","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"","category":"section"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"This page describes how to run Persefone.jl as a command line application or Julia package, which is the default mode. To use the model with a graphical user interface, see here.","category":"page"},{"location":"using.html#Installation","page":"The Persefone.jl Package","title":"Installation","text":"","category":"section"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"Install the latest version of the Julia programming  language (1.9+). The recommended editors are VSCode or Emacs. To install the package dependencies, open a Julia REPL in this folder and run:","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"using Pkg\nPkg.activate(\".\")\nPkg.instantiate()","category":"page"},{"location":"using.html#Running-from-the-command-line","page":"The Persefone.jl Package","title":"Running from the command line","text":"","category":"section"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"This is the normal mode of operation. Simply execute run.jl in a terminal, typically like  so (in Linux):","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"> julia run.jl -c <config>","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"where <config> specifies the configuration file to use. The recommended workflow is to copy scr/parameters.toml to a location of your choice and edit the copy to suit your requirements. The adapted config file can then be passed to run.jl. (If no configuration file is specified, Persefone will run with its default settings.)","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"The full list of commandline arguments is:","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"usage: run.jl [-c CONFIGFILE] [-s SEED] [-o OUTDIR] [-l LOGLEVEL] \n              [--version] [-h]\n\noptional arguments:\n  -c, --configfile CONFIGFILE\n                        name of the configuration file\n  -s, --seed SEED       inital random seed (type: Int64)\n  -o, --outdir OUTDIR   location of the output directory\n  -l, --loglevel LOGLEVEL\n                        verbosity: \"debug\", \"info\", or \"quiet\"\n  --version             show version information and exit\n  -h, --help            show this help message and exit","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"To run the test suite, switch to the test directory and execute runtests.jl.","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"If you are on Linux or MacOS, you can also use make:","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"> make run       # run a simulation with default values\n> make test      # run the test suite\n> make profile   # run and profile a default simulation\n> make docs      # build the documentation\n> make release   # create a release","category":"page"},{"location":"using.html#Running-from-within-Julia","page":"The Persefone.jl Package","title":"Running from within Julia","text":"","category":"section"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"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:","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"using Pkg\nPkg.activate(\".\") # assuming you're in the Persefone root folder\nusing Persefone","category":"page"},{"location":"using.html","page":"The Persefone.jl Package","title":"The Persefone.jl Package","text":"You can then access all Persefone functions, such as simulate, initialise, stepsimulation!, simulate!, or visualiseoutput. (See src/Persefone.jl for a list of exported  functions.)","category":"page"},{"location":"architecture.html#Source-code-architecture","page":"Source code architecture","title":"Source code architecture","text":"","category":"section"},{"location":"architecture.html#Model-components","page":"Source code architecture","title":"Model components","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"(Image: \"model architecture\")","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"Persefone is divided into four components, three of which are semi-independent submodels:","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"core: This is the foundation of the model software, which sets up and executes simulation runs. It also reads in the configuration file and landscape maps, and provides data output functionality. (Eventually, it will also provide weather data.)\nnature: This is an individual-based model of species in agricultural landscapes. It defines the Animal agent type, and a set of macros that can be used to rapidly create new species. It also includes ecological process functions that are useful for all species.\nfarm: This is an agent-based model of farmer decision making. It is not yet implemented, but will provide the Farmer agent type.\ncrop: This is a mathematical growth model for various crops. It is not yet implemented, but already provides the agent type FarmPlot, representing one field and its associated extent and crop type.","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"Conceptually, core provides functionality that is needed by all of the submodels. Decisions made by Farmers affect the FarmPlots they own, and (directly or indirectly) the Animals in the model landscape.","category":"page"},{"location":"architecture.html#Important-implementation-details","page":"Source code architecture","title":"Important implementation details","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"(Image: \"the model object\")","category":"page"},{"location":"architecture.html#The-model-object","page":"Source code architecture","title":"The model object","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"A cursory reading of the source code will quickly show that most functions take an  AgentBasedModel object as one of their arguments. This is the key data structure  of Agents.jl, and holds all state that is in any way relevant to a simulation run. (Persefone has a strict \"no global state\" policy to avoid state-dependent bugs and allow parallelisation.) The model object gives access to all agent instances (via model[id], where id is the unique identifier of this agent). It also stores the configuration (model.settings), the landscape (model.landscape, a matrix of Pixel objects that store the local land cover, amongst other things), and the current simulation date (model.date). (See Persefone.initmodel for details.)","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"For more information about working with agent objects, see the  Agents.jl API.","category":"page"},{"location":"architecture.html#Model-configuration/the-@param-macro","page":"Source code architecture","title":"Model configuration/the @param macro","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"The model is configured via a TOML file, the default version of which is at  src/parameters.toml. An individual run can be configured using a user-defined configuration file, commandline arguments, or function calls (when Persefone is used as a package rather than an application). During a model run, the @param macro can be used to access parameter values.  Note that parameter names are prepended with the name of the component they are associated  with. For example, the outdir parameter belongs to the [core] section of the TOML file,  and must therefore be referenced as  @param(core.outdir). (See  src/core/input.jl  for details.)","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"info: @param and other macros\nAs @param(parameter) expands to model.settings[\"parameter\"], it can obviously only be used in a context where the model object is actually available. (This is the case for most functions in Persefone, but not for all.) Similarly, many of the nature macros depend on specific variables being available where they are called, and can therefore only be used in specific contexts (this is indicated in their documentation).","category":"page"},{"location":"architecture.html#Output-data","page":"Source code architecture","title":"Output data","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"Persefone can output model data into text files with a specified frequency (daily, monthly, yearly, or at the simulation end). Submodels can use Persefone.newdataoutput! to plug into this system. For an example of how to use  this, see src/nature/ecologicaldata.jl.  (See src/core/output.jl for details.)","category":"page"},{"location":"architecture.html#Farm-events","page":"Source code architecture","title":"Farm events","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"The FarmEvent struct is used to communicate farming-related events between  submodels. An event can be triggered with createevent! and affects all pixels  within a FarmPlot. (See  src/core/landscape.jl  for details.)","category":"page"},{"location":"architecture.html#Random-numbers-and-logging","page":"Source code architecture","title":"Random numbers and logging","text":"","category":"section"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"By default in Julia, the random number generator (RNG) and the system logger are two globally accessible variables. As Persefone needs to avoid all global data (since this would interfere with reproducibility in parallel runs), the model object stores a  local logger and a local RNG. The local logger generally does not change the way the  model uses log statements, it is  only relevant for some functions in src/core/simulation.jl.","category":"page"},{"location":"architecture.html","page":"Source code architecture","title":"Source code architecture","text":"info: Using the model RNG\nWhenever you need to use a random number,  you must use the model.rng. The easiest way to do this is with the @rand  and @shuffle! macros. (Note that these, too, require access to the model object.)","category":"page"},{"location":"species.html#Species","page":"Species","title":"Species","text":"","category":"section"},{"location":"species.html","page":"Species","title":"Species","text":"The ecological submodel in Persefone simulates a range of species in agricultural landscapes.","category":"page"},{"location":"species.html#Skylark","page":"Species","title":"Skylark","text":"","category":"section"},{"location":"species.html","page":"Species","title":"Species","text":"Modules = [Persefone]\nPages = [\"nature/species/skylark.jl\"]","category":"page"},{"location":"species-dsl.html#Defining-new-species","page":"Defining new species","title":"Defining new species","text":"","category":"section"},{"location":"species-dsl.html#The-Persefone-species-DSL","page":"Defining new species","title":"The Persefone species DSL","text":"","category":"section"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"In order to make implementing new species as easy as possible, Persefone includes a domain-specific language (DSL) built from a collection of macros and functions.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Here is an example of what this looks like, using a hypothetical mermaid species:","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"@species Mermaid begin\n    ageofmaturity = 2\n    pesticidemortality = 1.0\n    @initialise(@habitat(@landcover() == water), pairs=true)\n\t\n    @phase life begin\n        @debug \"$(animalid(animal)) is swimming happily in its pond.\"\n        @respond pesticide @kill(@trait(pesticidemortality), \"poisoning\")\n        @respond harvest @setphase(drought)\n        @debug \"Animal: $animal\"\n        if @trait(sex) == female && @countanimals() < 3 &&\n            @trait(age) >= @trait(ageofmaturity) && @landcover() == water\n            @reproduce()\n        end\n    end\n\t\n    @phase drought begin\n        n = sum(1 for a in @neighbours(0))\n        @debug \"$(animalid(animal)) is experiencing drought with $n neighbour(s).\"\n        @respond sowing @setphase(life)\n    end\nend","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"The two most important macros are @species and @phase,  followed by @initialise, @trait, @respond,  and @habitat. Other macros provide convenience wrappers for common  functions. (See src/nature/nature.jl for details.)","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"The top-level macro is @species. This takes two arguments: a species  name and a definition block (enclosed in begin and end tags). At the start of the definition block, species-specific variables can be defined that should be available throughout a species' lifetime. Code in this section has access to the model object and can thus reference the current model state. In this section, the user also has to call the @initialise macro. This wraps the  Persefone.initpopulation function, and takes a habitat descriptor  (see @habitat below) and several options to specify how the species'  population should be distributed in the landscape during model initialisation.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Following this section, each species must define one or more @phase blocks. The concept behind this is that species show different behaviours at different phases of their lifecycle. Each @phase block defines the behaviour in one of these phases. (Technically, it defines a function that will be called daily, so long as the species' phase variable is set to the name of this phase.) Code in this section has access to the model object as well as an animal object, which is the currently active animal agent. Properties of the animal agent, regardless of whether they were defined by the user or by Persefone, can be accessed using the @trait macro. Within a phase block, @respond  can be used to define the species' response to a FarmEvent that affects  the species' current location, while a variety of other macros provide wrappers to  ecological process functions from src/nature/populations.jl.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Another important macro is @habitat. This defines a \"habitat descriptor\", i.e. a predicate function that tests whether or not a given landscape pixel is  suitable for a specified purpose. Such habitat descriptors are used as arguments to various functions, for example for population initialisation or movement. The argument to @habitat consists of a logical expression, which has access to the animal's current position (the pos tuple variable) and the model. Various macros are available to easily reference information about the current location, such as @landcover or @distancetoedge.","category":"page"},{"location":"species-dsl.html#Implementation-details","page":"Defining new species","title":"Implementation details","text":"","category":"section"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Due to a known performance problem  with multi-agent models, the underlying implementation of species is  rather complicated (see src/nature/nature.jl for details.)","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Rather than creating a new type/struct for each species, all Animal agents have the same type. Instead, they are differentiated by a traits dict, which stores both species-specific parameters and run-time variables. Note that due to a redefinition of the getproperty()/setproperty!() methods, variables from the trait dict can be accessed and modified just like normal struct fields (i.e. although phase is defined in the dict, not the struct, animal.phase = \"newphase\" works just fine - one does not have to use animal.traits[\"phase\"] = \"newphase\".)","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Under the hood, the @species macro generates a function (with the name of the species), which in turn creates the trait dict when called. Thus, adding a new animal agent to the model involves instantiating an Animal object, then calling the relevant species function and attaching the returned dict to the agent object.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Similarly, the @phase macro too works by defining a new function, which is stored in the species' trait dict. These functions take an animal object and the model object as input, and define what the species does during its daily update.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Once again, @habitat creates a function that takes model and pos as input and returns a boolean response. Functions that require a habitat descriptor thus take in this (anonymous) function and call it internally.","category":"page"},{"location":"species-dsl.html","page":"Defining new species","title":"Defining new species","text":"Finally, the @initialise macro is a wrapper around  Persefone.initpopulation, which (yet again) creates a function that  specifies how a species' population is to be initialised at the beginning of a  simulation run. This function is stored in the species trait dict and accessed  during model setup.","category":"page"},{"location":"developing.html#Developing-Persefone","page":"Developing Persefone","title":"Developing Persefone","text":"","category":"section"},{"location":"developing.html#Workflow","page":"Developing Persefone","title":"Workflow","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Pull the current version from the master branch on Gitlab:  https://git.idiv.de/xo30xoqa/persephone.\nIf you are working on a new feature, create a new branch to avoid breaking the master branch. (The master branch on Github should always be in a runnable and error-free state.)\nImplement your changes.\nRun an example simulation and the test suite to make sure everything works without crashing (make run and make test on Linux, or execute run.jl and test/runtests.jl manually.)\nCommit your work frequently, and try to keep each commit small. Don't forget to add relevant tests to the test suite.\nOnce your satisfied with your work, do another pull/merge from the master branch in case somebody else changed the branch in the meantime. Then merge your work into master and push to the Gitlab server.\nRepeat :-)","category":"page"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"The Gitlab issue tracker can be used  to create, discuss, and assign tasks, as well as to monitor progress towards milestones/releases.  Once we have a first release, we will start using semantic versioning.","category":"page"},{"location":"developing.html#Libraries","page":"Developing Persefone","title":"Libraries","text":"","category":"section"},{"location":"developing.html#Agents.jl","page":"Developing Persefone","title":"Agents.jl","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Our model uses Agents.jl as a framework. Their repository can be used to inspect the source code or submit bug reports (the authors are quick to respond). Questions can be asked at the  Julia Discourse forum.","category":"page"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Tutorial on collaborating on Julia packages:  https://www.matecdev.com/posts/julia-package-collaboration.html.","category":"page"},{"location":"developing.html#Revise.jl","page":"Developing Persefone","title":"Revise.jl","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Revise.jl allows one to reload code without restarting the Julia interpreter. Get it with Pkg.add(\"Revise\"), then  add using Revise to .julia/config/startup.jl to have it automatically available.","category":"page"},{"location":"developing.html#Test","page":"Developing Persefone","title":"Test","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"Persefone uses the inbuilt Julia testing framework. All new functions should have appropriate tests written for them in the appropriate file in the test directory. (See test/runtests.jl for details.) There are three ways to run the test suite: in the terminal, executing make test or cd test; julia runtests.jl; or in the Julia REPL,  Pkg.activate(\".\"); Pkg.test().","category":"page"},{"location":"developing.html#Documenter.jl","page":"Developing Persefone","title":"Documenter.jl","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"The HTML documentation is generated using Documenter.jl. Therefore, all new functions should have docstrings attached. New files need to be integrated into the relevant documentation source files in docs/src, and if necessary into docs/builddocs.jl. To build the documentation, run make docs, or cd docs; julia builddocs.jl (if using the latter, don't forget to update the date and commit in docs/src/index.md).","category":"page"},{"location":"developing.html#Julia-editors","page":"Developing Persefone","title":"Julia editors","text":"","category":"section"},{"location":"developing.html#Emacs","page":"Developing Persefone","title":"Emacs","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"There are a couple of addons that make working with Julia much nicer in Emacs:","category":"page"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"julia-mode gives syntax highlighting. Install with M-x package-install julia-mode.\njulia-snail provides IDE-like features,  especially a fully-functional REPL and the ability to evaluate code straight from inside a buffer. Note that the installation can be somewhat tricky. You first need to manually install all the dependencies of its dependency vterm, then install vterm itself with M-x package-install vterm, before you can do M-x package-install julia-snail. Then add it to your init.el with (require 'julia-snail) and (add-hook 'julia-mode-hook #'julia-snail-mode).\ncompany-mode integrates with Snail to give code  completion. Install with M-x package-install company, then add  (add-hook 'julia-mode-hook #'company-mode) and  (global-set-key (kbd \"C-<tab>\") 'company-complete) to your init.el.\nmagit is a great git interface for Emacs. Install with M-x package-install magit and add (global-set-key (kbd \"C-x g\") 'magit-status) to your init.el.","category":"page"},{"location":"developing.html#VSCode","page":"Developing Persefone","title":"VSCode","text":"","category":"section"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"See here.","category":"page"},{"location":"developing.html","page":"Developing Persefone","title":"Developing Persefone","text":"TODO: add more detail.","category":"page"},{"location":"simulation.html#Simulation","page":"Simulation","title":"Simulation","text":"","category":"section"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"The core and world directories hold source files that are important for all submodels,  including scheduling, landscape, weather, and input/output functions.","category":"page"},{"location":"simulation.html#simulation.jl","page":"Simulation","title":"simulation.jl","text":"","category":"section"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"This file includes the basal functions for initialising and running simulations.","category":"page"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"Modules = [Persefone]\nPages = [\"core/simulation.jl\"]","category":"page"},{"location":"simulation.html#Persefone.finalise!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.finalise!","text":"finalise!(model)\n\nWrap up the simulation. Currently doesn't do anything except print some information.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.initialise","page":"Simulation","title":"Persefone.initialise","text":"initialise(config=PARAMFILE, seed=nothing)\n\nInitialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object(s). Optionally allows specifying the configuration file and overriding the seed parameter. This returns a single model object, unless the config file contains multiple values for one or more parameters, in which case it creates a full-factorial simulation experiment and returns a vector of model objects.\n\n\n\n\n\n","category":"function"},{"location":"simulation.html#Persefone.initmodel-Tuple{Dict{String, Any}}","page":"Simulation","title":"Persefone.initmodel","text":"initmodel(settings)\n\nInitialise a model object using a ready-made settings dict. This is a helper function for initialise().\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.paramscan-Tuple{Dict{String, Any}, Vector{String}}","page":"Simulation","title":"Persefone.paramscan","text":"paramscan(settings)\n\nCreate a list of settings dicts, covering all possible parameter combinations given by the input settings (i.e. a full-factorial experiment). This is a helper function for initialise().\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.simulate","page":"Simulation","title":"Persefone.simulate","text":"simulate(config=PARAMFILE, seed=nothing)\n\nInitialise one or more model objects and carry out a full simulation experiment, optionally specifying a configuration file and a seed for the RNG.\n\nThis is the default way to run a Persefone simulation.\n\n\n\n\n\n","category":"function"},{"location":"simulation.html#Persefone.simulate!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.simulate!","text":"simulate!(model)\n\nCarry out a complete simulation run using a pre-initialised model object.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.stepsimulation!","text":"stepsimulation!(model)\n\nExecute one update of the model.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#landscape.jl","page":"Simulation","title":"landscape.jl","text":"","category":"section"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"This file manages the landscape maps that underlie the model.","category":"page"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"Modules = [Persefone]\nPages = [\"world/landscape.jl\"]","category":"page"},{"location":"simulation.html#Persefone.EventType","page":"Simulation","title":"Persefone.EventType","text":"The types of landscape event that can be simulated\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.FarmEvent","page":"Simulation","title":"Persefone.FarmEvent","text":"FarmEvent\n\nA data structure to define a landscape event, giving its type, spatial extent, and duration.\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.LandCover","page":"Simulation","title":"Persefone.LandCover","text":"The land cover classes encoded in the Mundialis Sentinel data.\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.Pixel","page":"Simulation","title":"Persefone.Pixel","text":"Pixel\n\nA pixel is a simple data structure to combine land use and ownership information in a single object. The model landscape consists of a matrix of pixels. (Note: further landscape information may be added here in future.)\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.createevent!","page":"Simulation","title":"Persefone.createevent!","text":"createevent!(model, pixels, name, duration=1)\n\nAdd a farm event to the specified pixels (a vector of position tuples) for a given duration.\n\n\n\n\n\n","category":"function"},{"location":"simulation.html#Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}","page":"Simulation","title":"Persefone.distanceto","text":"distanceto(pos, model, habitatdescriptor)\n\nCalculate the distance from the given location to the closest location matching the habitat descriptor function. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persefone.LandCover}","page":"Simulation","title":"Persefone.distanceto","text":"distanceto(pos, model, habitattype)\n\nCalculate the distance from the given location to the closest habitat of the specified type. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.distancetoedge","text":"distancetoedge(pos, model)\n\nCalculate the distance from the given location to the closest neighbouring habitat. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.farmplot","text":"farmplot(position, model)\n\nReturn the farm plot at this position, or nothing if there is none (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.initlandscape-Tuple{String, String}","page":"Simulation","title":"Persefone.initlandscape","text":"initlandscape(landcovermap, farmfieldsmap)\n\nInitialise the model landscape based on the map files specified in the configuration. Returns a matrix of pixels.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.landcover","text":"landcover(position, model)\n\nReturn the land cover class at this position (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.updateevents!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.updateevents!","text":"updateevents!(model)\n\nCycle through the list of events, removing those that have expired.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#weather.jl","page":"Simulation","title":"weather.jl","text":"","category":"section"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"This file reads in weather data and makes it available to the model.","category":"page"},{"location":"simulation.html","page":"Simulation","title":"Simulation","text":"Modules = [Persefone]\nPages = [\"world/weather.jl\"]","category":"page"},{"location":"simulation.html#Persefone.Weather","page":"Simulation","title":"Persefone.Weather","text":"Weather\n\nA single weather datum, combining the observations from one day.\n\n\n\n\n\n","category":"type"},{"location":"simulation.html#Persefone.initweather-Tuple{String, Dates.Date, Dates.Date}","page":"Simulation","title":"Persefone.initweather","text":"initweather(weatherfile, startdate, enddate)\n\nLoad a weather file, extract the values that are relevant to this model run (specified by start and end dates), and return a dictionary of Weather objects mapped to dates.\n\nNote: This requires a weather file in the format produced by data/extract_weather_data.R.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.maxtemp-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.maxtemp","text":"maxtemp(model)\n\nReturn today's maximum temperature in °C.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.meantemp-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.meantemp","text":"meantemp(model)\n\nReturn today's mean temperature in °C.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.mintemp-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.mintemp","text":"mintemp(model)\n\nReturn today's minimum temperature in °C.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.precipitation-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.precipitation","text":"precipitation(model)\n\nReturn today's total precipitation in mm.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.sunshine-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.sunshine","text":"sunshine(model)\n\nReturn today's sunshine duration in hours.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.vapourpressure-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.vapourpressure","text":"vapourpressure(model)\n\nReturn today's average vapour pressure in hPa.\n\n\n\n\n\n","category":"method"},{"location":"simulation.html#Persefone.windspeed-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persefone.windspeed","text":"windspeed(model)\n\nReturn today's average windspeed in m/s.\n\n\n\n\n\n","category":"method"},{"location":"farm.html#Farm-submodel","page":"Farm submodel","title":"Farm submodel","text":"","category":"section"},{"location":"farm.html","page":"Farm submodel","title":"Farm submodel","text":"Eventually, the aim is to create a full socio-economic farm decision model for Persefone. However, for the time being, we will restrict ourselves to a simple model that executes typical farm operations and crop rotations.","category":"page"},{"location":"farm.html#farm.jl","page":"Farm submodel","title":"farm.jl","text":"","category":"section"},{"location":"farm.html","page":"Farm submodel","title":"Farm submodel","text":"This file is responsible for managing the farm module(s).","category":"page"},{"location":"farm.html","page":"Farm submodel","title":"Farm submodel","text":"Modules = [Persefone]\nPages = [\"farm/farm.jl\"]","category":"page"},{"location":"farm.html#Persefone.Farmer","page":"Farm submodel","title":"Persefone.Farmer","text":"Farmer\n\nThis is the agent type for the farm ABM. (Not yet implemented.)\n\n\n\n\n\n","category":"type"},{"location":"farm.html#Persefone.initfarms!-Tuple{Agents.AgentBasedModel}","page":"Farm submodel","title":"Persefone.initfarms!","text":"initfarms!(model)\n\nInitialise the model with a set of farm agents.\n\n\n\n\n\n","category":"method"},{"location":"farm.html#Persefone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}","page":"Farm submodel","title":"Persefone.stepagent!","text":"stepagent!(farmer, model)\n\nUpdate a farmer by one day.\n\n\n\n\n\n","category":"method"},{"location":"adapting.html#Adapting-Persefone","page":"Adapting Persefone","title":"Adapting Persefone","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"A key development goal of Persefone is to be FAIR: findable, accessible, interoperable, and reusable. We aim to build a model that is both easy  to use and easy to adapt to new situations.","category":"page"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"There are multiple ways to adapt Persefone for a new modelling study:","category":"page"},{"location":"adapting.html#Changing-the-parameters","page":"Adapting Persefone","title":"Changing the parameters","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"The simplest way to adapt Persefone is simply by changing the parameters. Copy src/parameters.toml to a new location, adjust it to your needs, and run the model using julia run.jl -c <configfile>.","category":"page"},{"location":"adapting.html#Changing-the-region","page":"Adapting Persefone","title":"Changing the region","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"To apply Persefone to a new region, you need to create new input maps of land cover and farmplots. How to do so is described here.","category":"page"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"You may also need to change aspects of the farm submodel. This is not yet implemented.","category":"page"},{"location":"adapting.html#Adding-new-animal-species","page":"Adapting Persefone","title":"Adding new animal species","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"To implement a new species to the nature submodel, add a new file to the  src/nature/species directory and include it in src/Persefone.jl, as well as adding the name of the species to the nature.targetspecies parameter. In the new file, implement the species using the @species syntax as described here.","category":"page"},{"location":"adapting.html#Adding-new-crop-species","page":"Adapting Persefone","title":"Adding new crop species","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"Crop growth is not yet implemented.","category":"page"},{"location":"adapting.html#Adding-new-farmer-behaviour","page":"Adapting Persefone","title":"Adding new farmer behaviour","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"Farmer behaviour is not yet implemented.","category":"page"},{"location":"adapting.html#Adding-a-new-submodel","page":"Adapting Persefone","title":"Adding a new submodel","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"To add a new submodel in addition to the existing ones (nature, crop, and farm), you need to familiarise yourself with the software architecture. In particular, you need to understand how initialisation and scheduling works in src/core/simulation.jl, and what information is stored in the model object.","category":"page"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"If you want to add a new agent type, use Agents.jl's  @agent macro. (But be aware that Persefone already has three agent types and you may encounter performance problems.) Having implemented the new agent type, add it to the model objects type definition and scheduler, and write an initialisation function and a stepagent! function. (See Persefone.initmodel and stepsimulation! for details.)","category":"page"},{"location":"adapting.html#Linking-to-another-model","page":"Adapting Persefone","title":"Linking to another model","text":"","category":"section"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"Persefone can also be used as a software library and be called from another application. For this purpose, it is set up as a Julia package, with a module exporting various model functions, types, and macros (see  src/Persefone.jl). Of particular interest are the functions simulate (set up and run a complete simulation based on a config file), initialise (create one or more model objects from a config file), simulate! (do a simulation run with an existing model object), and stepsimulation! (update a model object by one time step).","category":"page"},{"location":"adapting.html","page":"Adapting Persefone","title":"Adapting Persefone","text":"To interface with Julia from another language, see the Julia docs here and here.","category":"page"},{"location":"odd.html#Overview,-Design,-Details-(ODD)","page":"Overview, Design, Details (ODD)","title":"Overview, Design, Details (ODD)","text":"","category":"section"},{"location":"odd.html","page":"Overview, Design, Details (ODD)","title":"Overview, Design, Details (ODD)","text":"TODO","category":"page"},{"location":"gis.html#Maps-and-weather-data","page":"Maps and weather data","title":"Maps and weather data","text":"","category":"section"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Persefone currently requires two separate map input files: one for land cover, the other for field geometry. Additionally, a weather input file is needed.  This documents describe how to obtain and process the data needed for each  of these.","category":"page"},{"location":"gis.html#Land-cover-maps","page":"Maps and weather data","title":"Land cover maps","text":"","category":"section"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Land cover maps for Germany at 10m resolution can be obtained from  Mundialis. These are generated annually from Sentinel data and comprise the following  land cover classes:","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"10: forest\n20: low vegetation\n30: water\n40: built-up\n50: bare soil\n60: agriculture","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"To create a Persefone map input file, you need to crop the national Mundialis map to the extent that you want to simulate (suggestion: approx. 10x10km is a  reasonable size).","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"To do so, download the Mundialis map and import it into QGIS. Then create a new vector layer and create a rectangle feature to delimit the extent of your region. Then go to Raster -> Extraction -> Clip Raster by Extent. Select the Mundialis map as the input layer, set the clipping extent by choosing your region vector layer under Calculate from Layer and specify the output file name before clicking Run. This will generate a TIF file that you can pass to Persefone as the landcovermap parameter.","category":"page"},{"location":"gis.html#Field-ID-maps","page":"Maps and weather data","title":"Field ID maps","text":"","category":"section"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"In addition to the land cover data explained above, Persefone also needs information about agricultural field boundaries in order to assign these to the farming agents. Unfortunately, getting this is rather more complicated.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"In the EU, every country runs a Land Parcel Information System (LPIS) to administer CAP payments. In Germany, this is called InVeKoS and is run by the Länder. For example, you can view and download the InVeKoS data for Thüringen here. This gives you a vector layer which can be loaded into QGIS. However, it needs to be converted to a raster layer and cropped to your region extent before it can be used in Persefone.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"The first thing to do is to make sure that the vector layer has a numeric (!) field with a unique identifier for each field block (check the attribute table).  The Thüringen data has the FBI (\"Feldblockident\") field, but this is a string value and therefore not usable by the rasteriser. So, we set the vector layer to edit mode, open the field calculator, enter the information for a new field  (call it \"FID\" and set it to a 32-bit integer), and enter @row_number in the  expression field. Then save the layer and close the calculator.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Secondly, you need to filter out all non-field/non-grassland plot types. (LPIS also has data on forests and various landscape elements that are not relevant to our use case.) Assuming you're working with the Thüringen InVeKoS data (other data sets may have a different structure), right-click on the layer name in QGIS' layer overview and click on \"Filter...\". Then, enter this expression in the query builder: \"BNK\" = 'AL' OR \"BNK\" = 'GL' and click \"OK\". This will select only field and grassland plots.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Next, open the rasteriser (Raster -> Conversion -> Rasterize). Select your FID field as the \"Field to use for a burn-in value\", and your land cover map (as created above - this ensures the two layers match) as the output extent. Make sure  the \"fixed value to burn\" is \"Not set\". Then choose \"Georeferenced units\" as the  \"Out raster size units\" and set horizontal and vertical resolution to 10.0. In  the advanced parameters, set the output data type to UInt32. Finally, enter an  output file name and run. The resulting TIF file can be passed to Persefone as the farmfieldmap parameter.","category":"page"},{"location":"gis.html#Weather-data","page":"Maps and weather data","title":"Weather data","text":"","category":"section"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Currently, Persefone uses historical weather data from the closes weather station as its weather input. (In future, this may be changed to a more detailed raster input, which could then also provide future weather predictions under climate change.) Weather data can be downloaded from the German weather service (DWD). The relevant data are in the folder daily/kl/historical.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"The description of this data set and the list of weather stations can be found in the Persefone repository, in the docs folder (or downloaded from the link above). Using the list of weather stations, select the one closest to the area of study. Note that not all stations were continuously in operation; make sure that the selected station covers the years of interest.","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Region Jena: station number 02444 (\"Jena (Sternwarte)\")\nRegion Eichsfeld:\nRegion Thüringer Becken:\nRegion Hohenlohe:\nRegion Bodensee:\nRegion Nördlicher Oberrhein:","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"From the link above, download the ZIP file associated with the station number. Check the included meta-data if there is any important missing data, or other relevant information (e.g. the station moved position).","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Then use data/extract_weather_data.R to process the data into the format needed by Persefone:","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"library(tidyverse)\n\n## replace this with the correct file name\nweatherfile = \"produkt_klima_tag_18210101_20221231_02444.txt\"\n\ndata = read.table(weatherfile, sep=\";\", header=T)\n\nweather = data %>%\n    ## drop values before 2000 to save space\n    filter(MESS_DATUM>=20000101) %>%\n    ## select relevant variables and convert place-holder values to NA\n    select(MESS_DATUM, FM, RSK, SDK, VPM, TMK, TXK, TNK) %>%\n    mutate(date=MESS_DATUM, MESS_DATUM=NULL,\n           mean_windspeed=na_if(FM, -999), FM=NULL,\n           precipitation=na_if(RSK, -999), RSK=NULL,\n           sunshine_hours=na_if(SDK, -999), SDK=NULL,\n           mean_vapour_pressure=na_if(VPM, -999), VPM=NULL,\n           mean_temperature=na_if(TMK, -999), TMK=NULL,\n           max_temperature=na_if(TXK, -999), TXK=NULL,\n           min_temperature=na_if(TNK, -999), TNK=NULL)\n\n## replace with the desired file name\nwrite.csv(weather, file=\"weather_jena.csv\", row.names=FALSE)","category":"page"},{"location":"gis.html","page":"Maps and weather data","title":"Maps and weather data","text":"Note: for calculating the reference evapotranspiration ET_0 (needed for the AquaCrop model),  use the FAO Penman-Monteith equation.","category":"page"},{"location":"crops.html#Crop-submodel","page":"Crop submodel","title":"Crop submodel","text":"","category":"section"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"Eventually, the plan is to have Persefone include a reimplementation of the AquaCrop model,  a well-established crop growth model developed by the FAO. Until then, we are using the crop growth submodel used in ALMaSS.","category":"page"},{"location":"crops.html#farmplot.jl","page":"Crop submodel","title":"farmplot.jl","text":"","category":"section"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"This file is responsible for the farm plots, i.e. the indidivual fields that farmers manage.","category":"page"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"Modules = [Persefone]\nPages = [\"crop/farmplot.jl\"]","category":"page"},{"location":"crops.html#Persefone.FarmPlot","page":"Crop submodel","title":"Persefone.FarmPlot","text":"FarmPlot\n\nThis represents one field, i.e. a collection of pixels with the same management. This is the spatial unit with which the crop growth model and the farm model work.\n\n\n\n\n\n","category":"type"},{"location":"crops.html#Persefone.averagefieldsize-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.averagefieldsize","text":"averagefieldsize(model)\n\nCalculate the average field size in hectares for the model landscape.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.cropheight","text":"cropheight(model, position)\n\nReturn the height of the crop at this position, or nothing if there is no crop here (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.cropname-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.cropname","text":"cropname(model, position)\n\nReturn the name of the crop at this position, or nothing if there is no crop here (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.croptype","text":"croptype(model, position)\n\nReturn the crop at this position, or nothing if there is no crop here (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.growcrop!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.growcrop!","text":"growcrop!(farmplot, model)\n\nApply the relevant crop growth model to update the plants on this farm plot. Currently only supports the ALMaSS crop growth model by Topping et al.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.harvest!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.harvest!","text":"harvest!(farmplot, model)\n\nHarvest the crop on this farmplot.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.initfields!-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.initfields!","text":"initfields!(model)\n\nInitialise the model with its farm plots.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.sow!-Tuple{String, FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.sow!","text":"sow!(cropname, farmplot, model)\n\nSow the specified crop on this farmplot.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persefone.stepagent!","text":"stepagent!(farmplot, model)\n\nUpdate a farm plot by one day.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#crops.jl","page":"Crop submodel","title":"crops.jl","text":"","category":"section"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"This includes the types and functions needed for all crop growth model, which are also referenced by the other submodels.","category":"page"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"Modules = [Persefone]\nPages = [\"crop/crops.jl\"]","category":"page"},{"location":"crops.html#Persefone.CropCurveParams","page":"Crop submodel","title":"Persefone.CropCurveParams","text":"CropCurveParams\n\nThe values in this struct define one crop growth curve.\n\n\n\n\n\n","category":"type"},{"location":"crops.html#Persefone.CropType","page":"Crop submodel","title":"Persefone.CropType","text":"CropType\n\nThe type struct for all crops. Currently follows the crop growth model as implemented in ALMaSS.\n\n\n\n\n\n","category":"type"},{"location":"crops.html#Persefone.GrowthPhase","page":"Crop submodel","title":"Persefone.GrowthPhase","text":"GrowthPhase\n\nALMaSS crop growth curves are split into five phases, triggered by seasonal dates or agricultural events.\n\n\n\n\n\n","category":"type"},{"location":"crops.html#Base.tryparse-Tuple{Type{Persefone.GrowthPhase}, String}","page":"Crop submodel","title":"Base.tryparse","text":"Base.tryparse(type, str)\n\nExtend tryparse to allow parsing GrowthPhase values. (Needed to read in the CSV parameter file.)\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.buildgrowthcurve-Tuple{Vector{CSV.Row}}","page":"Crop submodel","title":"Persefone.buildgrowthcurve","text":"buildgrowthcurve(data)\n\nConvert a list of rows from the crop growth data into a CropCurveParams object.\n\n\n\n\n\n","category":"method"},{"location":"crops.html#Persefone.readcropparameters-Tuple{String, String}","page":"Crop submodel","title":"Persefone.readcropparameters","text":"readcropparameters(generalcropfile, cropgrowthfile)\n\nParse a CSV file containing the required parameter values for each crop (as produced from the original ALMaSS file by convert_almass_data.py).\n\n\n\n\n\n","category":"method"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"CurrentModule = Persefone","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"(Image: Persefone.jl splash screen)","category":"page"},{"location":"index.html#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Persefone.jl models agricultural practice and how it impacts  animal species at a landscape scale. It includes a farm submodel, a crop growth submodel,  and individual-based models of multiple indicator species. Its aim is to investigate how  changes in farm operations (e.g. through policy changes in the CAP) influence biodiversity.","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"The model is open-source software available on  Gitlab.","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Last updated: 2023-10-27 (commit 261d20b)","category":"page"}]
 }
diff --git a/docs/build/simulation.html b/docs/build/simulation.html
index 3b1a03e..381e6d6 100644
--- a/docs/build/simulation.html
+++ b/docs/build/simulation.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Simulation · Persefone</title><meta name="title" content="Simulation · Persefone"/><meta property="og:title" content="Simulation · Persefone"/><meta property="twitter:title" content="Simulation · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li class="is-active"><a class="tocitem" href="simulation.html">Simulation</a><ul class="internal"><li><a class="tocitem" href="#simulation.jl"><span>simulation.jl</span></a></li><li><a class="tocitem" href="#landscape.jl"><span>landscape.jl</span></a></li><li><a class="tocitem" href="#weather.jl"><span>weather.jl</span></a></li></ul></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Core</a></li><li class="is-active"><a href="simulation.html">Simulation</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="simulation.html">Simulation</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/simulation.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Simulation"><a class="docs-heading-anchor" href="#Simulation">Simulation</a><a id="Simulation-1"></a><a class="docs-heading-anchor-permalink" href="#Simulation" title="Permalink"></a></h1><p>The <code>core</code> and <code>world</code> directories hold source files that are important for all submodels,  including scheduling, landscape, weather, and input/output functions.</p><h2 id="simulation.jl"><a class="docs-heading-anchor" href="#simulation.jl">simulation.jl</a><a id="simulation.jl-1"></a><a class="docs-heading-anchor-permalink" href="#simulation.jl" title="Permalink"></a></h2><p>This file includes the basal functions for initialising and running simulations.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.finalise!-Tuple{Agents.AgentBasedModel}" href="#Persefone.finalise!-Tuple{Agents.AgentBasedModel}"><code>Persefone.finalise!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">finalise!(model)</code></pre><p>Wrap up the simulation. Currently doesn&#39;t do anything except print some information.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/simulation.jl#L144-L148">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initialise" href="#Persefone.initialise"><code>Persefone.initialise</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">initialise(config=PARAMFILE, seed=nothing)</code></pre><p>Initialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object(s). Optionally allows specifying the configuration file and overriding the <code>seed</code> parameter. This returns a single model object, unless the config file contains multiple values for one or more parameters, in which case it creates a full-factorial simulation experiment and returns a vector of model objects.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/simulation.jl#L35-L44">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initmodel-Tuple{Dict{String, Any}}" href="#Persefone.initmodel-Tuple{Dict{String, Any}}"><code>Persefone.initmodel</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initmodel(settings)</code></pre><p>Initialise a model object using a ready-made settings dict. This is a helper function for <code>initialise()</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/simulation.jl#L54-L59">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.paramscan-Tuple{Dict{String, Any}, Vector{String}}" href="#Persefone.paramscan-Tuple{Dict{String, Any}, Vector{String}}"><code>Persefone.paramscan</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">paramscan(settings)</code></pre><p>Create a list of settings dicts, covering all possible parameter combinations given by the input settings (i.e. a full-factorial experiment). This is a helper function for <code>initialise()</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/simulation.jl#L93-L99">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.simulate" href="#Persefone.simulate"><code>Persefone.simulate</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">simulate(config=PARAMFILE, seed=nothing)</code></pre><p>Initialise one or more model objects and carry out a full simulation experiment, optionally specifying a configuration file and a seed for the RNG.</p><p>This is the default way to run a Persefone simulation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/simulation.jl#L8-L15">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.simulate!-Tuple{Agents.AgentBasedModel}" href="#Persefone.simulate!-Tuple{Agents.AgentBasedModel}"><code>Persefone.simulate!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">simulate!(model)</code></pre><p>Carry out a complete simulation run using a pre-initialised model object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/simulation.jl#L23-L27">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}" href="#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>Persefone.stepsimulation!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">stepsimulation!(model)</code></pre><p>Execute one update of the model.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/core/simulation.jl#L121-L125">source</a></section></article><h2 id="landscape.jl"><a class="docs-heading-anchor" href="#landscape.jl">landscape.jl</a><a id="landscape.jl-1"></a><a class="docs-heading-anchor-permalink" href="#landscape.jl" title="Permalink"></a></h2><p>This file manages the landscape maps that underlie the model.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.EventType" href="#Persefone.EventType"><code>Persefone.EventType</code></a> — <span class="docstring-category">Type</span></header><section><div><p>The types of landscape event that can be simulated</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.FarmEvent" href="#Persefone.FarmEvent"><code>Persefone.FarmEvent</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">FarmEvent</code></pre><p>A data structure to define a landscape event, giving its type, spatial extent, and duration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L26-L31">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.LandCover" href="#Persefone.LandCover"><code>Persefone.LandCover</code></a> — <span class="docstring-category">Type</span></header><section><div><p>The land cover classes encoded in the Mundialis Sentinel data.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L6">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.Pixel" href="#Persefone.Pixel"><code>Persefone.Pixel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Pixel</code></pre><p>A pixel is a simple data structure to combine land use and ownership information in a single object. The model landscape consists of a matrix of pixels. (Note: further landscape information may be added here in future.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L13-L19">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.createevent!" href="#Persefone.createevent!"><code>Persefone.createevent!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">createevent!(model, pixels, name, duration=1)</code></pre><p>Add a farm event to the specified pixels (a vector of position tuples) for a given duration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L89-L93">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}" href="#Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}"><code>Persefone.distanceto</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">distanceto(pos, model, habitatdescriptor)</code></pre><p>Calculate the distance from the given location to the closest location matching the habitat descriptor function. Caution: can be computationally expensive!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L122-L127">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persefone.LandCover}" href="#Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persefone.LandCover}"><code>Persefone.distanceto</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">distanceto(pos, model, habitattype)</code></pre><p>Calculate the distance from the given location to the closest habitat of the specified type. Caution: can be computationally expensive!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L156-L161">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.distancetoedge</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">distancetoedge(pos, model)</code></pre><p>Calculate the distance from the given location to the closest neighbouring habitat. Caution: can be computationally expensive!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L167-L172">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.farmplot</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">farmplot(position, model)</code></pre><p>Return the farm plot at this position, or nothing if there is none (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L111-L115">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initlandscape-Tuple{String, String}" href="#Persefone.initlandscape-Tuple{String, String}"><code>Persefone.initlandscape</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initlandscape(landcovermap, farmfieldsmap)</code></pre><p>Initialise the model landscape based on the map files specified in the configuration. Returns a matrix of pixels.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L38-L43">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.landcover</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">landcover(position, model)</code></pre><p>Return the land cover class at this position (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L102-L106">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.updateevents!-Tuple{Agents.AgentBasedModel}" href="#Persefone.updateevents!-Tuple{Agents.AgentBasedModel}"><code>Persefone.updateevents!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">updateevents!(model)</code></pre><p>Cycle through the list of events, removing those that have expired.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/landscape.jl#L68-L72">source</a></section></article><h2 id="weather.jl"><a class="docs-heading-anchor" href="#weather.jl">weather.jl</a><a id="weather.jl-1"></a><a class="docs-heading-anchor-permalink" href="#weather.jl" title="Permalink"></a></h2><p>This file reads in weather data and makes it available to the model.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.Weather" href="#Persefone.Weather"><code>Persefone.Weather</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Weather</code></pre><p>A single weather datum, combining the observations from one day.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L7-L11">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initweather-Tuple{String, Dates.Date, Dates.Date}" href="#Persefone.initweather-Tuple{String, Dates.Date, Dates.Date}"><code>Persefone.initweather</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initweather(weatherfile, startdate, enddate)</code></pre><p>Load a weather file, extract the values that are relevant to this model run (specified by start and end dates), and return a dictionary of Weather objects mapped to dates.</p><p><strong>Note:</strong> This requires a weather file in the format produced by <code>data/extract_weather_data.R</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L22-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.maxtemp-Tuple{Agents.AgentBasedModel}" href="#Persefone.maxtemp-Tuple{Agents.AgentBasedModel}"><code>Persefone.maxtemp</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">maxtemp(model)</code></pre><p>Return today&#39;s maximum temperature in °C.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L96-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.meantemp-Tuple{Agents.AgentBasedModel}" href="#Persefone.meantemp-Tuple{Agents.AgentBasedModel}"><code>Persefone.meantemp</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">meantemp(model)</code></pre><p>Return today&#39;s mean temperature in °C.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L87-L91">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.mintemp-Tuple{Agents.AgentBasedModel}" href="#Persefone.mintemp-Tuple{Agents.AgentBasedModel}"><code>Persefone.mintemp</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">mintemp(model)</code></pre><p>Return today&#39;s minimum temperature in °C.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L105-L109">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.precipitation-Tuple{Agents.AgentBasedModel}" href="#Persefone.precipitation-Tuple{Agents.AgentBasedModel}"><code>Persefone.precipitation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">precipitation(model)</code></pre><p>Return today&#39;s total precipitation in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L60-L64">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.sunshine-Tuple{Agents.AgentBasedModel}" href="#Persefone.sunshine-Tuple{Agents.AgentBasedModel}"><code>Persefone.sunshine</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">sunshine(model)</code></pre><p>Return today&#39;s sunshine duration in hours.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L69-L73">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.vapourpressure-Tuple{Agents.AgentBasedModel}" href="#Persefone.vapourpressure-Tuple{Agents.AgentBasedModel}"><code>Persefone.vapourpressure</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">vapourpressure(model)</code></pre><p>Return today&#39;s average vapour pressure in hPa.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L78-L82">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.windspeed-Tuple{Agents.AgentBasedModel}" href="#Persefone.windspeed-Tuple{Agents.AgentBasedModel}"><code>Persefone.windspeed</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">windspeed(model)</code></pre><p>Return today&#39;s average windspeed in m/s.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/9f4a9c777256d559050218f2a4e156fa70c8b31f/src/world/weather.jl#L51-L55">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="species-dsl.html">« Defining new species</a><a class="docs-footer-nextpage" href="io.html">Input and Output »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Simulation · Persefone</title><meta name="title" content="Simulation · Persefone"/><meta property="og:title" content="Simulation · Persefone"/><meta property="twitter:title" content="Simulation · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li class="is-active"><a class="tocitem" href="simulation.html">Simulation</a><ul class="internal"><li><a class="tocitem" href="#simulation.jl"><span>simulation.jl</span></a></li><li><a class="tocitem" href="#landscape.jl"><span>landscape.jl</span></a></li><li><a class="tocitem" href="#weather.jl"><span>weather.jl</span></a></li></ul></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Core</a></li><li class="is-active"><a href="simulation.html">Simulation</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="simulation.html">Simulation</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/simulation.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Simulation"><a class="docs-heading-anchor" href="#Simulation">Simulation</a><a id="Simulation-1"></a><a class="docs-heading-anchor-permalink" href="#Simulation" title="Permalink"></a></h1><p>The <code>core</code> and <code>world</code> directories hold source files that are important for all submodels,  including scheduling, landscape, weather, and input/output functions.</p><h2 id="simulation.jl"><a class="docs-heading-anchor" href="#simulation.jl">simulation.jl</a><a id="simulation.jl-1"></a><a class="docs-heading-anchor-permalink" href="#simulation.jl" title="Permalink"></a></h2><p>This file includes the basal functions for initialising and running simulations.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.finalise!-Tuple{Agents.AgentBasedModel}" href="#Persefone.finalise!-Tuple{Agents.AgentBasedModel}"><code>Persefone.finalise!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">finalise!(model)</code></pre><p>Wrap up the simulation. Currently doesn&#39;t do anything except print some information.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/simulation.jl#L144-L148">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initialise" href="#Persefone.initialise"><code>Persefone.initialise</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">initialise(config=PARAMFILE, seed=nothing)</code></pre><p>Initialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object(s). Optionally allows specifying the configuration file and overriding the <code>seed</code> parameter. This returns a single model object, unless the config file contains multiple values for one or more parameters, in which case it creates a full-factorial simulation experiment and returns a vector of model objects.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/simulation.jl#L35-L44">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initmodel-Tuple{Dict{String, Any}}" href="#Persefone.initmodel-Tuple{Dict{String, Any}}"><code>Persefone.initmodel</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initmodel(settings)</code></pre><p>Initialise a model object using a ready-made settings dict. This is a helper function for <code>initialise()</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/simulation.jl#L54-L59">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.paramscan-Tuple{Dict{String, Any}, Vector{String}}" href="#Persefone.paramscan-Tuple{Dict{String, Any}, Vector{String}}"><code>Persefone.paramscan</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">paramscan(settings)</code></pre><p>Create a list of settings dicts, covering all possible parameter combinations given by the input settings (i.e. a full-factorial experiment). This is a helper function for <code>initialise()</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/simulation.jl#L93-L99">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.simulate" href="#Persefone.simulate"><code>Persefone.simulate</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">simulate(config=PARAMFILE, seed=nothing)</code></pre><p>Initialise one or more model objects and carry out a full simulation experiment, optionally specifying a configuration file and a seed for the RNG.</p><p>This is the default way to run a Persefone simulation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/simulation.jl#L8-L15">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.simulate!-Tuple{Agents.AgentBasedModel}" href="#Persefone.simulate!-Tuple{Agents.AgentBasedModel}"><code>Persefone.simulate!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">simulate!(model)</code></pre><p>Carry out a complete simulation run using a pre-initialised model object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/simulation.jl#L23-L27">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}" href="#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>Persefone.stepsimulation!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">stepsimulation!(model)</code></pre><p>Execute one update of the model.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/core/simulation.jl#L121-L125">source</a></section></article><h2 id="landscape.jl"><a class="docs-heading-anchor" href="#landscape.jl">landscape.jl</a><a id="landscape.jl-1"></a><a class="docs-heading-anchor-permalink" href="#landscape.jl" title="Permalink"></a></h2><p>This file manages the landscape maps that underlie the model.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.EventType" href="#Persefone.EventType"><code>Persefone.EventType</code></a> — <span class="docstring-category">Type</span></header><section><div><p>The types of landscape event that can be simulated</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.FarmEvent" href="#Persefone.FarmEvent"><code>Persefone.FarmEvent</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">FarmEvent</code></pre><p>A data structure to define a landscape event, giving its type, spatial extent, and duration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L26-L31">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.LandCover" href="#Persefone.LandCover"><code>Persefone.LandCover</code></a> — <span class="docstring-category">Type</span></header><section><div><p>The land cover classes encoded in the Mundialis Sentinel data.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L6">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.Pixel" href="#Persefone.Pixel"><code>Persefone.Pixel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Pixel</code></pre><p>A pixel is a simple data structure to combine land use and ownership information in a single object. The model landscape consists of a matrix of pixels. (Note: further landscape information may be added here in future.)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L13-L19">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.createevent!" href="#Persefone.createevent!"><code>Persefone.createevent!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">createevent!(model, pixels, name, duration=1)</code></pre><p>Add a farm event to the specified pixels (a vector of position tuples) for a given duration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L89-L93">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}" href="#Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}"><code>Persefone.distanceto</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">distanceto(pos, model, habitatdescriptor)</code></pre><p>Calculate the distance from the given location to the closest location matching the habitat descriptor function. Caution: can be computationally expensive!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L122-L127">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persefone.LandCover}" href="#Persefone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persefone.LandCover}"><code>Persefone.distanceto</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">distanceto(pos, model, habitattype)</code></pre><p>Calculate the distance from the given location to the closest habitat of the specified type. Caution: can be computationally expensive!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L156-L161">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.distancetoedge</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">distancetoedge(pos, model)</code></pre><p>Calculate the distance from the given location to the closest neighbouring habitat. Caution: can be computationally expensive!</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L167-L172">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.farmplot</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">farmplot(position, model)</code></pre><p>Return the farm plot at this position, or nothing if there is none (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L111-L115">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initlandscape-Tuple{String, String}" href="#Persefone.initlandscape-Tuple{String, String}"><code>Persefone.initlandscape</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initlandscape(landcovermap, farmfieldsmap)</code></pre><p>Initialise the model landscape based on the map files specified in the configuration. Returns a matrix of pixels.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L38-L43">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persefone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persefone.landcover</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">landcover(position, model)</code></pre><p>Return the land cover class at this position (utility wrapper).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L102-L106">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.updateevents!-Tuple{Agents.AgentBasedModel}" href="#Persefone.updateevents!-Tuple{Agents.AgentBasedModel}"><code>Persefone.updateevents!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">updateevents!(model)</code></pre><p>Cycle through the list of events, removing those that have expired.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/landscape.jl#L68-L72">source</a></section></article><h2 id="weather.jl"><a class="docs-heading-anchor" href="#weather.jl">weather.jl</a><a id="weather.jl-1"></a><a class="docs-heading-anchor-permalink" href="#weather.jl" title="Permalink"></a></h2><p>This file reads in weather data and makes it available to the model.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.Weather" href="#Persefone.Weather"><code>Persefone.Weather</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Weather</code></pre><p>A single weather datum, combining the observations from one day.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L7-L11">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.initweather-Tuple{String, Dates.Date, Dates.Date}" href="#Persefone.initweather-Tuple{String, Dates.Date, Dates.Date}"><code>Persefone.initweather</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initweather(weatherfile, startdate, enddate)</code></pre><p>Load a weather file, extract the values that are relevant to this model run (specified by start and end dates), and return a dictionary of Weather objects mapped to dates.</p><p><strong>Note:</strong> This requires a weather file in the format produced by <code>data/extract_weather_data.R</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L22-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.maxtemp-Tuple{Agents.AgentBasedModel}" href="#Persefone.maxtemp-Tuple{Agents.AgentBasedModel}"><code>Persefone.maxtemp</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">maxtemp(model)</code></pre><p>Return today&#39;s maximum temperature in °C.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L96-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.meantemp-Tuple{Agents.AgentBasedModel}" href="#Persefone.meantemp-Tuple{Agents.AgentBasedModel}"><code>Persefone.meantemp</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">meantemp(model)</code></pre><p>Return today&#39;s mean temperature in °C.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L87-L91">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.mintemp-Tuple{Agents.AgentBasedModel}" href="#Persefone.mintemp-Tuple{Agents.AgentBasedModel}"><code>Persefone.mintemp</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">mintemp(model)</code></pre><p>Return today&#39;s minimum temperature in °C.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L105-L109">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.precipitation-Tuple{Agents.AgentBasedModel}" href="#Persefone.precipitation-Tuple{Agents.AgentBasedModel}"><code>Persefone.precipitation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">precipitation(model)</code></pre><p>Return today&#39;s total precipitation in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L60-L64">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.sunshine-Tuple{Agents.AgentBasedModel}" href="#Persefone.sunshine-Tuple{Agents.AgentBasedModel}"><code>Persefone.sunshine</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">sunshine(model)</code></pre><p>Return today&#39;s sunshine duration in hours.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L69-L73">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.vapourpressure-Tuple{Agents.AgentBasedModel}" href="#Persefone.vapourpressure-Tuple{Agents.AgentBasedModel}"><code>Persefone.vapourpressure</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">vapourpressure(model)</code></pre><p>Return today&#39;s average vapour pressure in hPa.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L78-L82">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Persefone.windspeed-Tuple{Agents.AgentBasedModel}" href="#Persefone.windspeed-Tuple{Agents.AgentBasedModel}"><code>Persefone.windspeed</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">windspeed(model)</code></pre><p>Return today&#39;s average windspeed in m/s.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/persefone/persefone-model/-/tree/261d20bf5ed58617c17e09eac22cb96608c870f4/src/world/weather.jl#L51-L55">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="species-dsl.html">« Defining new species</a><a class="docs-footer-nextpage" href="io.html">Input and Output »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/species-dsl.html b/docs/build/species-dsl.html
index 57a129f..86d7917 100644
--- a/docs/build/species-dsl.html
+++ b/docs/build/species-dsl.html
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Defining new species · Persefone</title><meta name="title" content="Defining new species · Persefone"/><meta property="og:title" content="Defining new species · Persefone"/><meta property="twitter:title" content="Defining new species · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li class="is-active"><a class="tocitem" href="species-dsl.html">Defining new species</a><ul class="internal"><li><a class="tocitem" href="#The-Persefone-species-DSL"><span>The Persefone species DSL</span></a></li><li><a class="tocitem" href="#Implementation-details"><span>Implementation details</span></a></li></ul></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developing</a></li><li class="is-active"><a href="species-dsl.html">Defining new species</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="species-dsl.html">Defining new species</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/species-dsl.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Defining-new-species"><a class="docs-heading-anchor" href="#Defining-new-species">Defining new species</a><a id="Defining-new-species-1"></a><a class="docs-heading-anchor-permalink" href="#Defining-new-species" title="Permalink"></a></h1><h2 id="The-Persefone-species-DSL"><a class="docs-heading-anchor" href="#The-Persefone-species-DSL">The Persefone species DSL</a><a id="The-Persefone-species-DSL-1"></a><a class="docs-heading-anchor-permalink" href="#The-Persefone-species-DSL" title="Permalink"></a></h2><p>In order to make implementing new species as easy as possible, Persefone includes a <a href="https://doi.org/10.1016/j.ecoinf.2015.02.005">domain-specific language</a> (DSL) built from a collection of macros and functions.</p><p>Here is an example of what this looks like, using a hypothetical mermaid species:</p><pre><code class="language-julia hljs">@species Mermaid begin
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Defining new species · Persefone</title><meta name="title" content="Defining new species · Persefone"/><meta property="og:title" content="Defining new species · Persefone"/><meta property="twitter:title" content="Defining new species · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li class="is-active"><a class="tocitem" href="species-dsl.html">Defining new species</a><ul class="internal"><li><a class="tocitem" href="#The-Persefone-species-DSL"><span>The Persefone species DSL</span></a></li><li><a class="tocitem" href="#Implementation-details"><span>Implementation details</span></a></li></ul></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developer guide</a></li><li class="is-active"><a href="species-dsl.html">Defining new species</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="species-dsl.html">Defining new species</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/species-dsl.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Defining-new-species"><a class="docs-heading-anchor" href="#Defining-new-species">Defining new species</a><a id="Defining-new-species-1"></a><a class="docs-heading-anchor-permalink" href="#Defining-new-species" title="Permalink"></a></h1><h2 id="The-Persefone-species-DSL"><a class="docs-heading-anchor" href="#The-Persefone-species-DSL">The Persefone species DSL</a><a id="The-Persefone-species-DSL-1"></a><a class="docs-heading-anchor-permalink" href="#The-Persefone-species-DSL" title="Permalink"></a></h2><p>In order to make implementing new species as easy as possible, Persefone includes a <a href="https://doi.org/10.1016/j.ecoinf.2015.02.005">domain-specific language</a> (DSL) built from a collection of macros and functions.</p><p>Here is an example of what this looks like, using a hypothetical mermaid species:</p><pre><code class="language-julia hljs">@species Mermaid begin
     ageofmaturity = 2
     pesticidemortality = 1.0
     @initialise(@habitat(@landcover() == water), pairs=true)
@@ -20,4 +20,4 @@
         @debug &quot;$(animalid(animal)) is experiencing drought with $n neighbour(s).&quot;
         @respond sowing @setphase(life)
     end
-end</code></pre><p>The two most important macros are <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a> and <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>,  followed by <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a>, <a href="nature.html#Persefone.@trait-Tuple{Any}"><code>@trait</code></a>, <a href="nature.html#Persefone.@respond-Tuple{Any, Any}"><code>@respond</code></a>,  and <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>. Other macros provide convenience wrappers for common  functions. (See <code>src/nature/nature.jl</code> for details.)</p><p>The top-level macro is <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a>. This takes two arguments: a species  name and a definition block (enclosed in <code>begin</code> and <code>end</code> tags). At the start of the definition block, species-specific variables can be defined that should be available throughout a species&#39; lifetime. Code in this section has access to the <code>model</code> object and can thus reference the current model state. In this section, the user also has to call the <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a> macro. This wraps the  <a href="nature.html#Persefone.initpopulation-Tuple{Function}"><code>Persefone.initpopulation</code></a> function, and takes a habitat descriptor  (see <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a> below) and several options to specify how the species&#39;  population should be distributed in the landscape during model initialisation.</p><p>Following this section, each species must define one or more <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> blocks. The concept behind this is that species show different behaviours at different phases of their lifecycle. Each <code>@phase</code> block defines the behaviour in one of these phases. (Technically, it defines a function that will be called daily, so long as the species&#39; <code>phase</code> variable is set to the name of this phase.) Code in this section has access to the <code>model</code> object as well as an <code>animal</code> object, which is the currently active animal agent. Properties of the <code>animal</code> agent, regardless of whether they were defined by the user or by Persefone, can be accessed using the <a href="nature.html#Persefone.@trait-Tuple{Any}"><code>@trait</code></a> macro. Within a phase block, <a href="nature.html#Persefone.@respond-Tuple{Any, Any}"><code>@respond</code></a>  can be used to define the species&#39; response to a <a href="simulation.html#Persefone.FarmEvent"><code>FarmEvent</code></a> that affects  the species&#39; current location, while a variety of other macros provide wrappers to  ecological process functions from <code>src/nature/populations.jl</code>.</p><p>Another important macro is <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>. This defines a &quot;habitat descriptor&quot;, i.e. a predicate function that tests whether or not a given landscape pixel is  suitable for a specified purpose. Such habitat descriptors are used as arguments to various functions, for example for population initialisation or movement. The argument to <code>@habitat</code> consists of a logical expression, which has access to the animal&#39;s current position (the <code>pos</code> tuple variable) and the <code>model</code>. Various macros are available to easily reference information about the current location, such as <a href="nature.html#Persefone.@landcover-Tuple{}"><code>@landcover</code></a> or <a href="nature.html#Persefone.@distancetoedge-Tuple{}"><code>@distancetoedge</code></a>.</p><h2 id="Implementation-details"><a class="docs-heading-anchor" href="#Implementation-details">Implementation details</a><a id="Implementation-details-1"></a><a class="docs-heading-anchor-permalink" href="#Implementation-details" title="Permalink"></a></h2><p>Due to a known <a href="https://juliadynamics.github.io/Agents.jl/stable/performance_tips/#Avoid-Unions-of-many-different-agent-types-(temporary!)-1">performance problem</a>  with multi-agent models, the underlying implementation of species is  rather complicated (see <code>src/nature/nature.jl</code> for details.)</p><p>Rather than creating a new type/struct for each species, all <a href="@ref">Animal</a> agents have the same type. Instead, they are differentiated by a <code>traits</code> dict, which stores both species-specific parameters and run-time variables. Note that due to a redefinition of the <code>getproperty()/setproperty!()</code> methods, variables from the trait dict can be accessed and modified just like normal struct fields (i.e. although <code>phase</code> is defined in the dict, not the struct, <code>animal.phase = &quot;newphase&quot;</code> works just fine - one does not have to use <code>animal.traits[&quot;phase&quot;] = &quot;newphase&quot;</code>.)</p><p>Under the hood, the <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a> macro generates a function (with the name of the species), which in turn creates the trait dict when called. Thus, adding a new animal agent to the model involves instantiating an <a href="nature.html#Persefone.Animal"><code>Animal</code></a> object, then calling the relevant species function and attaching the returned dict to the agent object.</p><p>Similarly, the <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> macro too works by defining a new function, which is stored in the species&#39; trait dict. These functions take an animal object and the model object as input, and define what the species does during its daily update.</p><p>Once again, <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a> creates a function that takes <code>model</code> and <code>pos</code> as input and returns a boolean response. Functions that require a habitat descriptor thus take in this (anonymous) function and call it internally.</p><p>Finally, the <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a> macro is a wrapper around  <a href="nature.html#Persefone.initpopulation-Tuple{Function}"><code>Persefone.initpopulation</code></a>, which (yet again) creates a function that  specifies how a species&#39; population is to be initialised at the beginning of a  simulation run. This function is stored in the species trait dict and accessed  during model setup.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="gis.html">« Maps and weather data</a><a class="docs-footer-nextpage" href="simulation.html">Simulation »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+end</code></pre><p>The two most important macros are <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a> and <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a>,  followed by <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a>, <a href="nature.html#Persefone.@trait-Tuple{Any}"><code>@trait</code></a>, <a href="nature.html#Persefone.@respond-Tuple{Any, Any}"><code>@respond</code></a>,  and <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>. Other macros provide convenience wrappers for common  functions. (See <code>src/nature/nature.jl</code> for details.)</p><p>The top-level macro is <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a>. This takes two arguments: a species  name and a definition block (enclosed in <code>begin</code> and <code>end</code> tags). At the start of the definition block, species-specific variables can be defined that should be available throughout a species&#39; lifetime. Code in this section has access to the <code>model</code> object and can thus reference the current model state. In this section, the user also has to call the <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a> macro. This wraps the  <a href="nature.html#Persefone.initpopulation-Tuple{Function}"><code>Persefone.initpopulation</code></a> function, and takes a habitat descriptor  (see <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a> below) and several options to specify how the species&#39;  population should be distributed in the landscape during model initialisation.</p><p>Following this section, each species must define one or more <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> blocks. The concept behind this is that species show different behaviours at different phases of their lifecycle. Each <code>@phase</code> block defines the behaviour in one of these phases. (Technically, it defines a function that will be called daily, so long as the species&#39; <code>phase</code> variable is set to the name of this phase.) Code in this section has access to the <code>model</code> object as well as an <code>animal</code> object, which is the currently active animal agent. Properties of the <code>animal</code> agent, regardless of whether they were defined by the user or by Persefone, can be accessed using the <a href="nature.html#Persefone.@trait-Tuple{Any}"><code>@trait</code></a> macro. Within a phase block, <a href="nature.html#Persefone.@respond-Tuple{Any, Any}"><code>@respond</code></a>  can be used to define the species&#39; response to a <a href="simulation.html#Persefone.FarmEvent"><code>FarmEvent</code></a> that affects  the species&#39; current location, while a variety of other macros provide wrappers to  ecological process functions from <code>src/nature/populations.jl</code>.</p><p>Another important macro is <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a>. This defines a &quot;habitat descriptor&quot;, i.e. a predicate function that tests whether or not a given landscape pixel is  suitable for a specified purpose. Such habitat descriptors are used as arguments to various functions, for example for population initialisation or movement. The argument to <code>@habitat</code> consists of a logical expression, which has access to the animal&#39;s current position (the <code>pos</code> tuple variable) and the <code>model</code>. Various macros are available to easily reference information about the current location, such as <a href="nature.html#Persefone.@landcover-Tuple{}"><code>@landcover</code></a> or <a href="nature.html#Persefone.@distancetoedge-Tuple{}"><code>@distancetoedge</code></a>.</p><h2 id="Implementation-details"><a class="docs-heading-anchor" href="#Implementation-details">Implementation details</a><a id="Implementation-details-1"></a><a class="docs-heading-anchor-permalink" href="#Implementation-details" title="Permalink"></a></h2><p>Due to a known <a href="https://juliadynamics.github.io/Agents.jl/stable/performance_tips/#Avoid-Unions-of-many-different-agent-types-(temporary!)-1">performance problem</a>  with multi-agent models, the underlying implementation of species is  rather complicated (see <code>src/nature/nature.jl</code> for details.)</p><p>Rather than creating a new type/struct for each species, all <a href="@ref">Animal</a> agents have the same type. Instead, they are differentiated by a <code>traits</code> dict, which stores both species-specific parameters and run-time variables. Note that due to a redefinition of the <code>getproperty()/setproperty!()</code> methods, variables from the trait dict can be accessed and modified just like normal struct fields (i.e. although <code>phase</code> is defined in the dict, not the struct, <code>animal.phase = &quot;newphase&quot;</code> works just fine - one does not have to use <code>animal.traits[&quot;phase&quot;] = &quot;newphase&quot;</code>.)</p><p>Under the hood, the <a href="nature.html#Persefone.@species-Tuple{Any, Any}"><code>@species</code></a> macro generates a function (with the name of the species), which in turn creates the trait dict when called. Thus, adding a new animal agent to the model involves instantiating an <a href="nature.html#Persefone.Animal"><code>Animal</code></a> object, then calling the relevant species function and attaching the returned dict to the agent object.</p><p>Similarly, the <a href="nature.html#Persefone.@phase-Tuple{Any, Any}"><code>@phase</code></a> macro too works by defining a new function, which is stored in the species&#39; trait dict. These functions take an animal object and the model object as input, and define what the species does during its daily update.</p><p>Once again, <a href="nature.html#Persefone.@habitat-Tuple{Any}"><code>@habitat</code></a> creates a function that takes <code>model</code> and <code>pos</code> as input and returns a boolean response. Functions that require a habitat descriptor thus take in this (anonymous) function and call it internally.</p><p>Finally, the <a href="nature.html#Persefone.@initialise-Tuple{Any, Vararg{Any}}"><code>@initialise</code></a> macro is a wrapper around  <a href="nature.html#Persefone.initpopulation-Tuple{Function}"><code>Persefone.initpopulation</code></a>, which (yet again) creates a function that  specifies how a species&#39; population is to be initialised at the beginning of a  simulation run. This function is stored in the species trait dict and accessed  during model setup.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="gis.html">« Maps and weather data</a><a class="docs-footer-nextpage" href="simulation.html">Simulation »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/species.html b/docs/build/species.html
index cd39a5a..5e64d32 100644
--- a/docs/build/species.html
+++ b/docs/build/species.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Species · Persefone</title><meta name="title" content="Species · Persefone"/><meta property="og:title" content="Species · Persefone"/><meta property="twitter:title" content="Species · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="using.html">Usage</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li class="is-active"><a class="tocitem" href="species.html">Species</a><ul class="internal"><li><a class="tocitem" href="#Skylark"><span>Skylark</span></a></li></ul></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Nature</a></li><li class="is-active"><a href="species.html">Species</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="species.html">Species</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/species.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Species"><a class="docs-heading-anchor" href="#Species">Species</a><a id="Species-1"></a><a class="docs-heading-anchor-permalink" href="#Species" title="Permalink"></a></h1><p>The ecological submodel in Persefone simulates a range of species in agricultural landscapes.</p><h2 id="Skylark"><a class="docs-heading-anchor" href="#Skylark">Skylark</a><a id="Skylark-1"></a><a class="docs-heading-anchor-permalink" href="#Skylark" title="Permalink"></a></h2></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="energy.html">« Dynamic Energy Budgets</a><a class="docs-footer-nextpage" href="crops.html">Crop submodel »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Species · Persefone</title><meta name="title" content="Species · Persefone"/><meta property="og:title" content="Species · Persefone"/><meta property="twitter:title" content="Species · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li><a class="tocitem" href="using.html">The Persefone.jl Package</a></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li class="is-active"><a class="tocitem" href="species.html">Species</a><ul class="internal"><li><a class="tocitem" href="#Skylark"><span>Skylark</span></a></li></ul></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Nature</a></li><li class="is-active"><a href="species.html">Species</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="species.html">Species</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/species.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Species"><a class="docs-heading-anchor" href="#Species">Species</a><a id="Species-1"></a><a class="docs-heading-anchor-permalink" href="#Species" title="Permalink"></a></h1><p>The ecological submodel in Persefone simulates a range of species in agricultural landscapes.</p><h2 id="Skylark"><a class="docs-heading-anchor" href="#Skylark">Skylark</a><a id="Skylark-1"></a><a class="docs-heading-anchor-permalink" href="#Skylark" title="Permalink"></a></h2></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="energy.html">« Dynamic Energy Budgets</a><a class="docs-footer-nextpage" href="crops.html">Crop submodel »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/using.html b/docs/build/using.html
index 5e0ca9e..fb0afe4 100644
--- a/docs/build/using.html
+++ b/docs/build/using.html
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Usage · Persefone</title><meta name="title" content="Usage · Persefone"/><meta property="og:title" content="Usage · Persefone"/><meta property="twitter:title" content="Usage · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">Manual</span><ul><li class="is-active"><a class="tocitem" href="using.html">Usage</a><ul class="internal"><li><a class="tocitem" href="#Installation"><span>Installation</span></a></li><li><a class="tocitem" href="#Running-from-the-command-line"><span>Running from the command line</span></a></li><li><a class="tocitem" href="#Running-from-within-Julia"><span>Running from within Julia</span></a></li></ul></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Manual</a></li><li class="is-active"><a href="using.html">Usage</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="using.html">Usage</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/using.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Usage"><a class="docs-heading-anchor" href="#Usage">Usage</a><a id="Usage-1"></a><a class="docs-heading-anchor-permalink" href="#Usage" title="Permalink"></a></h1><p><em>This page describes how to run Persefone.jl as a command line application or Julia package. To use it with a graphical user interface, see <a href="gui.html">here</a>.</em></p><h2 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h2><p>Install the latest version of the <a href="https://julialang.org/downloads/">Julia</a> programming  language (1.9+). The recommended editors are <a href="https://www.julia-vscode.org/">VSCode</a> or <a href="https://www.emacswiki.org/emacs/JuliaProgrammingLanguage">Emacs</a>. To install the package dependencies, open a Julia REPL in this folder and run:</p><pre><code class="language-julia hljs">using Pkg
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>The Persefone.jl Package · Persefone</title><meta name="title" content="The Persefone.jl Package · Persefone"/><meta property="og:title" content="The Persefone.jl Package · Persefone"/><meta property="twitter:title" content="The Persefone.jl Package · Persefone"/><meta name="description" content="Documentation for Persefone."/><meta property="og:description" content="Documentation for Persefone."/><meta property="twitter:description" content="Documentation for Persefone."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Persefone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Persefone</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><span class="tocitem">User guide</span><ul><li class="is-active"><a class="tocitem" href="using.html">The Persefone.jl Package</a><ul class="internal"><li><a class="tocitem" href="#Installation"><span>Installation</span></a></li><li><a class="tocitem" href="#Running-from-the-command-line"><span>Running from the command line</span></a></li><li><a class="tocitem" href="#Running-from-within-Julia"><span>Running from within Julia</span></a></li></ul></li><li><a class="tocitem" href="gui.html">Graphical User Interface</a></li><li><a class="tocitem" href="config.html">Configuration</a></li></ul></li><li><span class="tocitem">Developer guide</span><ul><li><a class="tocitem" href="developing.html">Developing Persefone</a></li><li><a class="tocitem" href="adapting.html">Adapting Persefone</a></li><li><a class="tocitem" href="architecture.html">Source code architecture</a></li><li><a class="tocitem" href="gis.html">Maps and weather data</a></li><li><a class="tocitem" href="species-dsl.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation.html">Simulation</a></li><li><a class="tocitem" href="io.html">Input and Output</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature.html">Nature</a></li><li><a class="tocitem" href="energy.html">Dynamic Energy Budgets</a></li><li><a class="tocitem" href="species.html">Species</a></li></ul></li><li><a class="tocitem" href="crops.html">Crop submodel</a></li><li><a class="tocitem" href="farm.html">Farm submodel</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">User guide</a></li><li class="is-active"><a href="using.html">The Persefone.jl Package</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="using.html">The Persefone.jl Package</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.idiv.de/persefone/persefone-model/-/tree/master/docs/src/using.md" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="The-Persefone.jl-Package"><a class="docs-heading-anchor" href="#The-Persefone.jl-Package">The Persefone.jl Package</a><a id="The-Persefone.jl-Package-1"></a><a class="docs-heading-anchor-permalink" href="#The-Persefone.jl-Package" title="Permalink"></a></h1><p><em>This page describes how to run Persefone.jl as a command line application or Julia package, which is the default mode. To use the model with a graphical user interface, see <a href="gui.html">here</a>.</em></p><h2 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h2><p>Install the latest version of the <a href="https://julialang.org/downloads/">Julia</a> programming  language (1.9+). The recommended editors are <a href="https://www.julia-vscode.org/">VSCode</a> or <a href="https://www.emacswiki.org/emacs/JuliaProgrammingLanguage">Emacs</a>. To install the package dependencies, open a Julia REPL in this folder and run:</p><pre><code class="language-julia hljs">using Pkg
 Pkg.activate(&quot;.&quot;)
 Pkg.instantiate()</code></pre><h2 id="Running-from-the-command-line"><a class="docs-heading-anchor" href="#Running-from-the-command-line">Running from the command line</a><a id="Running-from-the-command-line-1"></a><a class="docs-heading-anchor-permalink" href="#Running-from-the-command-line" title="Permalink"></a></h2><p>This is the normal mode of operation. Simply execute <code>run.jl</code> in a terminal, typically like  so (in Linux):</p><pre><code class="nohighlight hljs">&gt; julia run.jl -c &lt;config&gt;</code></pre><p>where <code>&lt;config&gt;</code> specifies the configuration file to use. The recommended workflow is to copy <code>scr/parameters.toml</code> to a location of your choice and edit the copy to suit your requirements. The adapted config file can then be passed to <code>run.jl</code>. (If no configuration file is specified, Persefone will run with its default settings.)</p><p>The full list of commandline arguments is:</p><pre><code class="nohighlight hljs">usage: run.jl [-c CONFIGFILE] [-s SEED] [-o OUTDIR] [-l LOGLEVEL] 
               [--version] [-h]
@@ -18,4 +18,4 @@ optional arguments:
 &gt; make docs      # build the documentation
 &gt; make release   # create a release</code></pre><h2 id="Running-from-within-Julia"><a class="docs-heading-anchor" href="#Running-from-within-Julia">Running from within Julia</a><a id="Running-from-within-Julia-1"></a><a class="docs-heading-anchor-permalink" href="#Running-from-within-Julia" title="Permalink"></a></h2><p>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:</p><pre><code class="language-julia hljs">using Pkg
 Pkg.activate(&quot;.&quot;) # assuming you&#39;re in the Persefone root folder
-using Persefone</code></pre><p>You can then access all Persefone functions, such as <a href="simulation.html#Persefone.simulate"><code>simulate</code></a>, <a href="simulation.html#Persefone.initialise"><code>initialise</code></a>, <a href="simulation.html#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>stepsimulation!</code></a>, <a href="simulation.html#Persefone.simulate!-Tuple{Agents.AgentBasedModel}"><code>simulate!</code></a>, or <a href="io.html#Persefone.visualiseoutput"><code>visualiseoutput</code></a>. (See <code>src/Persefone.jl</code> for a list of exported  functions.)</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="index.html">« Introduction</a><a class="docs-footer-nextpage" href="gui.html">Graphical User Interface »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 10:59">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+using Persefone</code></pre><p>You can then access all Persefone functions, such as <a href="simulation.html#Persefone.simulate"><code>simulate</code></a>, <a href="simulation.html#Persefone.initialise"><code>initialise</code></a>, <a href="simulation.html#Persefone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>stepsimulation!</code></a>, <a href="simulation.html#Persefone.simulate!-Tuple{Agents.AgentBasedModel}"><code>simulate!</code></a>, or <a href="io.html#Persefone.visualiseoutput"><code>visualiseoutput</code></a>. (See <code>src/Persefone.jl</code> for a list of exported  functions.)</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="index.html">« Introduction</a><a class="docs-footer-nextpage" href="gui.html">Graphical User Interface »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Friday 27 October 2023 11:23">Friday 27 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/builddocs.jl b/docs/builddocs.jl
index 2a44322..8494b6c 100644
--- a/docs/builddocs.jl
+++ b/docs/builddocs.jl
@@ -21,12 +21,12 @@ makedocs(sitename="Persefone",
          warnonly = true, #XXX not recommended
          #warnonly = [:cross_references],
          pages = ["index.md",
-                  "Manual" => [
+                  "User guide" => [
                       "using.md",
                       "gui.md",
                       "config.md"],
                   #"odd.md",
-                  "Developing" => [
+                  "Developer guide" => [
                       "developing.md",
                       "adapting.md",
                       "architecture.md",
diff --git a/docs/src/index.md b/docs/src/index.md
index e5d36b1..9ea4efe 100644
--- a/docs/src/index.md
+++ b/docs/src/index.md
@@ -11,7 +11,7 @@ animal species at a landscape scale. It includes a farm submodel, a crop growth
 and individual-based models of multiple indicator species. Its aim is to investigate how 
 changes in farm operations (e.g. through policy changes in the CAP) influence biodiversity.
 
-The model is open-source software licensed under the terms of the MIT license and available
-on [Gitlab](https://git.idiv.de/persefone/persefone-model).
+The model is open-source software available on 
+[Gitlab](https://git.idiv.de/persefone/persefone-model).
 
-*Last updated: 2023-10-27 (commit 9f4a9c7)*
+*Last updated: 2023-10-27 (commit 261d20b)*
diff --git a/docs/src/using.md b/docs/src/using.md
index 0cc7ea3..6e4d246 100644
--- a/docs/src/using.md
+++ b/docs/src/using.md
@@ -1,7 +1,7 @@
-# Usage
+# The Persefone.jl Package
 
-*This page describes how to run Persefone.jl as a command line application or Julia package.
-To use it with a graphical user interface, see [here](gui.md).*
+*This page describes how to run Persefone.jl as a command line application or Julia package,
+which is the default mode. To use the model with a graphical user interface, see [here](gui.md).*
 
 ## Installation
 
-- 
GitLab