diff --git a/docs/build/adapting.html b/docs/build/adapting.html
index b110e80d24d00b134fd6464229d0a9cc83c06312..d0b6aef43e515a0775116d45b61f5a9c926937bb 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/adapting.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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="@ref"><code>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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/adapting.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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="@ref"><code>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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 76a40b3daafb76ad0c8c6882d468d0d0fe078415..22c8524095de7e9a7097be37cd719f4456c1ab95 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/architecture.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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="@ref"><code>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="@ref"><code>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">GIS 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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/architecture.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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="@ref"><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="@ref"><code>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="@ref"><code>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="@ref"><code>FarmEvent</code></a> struct is used to communicate farming-related events between  submodels. An event can be triggered with <a href="@ref"><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">GIS 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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 d2aac0c5aafbbb94c21ad00cc75062e360e9b5b3..7f961570a85beae7bb56c8b7577090a658cc128f 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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="#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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/crops.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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, Persefone will include a full-blown crop-growth model (an adaptation of AquaCrop, created by the FAO). At the moment, we are only working with a very basic mock-up.</p><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-binding" id="Persefone.CropType" href="#Persefone.CropType"><code>Persefone.CropType</code></a> — <span class="docstring-category">Type</span></header><section><div><p>The crop types simulated by the model</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L6">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L11-L16">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L65-L69">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L90-L95">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L80-L84">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L34-L38">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L25-L29">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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="#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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/crops.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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, Persefone will include a full-blown crop-growth model (an adaptation of AquaCrop, created by the FAO). At the moment, we are only working with a very basic mock-up.</p><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-binding" id="Persefone.CropType" href="#Persefone.CropType"><code>Persefone.CropType</code></a> — <span class="docstring-category">Type</span></header><section><div><p>The crop types simulated by the model</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L6">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L11-L16">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L65-L69">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L90-L95">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L80-L84">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L34-L38">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/crop/crops.jl#L25-L29">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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 a20500a25ed17ec18288c9e4d656e83d8a242c40..81544c35da806c38540b27e4d54cd1ef81b55402 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/developing.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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="odd.html">« Overview, Design, Details (ODD)</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/developing.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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="odd.html">« Overview, Design, Details (ODD)</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 b0c0057e7eca8278b06fe5d02ab937e8af02a6e7..ef7398a44df2f96ce3ca4a696d72243486c18684 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/farm.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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, Persefone will include multiple farm-decision submodels. At the moment,  we are only working with a very basic mock-up.</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-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/xo30xoqa/persephone/-/blob/master//src/farm/farm.jl#L6-L10">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/farm/farm.jl#L24-L28">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/farm/farm.jl#L15-L19">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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/farm.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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, Persefone will include multiple farm-decision submodels. At the moment,  we are only working with a very basic mock-up.</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-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/xo30xoqa/persephone/-/blob/master//src/farm/farm.jl#L6-L10">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/farm/farm.jl#L24-L28">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/farm/farm.jl#L15-L19">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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 d8d87ee4d1b74d1f537281c6744f73261fa69876..17b979f0eadb975916f16bfe8eb814712b95f44b 100644
--- a/docs/build/gis.html
+++ b/docs/build/gis.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>GIS data · Persefone</title><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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></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, Output, and Settings</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="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"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developing</a></li><li class="is-active"><a href="gis.html">GIS data</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="gis.html">GIS data</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/gis.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="GIS-data"><a class="docs-heading-anchor" href="#GIS-data">GIS data</a><a id="GIS-data-1"></a><a class="docs-heading-anchor-permalink" href="#GIS-data" title="Permalink"></a></h1><p>Persefone currently requires two separate map input files: one for land cover, the other for field geometry. 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>GIS data · Persefone</title><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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></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, Output, and Settings</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"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Developing</a></li><li class="is-active"><a href="gis.html">GIS data</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="gis.html">GIS data</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/gis.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="GIS-data"><a class="docs-heading-anchor" href="#GIS-data">GIS data</a><a id="GIS-data-1"></a><a class="docs-heading-anchor-permalink" href="#GIS-data" title="Permalink"></a></h1><p>Persefone currently requires two separate map input files: one for land cover, the other for field geometry. 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
 50: bare soil
-60: agriculture</code></pre><p>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).</p><p>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 <code>Raster -&gt; Extraction -&gt; Clip Raster by Extent</code>. Select the Mundialis map as the input layer, set the clipping extent by choosing your region vector layer under <code>Calculate from Layer</code> and specify the output file name before clicking <code>Run</code>. This will generate a TIF file that you can pass to Persefone as the <code>landcovermap</code> parameter.</p><h2 id="Field-ID-maps"><a class="docs-heading-anchor" href="#Field-ID-maps">Field ID maps</a><a id="Field-ID-maps-1"></a><a class="docs-heading-anchor-permalink" href="#Field-ID-maps" title="Permalink"></a></h2><p>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.</p><p>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 <a href="https://thueringenviewer.thueringen.de/thviewer/invekos.html">here</a>. 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.</p><p>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 (&quot;Feldblockident&quot;) 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 &quot;FID&quot; and set it to a 32-bit integer), and enter <code>@row_number</code> in the  expression field. Then save the layer and close the calculator.</p><p>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&#39;re working with the Thüringen InVeKoS data (other data sets may have a different structure), right-click on the layer name in QGIS&#39; layer overview and click on &quot;Filter...&quot;. Then, enter this expression in the query builder: <code>&quot;BNK&quot; = &#39;AL&#39; OR &quot;BNK&quot; = &#39;GL&#39;</code> and click &quot;OK&quot;. This will select only field and grassland plots.</p><p>Next, open the rasteriser (<code>Raster -&gt; Conversion -&gt; Rasterize</code>). Select your FID field as the &quot;Field to use for a burn-in value&quot;, and your land cover map (as created above - this ensures the two layers match) as the output extent. Make sure  the &quot;fixed value to burn&quot; is &quot;Not set&quot;. Then choose &quot;Georeferenced units&quot; as the  &quot;Out raster size units&quot; and set horizontal and vertical resolution to 10.0. In  the advanced parameters, set the output data type to <code>UInt32</code>. Finally, enter an  output file name and run. The resulting TIF file can be passed to Persefone as the <code>farmfieldmap</code> parameter.</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+60: agriculture</code></pre><p>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).</p><p>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 <code>Raster -&gt; Extraction -&gt; Clip Raster by Extent</code>. Select the Mundialis map as the input layer, set the clipping extent by choosing your region vector layer under <code>Calculate from Layer</code> and specify the output file name before clicking <code>Run</code>. This will generate a TIF file that you can pass to Persefone as the <code>landcovermap</code> parameter.</p><h2 id="Field-ID-maps"><a class="docs-heading-anchor" href="#Field-ID-maps">Field ID maps</a><a id="Field-ID-maps-1"></a><a class="docs-heading-anchor-permalink" href="#Field-ID-maps" title="Permalink"></a></h2><p>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.</p><p>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 <a href="https://thueringenviewer.thueringen.de/thviewer/invekos.html">here</a>. 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.</p><p>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 (&quot;Feldblockident&quot;) 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 &quot;FID&quot; and set it to a 32-bit integer), and enter <code>@row_number</code> in the  expression field. Then save the layer and close the calculator.</p><p>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&#39;re working with the Thüringen InVeKoS data (other data sets may have a different structure), right-click on the layer name in QGIS&#39; layer overview and click on &quot;Filter...&quot;. Then, enter this expression in the query builder: <code>&quot;BNK&quot; = &#39;AL&#39; OR &quot;BNK&quot; = &#39;GL&#39;</code> and click &quot;OK&quot;. This will select only field and grassland plots.</p><p>Next, open the rasteriser (<code>Raster -&gt; Conversion -&gt; Rasterize</code>). Select your FID field as the &quot;Field to use for a burn-in value&quot;, and your land cover map (as created above - this ensures the two layers match) as the output extent. Make sure  the &quot;fixed value to burn&quot; is &quot;Not set&quot;. Then choose &quot;Georeferenced units&quot; as the  &quot;Out raster size units&quot; and set horizontal and vertical resolution to 10.0. In  the advanced parameters, set the output data type to <code>UInt32</code>. Finally, enter an  output file name and run. The resulting TIF file can be passed to Persefone as the <code>farmfieldmap</code> parameter.</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 0d2ef7e0ab7989b1febe2d0ee74d36cf499a5fcc..80ea7f6f9a63e69e9a16c5078fcbe1739b469776 100644
--- a/docs/build/index.html
+++ b/docs/build/index.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>Introduction · Persefone</title><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li class="is-active"><a class="tocitem" href="index.html">Introduction</a><ul class="internal"><li><a class="tocitem" href="#Running-the-model"><span>Running the model</span></a></li><li><a class="tocitem" href="#Model-input"><span>Model input</span></a></li></ul></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/index.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><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>Persefone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).</p><p>It&#39;s aim is to investigate how policy affects farmer decision-making, and how this in turn affects various animal species. It includes a farm submodel, a crop-growth submodel, and an ecological submodels.</p><h2 id="Running-the-model"><a class="docs-heading-anchor" href="#Running-the-model">Running the model</a><a id="Running-the-model-1"></a><a class="docs-heading-anchor-permalink" href="#Running-the-model" title="Permalink"></a></h2><p>To run a single experiment, execute <code>run.jl</code>:</p><pre><code class="nohighlight hljs">julia run.jl -c &lt;CONFIG&gt;</code></pre><p>Other commandline arguments are:</p><pre><code class="nohighlight hljs">usage: run.jl [-c CONFIGFILE] [-s SEED] [-o OUTDIR] [-l LOGLEVEL] 
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Introduction · Persefone</title><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li class="is-active"><a class="tocitem" href="index.html">Introduction</a><ul class="internal"><li><a class="tocitem" href="#Running-the-model"><span>Running the model</span></a></li><li><a class="tocitem" href="#Model-input"><span>Model input</span></a></li></ul></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/index.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><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>Persefone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).</p><p>It&#39;s aim is to investigate how policy affects farmer decision-making, and how this in turn affects various animal species. It includes a farm submodel, a crop-growth submodel, and an ecological submodels.</p><h2 id="Running-the-model"><a class="docs-heading-anchor" href="#Running-the-model">Running the model</a><a id="Running-the-model-1"></a><a class="docs-heading-anchor-permalink" href="#Running-the-model" title="Permalink"></a></h2><p>To run a single experiment, execute <code>run.jl</code>:</p><pre><code class="nohighlight hljs">julia run.jl -c &lt;CONFIG&gt;</code></pre><p>Other commandline arguments are:</p><pre><code class="nohighlight hljs">usage: run.jl [-c CONFIGFILE] [-s SEED] [-o OUTDIR] [-l LOGLEVEL] 
               [--version] [-h]
 
 optional arguments:
@@ -17,8 +17,6 @@ optional arguments:
 
 [core]
 configfile = &quot;src/parameters.toml&quot; # location of the configuration file
-landcovermap = &quot;data/landcover_jena.tif&quot; # location of the landcover map
-farmfieldsmap = &quot;data/fields_jena.tif&quot; # location of the field geometry map
 outdir = &quot;results&quot; # location and name of the output folder
 overwrite = &quot;ask&quot; # overwrite the output directory? (true/false/&quot;ask&quot;)
 loglevel = &quot;debug&quot; # verbosity level: &quot;debug&quot;, &quot;info&quot;, &quot;warn&quot;
@@ -28,6 +26,10 @@ seed = 2 # seed value for the RNG (0 -&gt; random value)
 startdate = 2022-01-01
 enddate = 2022-12-31
 
+[world]
+landcovermap = &quot;data/landcover_jena.tif&quot; # location of the landcover map
+farmfieldsmap = &quot;data/fields_jena.tif&quot; # location of the field geometry map
+
 [farm]
 farmmodel = &quot;FieldManager&quot; # which version of the farm model to use (not yet implemented)
 
@@ -37,4 +39,4 @@ popoutfreq = &quot;daily&quot; # output frequency population-level data, daily/m
 indoutfreq = &quot;end&quot; # output frequency individual-level data, daily/monthly/yearly/end/never
 	
 [crop]
-cropmodel = &quot;linear&quot; # crop growth model to use, &quot;linear&quot; or &quot;aquacrop&quot; (not yet implemented)</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><p><em>Last updated: 2023-05-28 (commit 60e9012)</em></p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="odd.html">Overview, Design, Details (ODD) »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+cropmodel = &quot;linear&quot; # crop growth model to use, &quot;linear&quot; or &quot;aquacrop&quot; (not yet implemented)</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><p><em>Last updated: 2023-07-20 (commit 0fd9917)</em></p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="odd.html">Overview, Design, Details (ODD) »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 6928d3335dca5cc042dbb77e15109a4779608917..0663e44c42e25b6a9abcc9b5494dba0316e78f8e 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, Output, and Settings · Persefone</title><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</a><ul class="internal"><li><a class="tocitem" href="#parameters.toml"><span>parameters.toml</span></a></li><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></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="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"><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, Output, and Settings</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="io.html">Input, Output, and Settings</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/io.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Input,-Output,-and-Settings"><a class="docs-heading-anchor" href="#Input,-Output,-and-Settings">Input, Output, and Settings</a><a id="Input,-Output,-and-Settings-1"></a><a class="docs-heading-anchor-permalink" href="#Input,-Output,-and-Settings" 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 any output.</p><h2 id="parameters.toml"><a class="docs-heading-anchor" href="#parameters.toml">parameters.toml</a><a id="parameters.toml-1"></a><a class="docs-heading-anchor-permalink" href="#parameters.toml" title="Permalink"></a></h2><p>This is the default configuration file for Persefone, containing all model parameters. The syntax is described here: <a href="https://toml.io/en/">https://toml.io/en/</a></p><p>DO NOT MODIFY THIS FILE FOR SIMULATION EXPERIMENTS! Instead, copy it to another directory, modify the copy, and then pass it to the model using the <code>--config</code> parameter.</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-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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L9-L11">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L97-L104">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L34-L39">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L137-L141">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L72-L77">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L16-L27">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L115-L121">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L126-L132">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-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 designed for text-based data output that is updated more or less regularly (e.g. population data in csv files). Submodels can register their own output functions using <a href="io.html#Persefone.newdataoutput!-Tuple{Agents.AgentBasedModel, String, String, Function, String}"><code>newdataoutput!</code></a>.</p><p>Struct fields:     - filename: the name of the file to be created in the user-specified output directory     - header: a string to be written to the start of the file as it is initialised     - outputfunction: a function that takes a model object and returns a string to write to file     - frequency: how often to call the output function (daily/monthly/yearly/end/never)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L122-L134">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L11-L15">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L32-L38">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persefone.newdataoutput!-Tuple{Agents.AgentBasedModel, String, String, Function, String}" href="#Persefone.newdataoutput!-Tuple{Agents.AgentBasedModel, String, String, Function, String}"><code>Persefone.newdataoutput!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">newdataoutput!(model, filename, 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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L142-L147">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persefone.outputdata-Tuple{Agents.AgentBasedModel}" href="#Persefone.outputdata-Tuple{Agents.AgentBasedModel}"><code>Persefone.outputdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">outputdata(model)</code></pre><p>Cycle through all registered data outputs and activate them according to their configured frequency.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L162-L167">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L100-L106">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L66-L71">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L52-L58">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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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, Output, and Settings · Persefone</title><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</a><ul class="internal"><li><a class="tocitem" href="#parameters.toml"><span>parameters.toml</span></a></li><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></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"><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, Output, and Settings</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="io.html">Input, Output, and Settings</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/io.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Input,-Output,-and-Settings"><a class="docs-heading-anchor" href="#Input,-Output,-and-Settings">Input, Output, and Settings</a><a id="Input,-Output,-and-Settings-1"></a><a class="docs-heading-anchor-permalink" href="#Input,-Output,-and-Settings" 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 any output.</p><h2 id="parameters.toml"><a class="docs-heading-anchor" href="#parameters.toml">parameters.toml</a><a id="parameters.toml-1"></a><a class="docs-heading-anchor-permalink" href="#parameters.toml" title="Permalink"></a></h2><p>This is the default configuration file for Persefone, containing all model parameters. The syntax is described here: <a href="https://toml.io/en/">https://toml.io/en/</a></p><p>DO NOT MODIFY THIS FILE FOR SIMULATION EXPERIMENTS! Instead, copy it to another directory, modify the copy, and then pass it to the model using the <code>--config</code> parameter.</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-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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L9-L11">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L97-L104">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L34-L39">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L137-L141">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L72-L77">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L16-L27">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L115-L121">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/input.jl#L126-L132">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-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 designed for text-based data output that is updated more or less regularly (e.g. population data in csv files). Submodels can register their own output functions using <a href="io.html#Persefone.newdataoutput!-Tuple{Agents.AgentBasedModel, String, String, Function, String}"><code>newdataoutput!</code></a>.</p><p>Struct fields:     - filename: the name of the file to be created in the user-specified output directory     - header: a string to be written to the start of the file as it is initialised     - outputfunction: a function that takes a model object and returns a string to write to file     - frequency: how often to call the output function (daily/monthly/yearly/end/never)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L122-L134">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L11-L15">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L32-L38">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persefone.newdataoutput!-Tuple{Agents.AgentBasedModel, String, String, Function, String}" href="#Persefone.newdataoutput!-Tuple{Agents.AgentBasedModel, String, String, Function, String}"><code>Persefone.newdataoutput!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">newdataoutput!(model, filename, 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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L142-L147">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persefone.outputdata-Tuple{Agents.AgentBasedModel}" href="#Persefone.outputdata-Tuple{Agents.AgentBasedModel}"><code>Persefone.outputdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">outputdata(model)</code></pre><p>Cycle through all registered data outputs and activate them according to their configured frequency.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L162-L167">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L100-L106">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L66-L71">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/output.jl#L52-L58">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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 7d132c6e62c1e539d999ee14fe33e221aecc674c..5178c114d822d9f43b2a8ae35ccb4b260863f91b 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="#ecologicaldata.jl"><span>ecologicaldata.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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/nature.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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-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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L12-L19">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L52-L56">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L71-L75">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L61-L65">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L374-L380">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L341-L347">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persefone.@croptype-Tuple{}" href="#Persefone.@croptype-Tuple{}"><code>Persefone.@croptype</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@croptype</code></pre><p>Return 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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L330-L336">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L352-L358">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L363-L369">source</a></section></article><article class="docstring"><header><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.@croptype-Tuple{}"><code>@croptype</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/nature.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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-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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L12-L19">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L57-L61">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L76-L80">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L66-L70">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L379-L385">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L346-L352">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persefone.@croptype-Tuple{}" href="#Persefone.@croptype-Tuple{}"><code>Persefone.@croptype</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@croptype</code></pre><p>Return 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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L335-L341">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L357-L363">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L368-L374">source</a></section></article><article class="docstring"><header><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.@croptype-Tuple{}"><code>@croptype</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; @croptype() != maize &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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L275-L302">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L147-L155">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L240-L246">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L320-L325">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L264-L269">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L160-L190">source</a></section></article><article class="docstring"><header><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="nature.html#Persefone.reproduce!"><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L254-L259">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L226-L231">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L216-L220">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L280-L307">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L152-L160">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L245-L251">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L325-L330">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L269-L274">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L165-L195">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L259-L264">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L231-L236">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L221-L225">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L94-L123">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L202-L207">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-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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L137-L141">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L7-L32">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L70-L75">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L99-L104">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L126-L130">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L115-L119">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L84-L88">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-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/xo30xoqa/persephone/-/blob/master//src/nature/ecologicaldata.jl#L9-L13">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/ecologicaldata.jl#L42-L49">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/ecologicaldata.jl#L21-L28">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="io.html">« Input, Output, and Settings</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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/xo30xoqa/persephone/-/blob/master//src/nature/nature.jl#L99-L128">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//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-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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L137-L141">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L7-L32">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L70-L75">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L99-L104">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L126-L130">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/populations.jl#L115-L119">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//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-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/xo30xoqa/persephone/-/blob/master//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-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/xo30xoqa/persephone/-/blob/master//src/nature/ecologicaldata.jl#L9-L13">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/ecologicaldata.jl#L42-L49">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/nature/ecologicaldata.jl#L21-L28">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="io.html">« Input, Output, and Settings</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 c7204767480e8013ebb596ac85cae4466d77e2f5..5cd451735c8589998d0f706703444cb1323c3518 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li class="is-active"><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/odd.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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"><a class="docs-footer-prevpage" href="index.html">« Introduction</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li class="is-active"><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/odd.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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"><a class="docs-footer-prevpage" href="index.html">« Introduction</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/build/search.html b/docs/build/search.html
index 5d6c64b4de57c7ddfb729c347ba92d8c75e2cff7..be55e2c556401d23fba824ba9808141959e5913d 100644
--- a/docs/build/search.html
+++ b/docs/build/search.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>Search · Persefone</title><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="search.html">Search</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="search.html">Search</a></li></ul></nav><div class="docs-right"><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article><p id="documenter-search-info">Loading search...</p><ul id="documenter-search-results"></ul></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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><script src="search_index.js"></script><script src="assets/search.js"></script></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Search · Persefone</title><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="search.html">Search</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="search.html">Search</a></li></ul></nav><div class="docs-right"><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article><p id="documenter-search-info">Loading search...</p><ul id="documenter-search-results"></ul></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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><script src="search_index.js"></script><script src="assets/search.js"></script></html>
diff --git a/docs/build/search_index.js b/docs/build/search_index.js
index b47f3cd109b4495a1708eddc13f67726b492802d..0f620300f629daf3b6700137d47112fe98b8475f 100644
--- a/docs/build/search_index.js
+++ b/docs/build/search_index.js
@@ -1,3 +1,3 @@
 var documenterSearchIndex = {"docs":
-[{"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.@croptype-Tuple{}","page":"Nature","title":"Persefone.@croptype","text":"@croptype\n\nReturn 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, @croptype, @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 && @croptype() != 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#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":"io.html#Input,-Output,-and-Settings","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"","category":"section"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"These functions are responsible for reading in all model configurations (passed by config file or commandline), administrating them during a run, and printing any output.","category":"page"},{"location":"io.html#parameters.toml","page":"Input, Output, and Settings","title":"parameters.toml","text":"","category":"section"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"This is the default configuration file for Persefone, containing all model parameters. The syntax is described here: https://toml.io/en/","category":"page"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"DO NOT MODIFY THIS FILE FOR SIMULATION EXPERIMENTS! Instead, copy it to another directory, modify the copy, and then pass it to the model using the --config parameter.","category":"page"},{"location":"io.html#input.jl","page":"Input, Output, and Settings","title":"input.jl","text":"","category":"section"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persefone]\nPages = [\"core/input.jl\"]","category":"page"},{"location":"io.html#Persefone.PARAMFILE","page":"Input, Output, and Settings","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, Output, and Settings","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, Output, and Settings","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.parsecommandline-Tuple{}","page":"Input, Output, and Settings","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, Output, and Settings","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, Output, and Settings","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, Output, and Settings","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, Output, and Settings","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, Output, and Settings","title":"output.jl","text":"","category":"section"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persefone]\nPages = [\"core/output.jl\"]","category":"page"},{"location":"io.html#Persefone.DataOutput","page":"Input, Output, and Settings","title":"Persefone.DataOutput","text":"DataOutput\n\nA struct for organising model output. This is designed for text-based data output that is updated more or less regularly (e.g. population data in csv files). Submodels can register their own output functions using newdataoutput!.\n\nStruct fields:     - filename: the name of the file to be created in the user-specified output directory     - header: a string to be written to the start of the file as it is initialised     - outputfunction: a function that takes a model object and returns a string to write to file     - frequency: how often to call the output function (daily/monthly/yearly/end/never)\n\n\n\n\n\n","category":"type"},{"location":"io.html#Persefone.createdatadir-Tuple{String, Union{Bool, String}}","page":"Input, Output, and Settings","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, Output, and Settings","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!-Tuple{Agents.AgentBasedModel, String, String, Function, String}","page":"Input, Output, and Settings","title":"Persefone.newdataoutput!","text":"newdataoutput!(model, filename, 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":"method"},{"location":"io.html#Persefone.outputdata-Tuple{Agents.AgentBasedModel}","page":"Input, Output, and Settings","title":"Persefone.outputdata","text":"outputdata(model)\n\nCycle through all registered data outputs and activate them according to their configured frequency.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.prepareTOML-Tuple{Any}","page":"Input, Output, and Settings","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, Output, and Settings","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.withtestlogger-Tuple{Agents.AgentBasedModel}","page":"Input, Output, and Settings","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":"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 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 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 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 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 directory holds source files that are important for all submodels, including scheduling, landscape, 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 = [\"core/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":"farm.html#Farm-submodel","page":"Farm submodel","title":"Farm submodel","text":"","category":"section"},{"location":"farm.html","page":"Farm submodel","title":"Farm submodel","text":"Eventually, Persefone will include multiple farm-decision submodels. At the moment,  we are only working with a very basic mock-up.","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 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#GIS-data","page":"GIS data","title":"GIS data","text":"","category":"section"},{"location":"gis.html","page":"GIS data","title":"GIS data","text":"Persefone currently requires two separate map input files: one for land cover, the other for field geometry. This documents describe how to obtain and process the data needed for each of these.","category":"page"},{"location":"gis.html#Land-cover-maps","page":"GIS data","title":"Land cover maps","text":"","category":"section"},{"location":"gis.html","page":"GIS data","title":"GIS 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":"GIS data","title":"GIS data","text":"10: forest\n20: low vegetation\n30: water\n40: built-up\n50: bare soil\n60: agriculture","category":"page"},{"location":"gis.html","page":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"GIS data","title":"Field ID maps","text":"","category":"section"},{"location":"gis.html","page":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"crops.html#Crop-submodel","page":"Crop submodel","title":"Crop submodel","text":"","category":"section"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"Eventually, Persefone will include a full-blown crop-growth model (an adaptation of AquaCrop, created by the FAO). At the moment, we are only working with a very basic mock-up.","category":"page"},{"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.CropType","page":"Crop submodel","title":"Persefone.CropType","text":"The crop types simulated by the model\n\n\n\n\n\n","category":"type"},{"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.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.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.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":"index.html","page":"Introduction","title":"Introduction","text":"CurrentModule = Persefone","category":"page"},{"location":"index.html#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Persefone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"It's aim is to investigate how policy affects farmer decision-making, and how this in turn affects various animal species. It includes a farm submodel, a crop-growth submodel, and an ecological submodels.","category":"page"},{"location":"index.html#Running-the-model","page":"Introduction","title":"Running the model","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"To run a single experiment, execute run.jl:","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"julia run.jl -c <CONFIG>","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Other commandline arguments are:","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","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":"index.html#Model-input","page":"Introduction","title":"Model input","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","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 a complete list  of parameters):","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"### Persefone - a socio-economic-ecological model of European agricultural landscapes.\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\nlandcovermap = \"data/landcover_jena.tif\" # location of the landcover map\nfarmfieldsmap = \"data/fields_jena.tif\" # location of the field geometry map\noutdir = \"results\" # location and name of the output folder\noverwrite = \"ask\" # overwrite the output directory? (true/false/\"ask\")\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[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\n\t\n[crop]\ncropmodel = \"linear\" # crop growth model to use, \"linear\" or \"aquacrop\" (not yet implemented)","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","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":"index.html","page":"Introduction","title":"Introduction","text":"Last updated: 2023-05-28 (commit 60e9012)","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.@croptype-Tuple{}","page":"Nature","title":"Persefone.@croptype","text":"@croptype\n\nReturn 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, @croptype, @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 && @croptype() != 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":"io.html#Input,-Output,-and-Settings","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"","category":"section"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"These functions are responsible for reading in all model configurations (passed by config file or commandline), administrating them during a run, and printing any output.","category":"page"},{"location":"io.html#parameters.toml","page":"Input, Output, and Settings","title":"parameters.toml","text":"","category":"section"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"This is the default configuration file for Persefone, containing all model parameters. The syntax is described here: https://toml.io/en/","category":"page"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"DO NOT MODIFY THIS FILE FOR SIMULATION EXPERIMENTS! Instead, copy it to another directory, modify the copy, and then pass it to the model using the --config parameter.","category":"page"},{"location":"io.html#input.jl","page":"Input, Output, and Settings","title":"input.jl","text":"","category":"section"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persefone]\nPages = [\"core/input.jl\"]","category":"page"},{"location":"io.html#Persefone.PARAMFILE","page":"Input, Output, and Settings","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, Output, and Settings","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, Output, and Settings","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.parsecommandline-Tuple{}","page":"Input, Output, and Settings","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, Output, and Settings","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, Output, and Settings","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, Output, and Settings","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, Output, and Settings","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, Output, and Settings","title":"output.jl","text":"","category":"section"},{"location":"io.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persefone]\nPages = [\"core/output.jl\"]","category":"page"},{"location":"io.html#Persefone.DataOutput","page":"Input, Output, and Settings","title":"Persefone.DataOutput","text":"DataOutput\n\nA struct for organising model output. This is designed for text-based data output that is updated more or less regularly (e.g. population data in csv files). Submodels can register their own output functions using newdataoutput!.\n\nStruct fields:     - filename: the name of the file to be created in the user-specified output directory     - header: a string to be written to the start of the file as it is initialised     - outputfunction: a function that takes a model object and returns a string to write to file     - frequency: how often to call the output function (daily/monthly/yearly/end/never)\n\n\n\n\n\n","category":"type"},{"location":"io.html#Persefone.createdatadir-Tuple{String, Union{Bool, String}}","page":"Input, Output, and Settings","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, Output, and Settings","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!-Tuple{Agents.AgentBasedModel, String, String, Function, String}","page":"Input, Output, and Settings","title":"Persefone.newdataoutput!","text":"newdataoutput!(model, filename, 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":"method"},{"location":"io.html#Persefone.outputdata-Tuple{Agents.AgentBasedModel}","page":"Input, Output, and Settings","title":"Persefone.outputdata","text":"outputdata(model)\n\nCycle through all registered data outputs and activate them according to their configured frequency.\n\n\n\n\n\n","category":"method"},{"location":"io.html#Persefone.prepareTOML-Tuple{Any}","page":"Input, Output, and Settings","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, Output, and Settings","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.withtestlogger-Tuple{Agents.AgentBasedModel}","page":"Input, Output, and Settings","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":"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 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 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 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 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 directory holds source files that are important for all submodels, including scheduling, landscape, 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 = [\"core/landscape.jl\"]","category":"page"},{"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, Persefone will include multiple farm-decision submodels. At the moment,  we are only working with a very basic mock-up.","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 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#GIS-data","page":"GIS data","title":"GIS data","text":"","category":"section"},{"location":"gis.html","page":"GIS data","title":"GIS data","text":"Persefone currently requires two separate map input files: one for land cover, the other for field geometry. This documents describe how to obtain and process the data needed for each of these.","category":"page"},{"location":"gis.html#Land-cover-maps","page":"GIS data","title":"Land cover maps","text":"","category":"section"},{"location":"gis.html","page":"GIS data","title":"GIS 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":"GIS data","title":"GIS data","text":"10: forest\n20: low vegetation\n30: water\n40: built-up\n50: bare soil\n60: agriculture","category":"page"},{"location":"gis.html","page":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"GIS data","title":"Field ID maps","text":"","category":"section"},{"location":"gis.html","page":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"GIS data","title":"GIS 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":"crops.html#Crop-submodel","page":"Crop submodel","title":"Crop submodel","text":"","category":"section"},{"location":"crops.html","page":"Crop submodel","title":"Crop submodel","text":"Eventually, Persefone will include a full-blown crop-growth model (an adaptation of AquaCrop, created by the FAO). At the moment, we are only working with a very basic mock-up.","category":"page"},{"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.CropType","page":"Crop submodel","title":"Persefone.CropType","text":"The crop types simulated by the model\n\n\n\n\n\n","category":"type"},{"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.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.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.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":"index.html","page":"Introduction","title":"Introduction","text":"CurrentModule = Persefone","category":"page"},{"location":"index.html#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Persefone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"It's aim is to investigate how policy affects farmer decision-making, and how this in turn affects various animal species. It includes a farm submodel, a crop-growth submodel, and an ecological submodels.","category":"page"},{"location":"index.html#Running-the-model","page":"Introduction","title":"Running the model","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"To run a single experiment, execute run.jl:","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"julia run.jl -c <CONFIG>","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Other commandline arguments are:","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","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":"index.html#Model-input","page":"Introduction","title":"Model input","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","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 a complete list  of parameters):","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"### Persefone - a socio-economic-ecological model of European agricultural landscapes.\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\")\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/landcover_jena.tif\" # location of the landcover map\nfarmfieldsmap = \"data/fields_jena.tif\" # location of the field geometry map\n\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\n\t\n[crop]\ncropmodel = \"linear\" # crop growth model to use, \"linear\" or \"aquacrop\" (not yet implemented)","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","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":"index.html","page":"Introduction","title":"Introduction","text":"Last updated: 2023-07-20 (commit 0fd9917)","category":"page"}]
 }
diff --git a/docs/build/simulation.html b/docs/build/simulation.html
index 568a07a4300ea19885dad4bb3a95607c47398c8f..ddbe8cabf91c05213c91c32298bced028fbf0486 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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></ul></li><li><a class="tocitem" href="io.html">Input, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/simulation.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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> directory holds source files that are important for all submodels, including scheduling, landscape, 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-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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L136-L140">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L34-L43">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L54-L59">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L85-L91">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L8-L15">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L23-L27">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L113-L117">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-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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L10">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L26-L31">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L6">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L13-L19">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L87-L91">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L120-L125">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L154-L159">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L165-L170">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L109-L113">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L38-L43">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L100-L104">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/landscape.jl#L66-L70">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, Output, and Settings »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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></ul></li><li><a class="tocitem" href="io.html">Input, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/simulation.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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> directory holds source files that are important for all submodels, including scheduling, landscape, 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-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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L136-L140">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L34-L43">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L54-L59">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L85-L91">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L8-L15">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L23-L27">source</a></section></article><article class="docstring"><header><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/xo30xoqa/persephone/-/blob/master//src/core/simulation.jl#L113-L117">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><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, Output, and Settings »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 70edc9e4dfe16760dc9aec776fef7249551eda24..4eb65d952a48ae63e9d905d17d46ab5253a98d0f 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/species-dsl.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/species-dsl.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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="@ref"><code>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="@ref"><code>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">« GIS 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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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="@ref"><code>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="@ref"><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="@ref"><code>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">« GIS 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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</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 929c88947b9a0b09c83846452bede91ae091bab5..161e671db5730da51ed07d4ee9125444c79e575f 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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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="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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/species.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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="nature.html">« Nature</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Sunday 28 May 2023 23:20">Sunday 28 May 2023</span>. Using Julia version 1.9.0-alpha1.</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><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.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/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="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><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Introduction</a></li><li><a class="tocitem" href="odd.html">Overview, Design, Details (ODD)</a></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">GIS 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, Output, and Settings</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"><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-edit-link" href="https://git.idiv.de/xo30xoqa/persephone/-/blob/master//docs/src/species.md#" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.23 on <span class="colophon-date" title="Thursday 20 July 2023 16:01">Thursday 20 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/docs/builddocs.jl b/docs/builddocs.jl
index c1759e7f62bd83813669925343677177eb54104b..0da4912fa685dc1e23476930d94a3d95c31f9d21 100644
--- a/docs/builddocs.jl
+++ b/docs/builddocs.jl
@@ -22,6 +22,7 @@ makedocs(sitename="Persefone",
                       "io.md"],
                   "Nature" => [
                       "nature.md",
+                      "energy.md",
                       "species.md"],
                   "crops.md",
                   "farm.md"
diff --git a/docs/src/index.md b/docs/src/index.md
index f1c9c33f46fa62d04a52f8e5fe83667ce215ad45..dd5d19e0dfa70096b432e7b297072b873f4ade78 100644
--- a/docs/src/index.md
+++ b/docs/src/index.md
@@ -82,4 +82,4 @@ cropmodel = "linear" # crop growth model to use, "linear" or "aquacrop" (not yet
 	combination of parameters that you entered (i.e. do a full-factorial simulation
 	experiment).
 
-*Last updated: 2023-05-28 (commit 60e9012)*
+*Last updated: 2023-07-20 (commit 0fd9917)*
diff --git a/docs/src/nature.md b/docs/src/nature.md
index ea17ea4816d082f6ec26f2bd76214e08bd84bf29..499a764b5df0bf59a791d3b9d2d85bb562428d3c 100644
--- a/docs/src/nature.md
+++ b/docs/src/nature.md
@@ -19,6 +19,16 @@ Modules = [Persefone]
 Pages = ["nature/populations.jl"]
 ```
 
+## insects.jl
+
+This file contains the insect submodel, which calculates the likely insect biomass
+in a given location at a given time.
+
+```@autodocs
+Modules = [Persefone]
+Pages = ["nature/insects.jl"]
+```
+
 ## ecologicaldata.jl
 
 This file contains a set of life-history related utility functions needed by species.
diff --git a/src/nature/energy.jl b/src/nature/energy.jl
index e6e9c844b1463cf87861988b081f15c627773d64..6aa18147a3f2f2b4c54e69409f6fbbc56ae29bcb 100644
--- a/src/nature/energy.jl
+++ b/src/nature/energy.jl
@@ -37,24 +37,12 @@ in a reserve buffer, before being used for maintenance, growth, and reproduction
 
 **Sources:**
 
-- Malishev & 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
-- 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
-- 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
-- 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
-- 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_there_a_toxicokinetic_model_for_daphnia_magna_or_other_zooplankton/attachment/59d62cf579197b807798b396/AS%3A348547653357569%401460111644286/download/Dynamic+Energy+Budget+theory+-+Kooijman.pdf
-- *see also:* Brown et al. (2004). Toward a metabolic theory of ecology.
-Ecology, 85(7), 1771–1789. https://doi.org/10.1890/03-9000
+- Malishev & 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
+- 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
+- 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
+- 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
+- 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_there_a_toxicokinetic_model_for_daphnia_magna_or_other_zooplankton/attachment/59d62cf579197b807798b396/AS%3A348547653357569%401460111644286/download/Dynamic+Energy+Budget+theory+-+Kooijman.pdf
+- *see also:* Brown et al. (2004). Toward a metabolic theory of ecology. Ecology, 85(7), 1771–1789. https://doi.org/10.1890/03-9000
 """
 mutable struct EnergyBudget
     params::DEBparameters
diff --git a/src/nature/insects.jl b/src/nature/insects.jl
index 743bbf2c722546e1e5d3feae0a089c96fc97c35b..fed9ad29c11ff331c997dd8dac64c4fe5d422d0c 100644
--- a/src/nature/insects.jl
+++ b/src/nature/insects.jl
@@ -19,17 +19,10 @@ estimation of likely insect biomass in a given location.
 
 **Sources:**
 
-- Odderskær et al. (1997). Skylark Reproduction in Pesticide Treated and
-Untreated Fields (32; Pesticides Research). Danish Environmental Protection Agency.
-- Grü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
-- 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
-- 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
+- Odderskær et al. (1997). Skylark Reproduction in Pesticide Treated and Untreated Fields (32; Pesticides Research). Danish Environmental Protection Agency.
+- Grü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
+- 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
+- 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
 """
 function insectbiomass(pixel::Pixel, model::AgentBasedModel)::Float64