diff --git a/docs/build.sh b/docs/build.sh index d4a454eaaf1c15a67e18076de3d9533f0405315d..cf8192771fb6e3963f4650329a47859e2e5796e6 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -19,6 +19,7 @@ sed -i -e "s/developing\//developing\/index.html/g" build/index.html build/searc sed -i -e "s/architecture\//architecture\/index.html/g" build/index.html build/search_index.js sed -i -e "s/species-dsl\//species-dsl\/index.html/g" build/index.html build/search_index.js sed -i -e "s/populations\//populations\/index.html/g" build/index.html build/search_index.js +sed -i -e "s/nature\//nature\/index.html/g" build/index.html build/search_index.js sed -i -e "s/species\//species\/index.html/g" build/index.html build/search_index.js sed -i -e "s/crops\//crops\/index.html/g" build/index.html build/search_index.js sed -i -e "s/farm\//farm\/index.html/g" build/index.html build/search_index.js diff --git a/docs/build/architecture/index.html b/docs/build/architecture/index.html index ad23e3214eaf5c256f1bd1b05ed940641c2a4a60..a01fc67b4ea92a1b7a1cfdad3fc34a5372f64d1f 100644 --- a/docs/build/architecture/index.html +++ b/docs/build/architecture/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Source code architecture · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li class="is-active"><a class="tocitem" href>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="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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>Source code architecture</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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><p><em>TODO</em></p><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><ol><li><p>core</p></li><li><p>farm</p></li><li><p>nature</p></li><li><p>crop</p></li></ol><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><ol><li><p>configuration/<code>param()</code></p></li><li><p>output data</p></li><li><p>Agents.jl</p></li></ol></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../developing/index.html">« Developing Persephone</a><a class="docs-footer-nextpage" href="../species-dsl/index.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="Friday 6 January 2023 23:25">Friday 6 January 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 · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li class="is-active"><a class="tocitem" href>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="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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>Source code architecture</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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><p><em>TODO</em></p><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><ol><li><p>core</p></li><li><p>farm</p></li><li><p>nature</p></li><li><p>crop</p></li></ol><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><ol><li><p>configuration/<code>param()</code></p></li><li><p>output data</p></li><li><p>Agents.jl</p></li></ol></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../developing/index.html">« Developing Persephone</a><a class="docs-footer-nextpage" href="../species-dsl/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/build/crops/index.html b/docs/build/crops/index.html index fa5b9c4c5c96c4c3cd2cf556925d419a24096c96..bbf6d4bf25ec3207dc0f0e3a8b8ba37aa688cfe3 100644 --- a/docs/build/crops/index.html +++ b/docs/build/crops/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Crop submodel · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li class="is-active"><a class="tocitem" href>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/index.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>Crop submodel</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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, Persephone 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="Persephone.CropType" href="#Persephone.CropType"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/crop/crops.jl#L6">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.FarmPlot" href="#Persephone.FarmPlot"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/crop/crops.jl#L11-L16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.averagefieldsize-Tuple{Agents.AgentBasedModel}" href="#Persephone.averagefieldsize-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/crop/crops.jl#L79-L83">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/crop/crops.jl#L104-L109">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/crop/crops.jl#L94-L98">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initfields!-Tuple{Agents.AgentBasedModel}" href="#Persephone.initfields!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/crop/crops.jl#L34-L38">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}" href="#Persephone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/crop/crops.jl#L25-L29">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../species/index.html">« Species</a><a class="docs-footer-nextpage" href="../farm/index.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="Friday 6 January 2023 23:25">Friday 6 January 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 · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li class="is-active"><a class="tocitem" href>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/index.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>Crop submodel</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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, Persephone 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="Persephone.CropType" href="#Persephone.CropType"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/crop/crops.jl#L6">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.FarmPlot" href="#Persephone.FarmPlot"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/crop/crops.jl#L11-L16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.averagefieldsize-Tuple{Agents.AgentBasedModel}" href="#Persephone.averagefieldsize-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/crop/crops.jl#L65-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/crop/crops.jl#L90-L95">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/crop/crops.jl#L80-L84">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initfields!-Tuple{Agents.AgentBasedModel}" href="#Persephone.initfields!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/crop/crops.jl#L34-L38">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}" href="#Persephone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/crop/crops.jl#L25-L29">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../species/index.html">« Species</a><a class="docs-footer-nextpage" href="../farm/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/build/developing/index.html b/docs/build/developing/index.html index 6d2cadf852c23e335f194f4871d5855cda446c73..ec6d753d8059b6d5dccd859851e6055dbbcb6342 100644 --- a/docs/build/developing/index.html +++ b/docs/build/developing/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Developing Persephone · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li class="is-active"><a class="tocitem" href>Developing Persephone</a><ul class="internal"><li><a class="tocitem" href="#Workflow"><span>Workflow</span></a></li><li><a class="tocitem" href="#Agents.jl"><span>Agents.jl</span></a></li><li><a class="tocitem" href="#Julia-editors"><span>Julia editors</span></a></li></ul></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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 Persephone</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Developing Persephone</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-Persephone"><a class="docs-heading-anchor" href="#Developing-Persephone">Developing Persephone</a><a id="Developing-Persephone-1"></a><a class="docs-heading-anchor-permalink" href="#Developing-Persephone" 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 development 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 should always be in a runnable and (as far as possible) error-free state.)</p></li><li><p>Implement your changes.</p></li><li><p>Run <code>run.sh</code> to make sure the model executes without crashing. Also run the test suite (<code>cd test; julia runtests.jl</code>).</p></li><li><p>Commit your work frequently, and try to keep each commit small. Don'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><h2 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></h2><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><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 'julia-snail)</code> and <code>(add-hook 'julia-mode-hook #'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 'julia-mode-hook #'company-mode)</code> and <code>(global-set-key (kbd "C-<tab>") '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 "C-x g") '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><h3 id="Other-useful-stuff"><a class="docs-heading-anchor" href="#Other-useful-stuff">Other useful stuff</a><a id="Other-useful-stuff-1"></a><a class="docs-heading-anchor-permalink" href="#Other-useful-stuff" title="Permalink"></a></h3><ol><li><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("Revise")</code>, then add <code>using Revise</code> to <code>.julia/config/startup.jl</code> to have it automatically available.</p></li><li><p><a href="https://github.com/MichaelMure/git-bug"><code>git-bug</code></a> is a commandline bug tracker that integrates directly with git. It can also be used as a local interface to Gitlab issues. To install on Linux, download the <a href="https://github.com/MichaelMure/git-bug/releases/tag/v0.8.0">binary</a>, copy it to <code>/usr/local/bin/git-bug</code>, and set it as executable with <code>chmod +x /usr/local/bin/git-bug</code>. To set up Gitlab integration, run <code>git bug bridge configure</code> from within the relevant repository.</p></li></ol></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../index.html">« Introduction</a><a class="docs-footer-nextpage" href="../architecture/index.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="Friday 6 January 2023 23:25">Friday 6 January 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 Persephone · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li class="is-active"><a class="tocitem" href>Developing Persephone</a><ul class="internal"><li><a class="tocitem" href="#Workflow"><span>Workflow</span></a></li><li><a class="tocitem" href="#Agents.jl"><span>Agents.jl</span></a></li><li><a class="tocitem" href="#Julia-editors"><span>Julia editors</span></a></li></ul></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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 Persephone</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Developing Persephone</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-Persephone"><a class="docs-heading-anchor" href="#Developing-Persephone">Developing Persephone</a><a id="Developing-Persephone-1"></a><a class="docs-heading-anchor-permalink" href="#Developing-Persephone" 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 development 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 should always be in a runnable and (as far as possible) error-free state.)</p></li><li><p>Implement your changes.</p></li><li><p>Run <code>run.sh</code> to make sure the model executes without crashing. Also run the test suite (<code>cd test; julia runtests.jl</code>).</p></li><li><p>Commit your work frequently, and try to keep each commit small. Don'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><h2 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></h2><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><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 'julia-snail)</code> and <code>(add-hook 'julia-mode-hook #'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 'julia-mode-hook #'company-mode)</code> and <code>(global-set-key (kbd "C-<tab>") '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 "C-x g") '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><h3 id="Other-useful-stuff"><a class="docs-heading-anchor" href="#Other-useful-stuff">Other useful stuff</a><a id="Other-useful-stuff-1"></a><a class="docs-heading-anchor-permalink" href="#Other-useful-stuff" title="Permalink"></a></h3><ol><li><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("Revise")</code>, then add <code>using Revise</code> to <code>.julia/config/startup.jl</code> to have it automatically available.</p></li><li><p><a href="https://github.com/MichaelMure/git-bug"><code>git-bug</code></a> is a commandline bug tracker that integrates directly with git. It can also be used as a local interface to Gitlab issues. To install on Linux, download the <a href="https://github.com/MichaelMure/git-bug/releases/tag/v0.8.0">binary</a>, copy it to <code>/usr/local/bin/git-bug</code>, and set it as executable with <code>chmod +x /usr/local/bin/git-bug</code>. To set up Gitlab integration, run <code>git bug bridge configure</code> from within the relevant repository.</p></li></ol></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../index.html">« Introduction</a><a class="docs-footer-nextpage" href="../architecture/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/build/farm/index.html b/docs/build/farm/index.html index a2c4d17edf405e8521e1588e66be502a2754f2a5..dfb914b6c9f93b3d646fddc7d83ea9c2a9ff017d 100644 --- a/docs/build/farm/index.html +++ b/docs/build/farm/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Farm submodel · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li class="is-active"><a class="tocitem" href>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 submodel</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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, Persephone 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="Persephone.initfarms!-Tuple{Agents.AgentBasedModel}" href="#Persephone.initfarms!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/s../farm/index.htmlfarm.jl#L19-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}" href="#Persephone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/s../farm/index.htmlfarm.jl#L10-L14">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../crops/index.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="Friday 6 January 2023 23:25">Friday 6 January 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 · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li class="is-active"><a class="tocitem" href>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 submodel</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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, Persephone 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="Persephone.initfarms!-Tuple{Agents.AgentBasedModel}" href="#Persephone.initfarms!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/s../farm/index.htmlfarm.jl#L19-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}" href="#Persephone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/s../farm/index.htmlfarm.jl#L10-L14">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../crops/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</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 c5af0d874ce1fdd6ae25748e763d3725399348d9..ceb476fe89b1ace940a66d2448f9c40ce2de9b75 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 · Persephone</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><img src="assets/logo.png" alt="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href>Persephone</a></span></div><form class="docs-search" action="search/index.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>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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation/index.html">Simulation</a></li><li><a class="tocitem" href="io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature/">Nature</a></li><li><a class="tocitem" href="species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="farm/index.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>Introduction</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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>Persephone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).</p><p>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.</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:</p><pre><code class="nohighlight hljs">./run.jl -c <CONFIG></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 · Persephone</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><img src="assets/logo.png" alt="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href>Persephone</a></span></div><form class="docs-search" action="search/index.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>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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="simulation/index.html">Simulation</a></li><li><a class="tocitem" href="io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="nature/index.html">Nature</a></li><li><a class="tocitem" href="species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="farm/index.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>Introduction</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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>Persephone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).</p><p>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.</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:</p><pre><code class="nohighlight hljs">./run.jl -c <CONFIG></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: @@ -10,4 +10,4 @@ optional arguments: -l, --loglevel LOGLEVEL verbosity: "debug", "info", or "quiet" --version show version information and exit - -h, --help show this help message and exit</code></pre><h2 id="Model-input"><a class="docs-heading-anchor" href="#Model-input">Model input</a><a id="Model-input-1"></a><a class="docs-heading-anchor-permalink" href="#Model-input" title="Permalink"></a></h2><p><em>TODO: describe config & map files</em></p><p><em>Last updated: 2023-01-06 (commit 21ea890)</em> </p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="developing/index.html">Developing Persephone »</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="Friday 6 January 2023 23:25">Friday 6 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> + -h, --help show this help message and exit</code></pre><h2 id="Model-input"><a class="docs-heading-anchor" href="#Model-input">Model input</a><a id="Model-input-1"></a><a class="docs-heading-anchor-permalink" href="#Model-input" title="Permalink"></a></h2><p><em>TODO: describe config & map files</em></p><p><em>Last updated: 2023-01-20 (commit 4954227)</em> </p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="developing/index.html">Developing Persephone »</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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/build/io/index.html b/docs/build/io/index.html index b82f0323455997cd4cacf1e00ef159e98b290471..62ea63144aa78545e5f5c8573b2f0b4d1e743f1e 100644 --- a/docs/build/io/index.html +++ b/docs/build/io/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Input, Output, and Settings · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li class="is-active"><a class="tocitem" href>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/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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>Input, Output, and Settings</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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 Persephone, containing all model parameters. The syntax is described here: https://toml.io/en/</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="Persephone.getsettings-Tuple{String}" href="#Persephone.getsettings-Tuple{String}"><code>Persephone.getsettings</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">getsettings(configfile)</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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/input.jl#L51-L56">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.parsecommandline-Tuple{}" href="#Persephone.parsecommandline-Tuple{}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/input.jl#L89-L93">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="Persephone.DataOutput" href="#Persephone.DataOutput"><code>Persephone.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 <code>newdataoutput()</code>.</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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/output.jl#L65-L77">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.setupdatadir-Tuple{}" href="#Persephone.setupdatadir-Tuple{}"><code>Persephone.setupdatadir</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">setupdatadir()</code></pre><p>Creates the output directory and copies relevant files into it.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/src/core/output.jl#L11-L15">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../simulation/index.html">« Simulation</a><a class="docs-footer-nextpage" href="../nature/index.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="Friday 6 January 2023 23:25">Friday 6 January 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 · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li class="is-active"><a class="tocitem" href>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/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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>Input, Output, and Settings</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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 Persephone, containing all model parameters. The syntax is described here: https://toml.io/en/</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="Persephone.getsettings" href="#Persephone.getsettings"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/input.jl#L27-L32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.parsecommandline-Tuple{}" href="#Persephone.parsecommandline-Tuple{}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/input.jl#L70-L74">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@param-Tuple{Any}" href="#Persephone.@param-Tuple{Any}"><code>Persephone.@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><domain>.<parameter></code>, for example <code>@param(core.outdir)</code>. Possible values for <domain> 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 that 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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/input.jl#L9-L20">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="Persephone.DataOutput" href="#Persephone.DataOutput"><code>Persephone.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 <code>newdataoutput()</code>.</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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/output.jl#L67-L79">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.newdataoutput-Tuple{Agents.AgentBasedModel, String, String, Function, String}" href="#Persephone.newdataoutput-Tuple{Agents.AgentBasedModel, String, String, Function, String}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/output.jl#L87-L92">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.outputdata-Tuple{Agents.AgentBasedModel}" href="#Persephone.outputdata-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/output.jl#L107-L112">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.setupdatadir-Tuple{Agents.AgentBasedModel}" href="#Persephone.setupdatadir-Tuple{Agents.AgentBasedModel}"><code>Persephone.setupdatadir</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">setupdatadir()</code></pre><p>Creates the output directory and copies relevant files into it.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/src/core/output.jl#L11-L15">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../simulation/index.html">« Simulation</a><a class="docs-footer-nextpage" href="../nature/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/build/nature/index.html b/docs/build/nature/index.html index d01a2de9fd2e872aeecd7919bb3cbeb4a19300b3..db52da73b5b4601e2e8a654a975ce02c1f39ce65 100644 --- a/docs/build/nature/index.html +++ b/docs/build/nature/index.html @@ -1,14 +1,16 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Nature · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.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</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/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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="Persephone.Animal" href="#Persephone.Animal"><code>Persephone.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.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L12-L17">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.animalid-Tuple{Animal}" href="#Persephone.animalid-Tuple{Animal}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L27-L31">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initnature!-Tuple{Agents.AgentBasedModel}" href="#Persephone.initnature!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L46-L50">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}" href="#Persephone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}"><code>Persephone.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's currently active phase function.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L36-L40">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@countanimals" href="#Persephone.@countanimals"><code>Persephone.@countanimals</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@countanimals(speciesname, 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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L322-L327">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@cropheight-Tuple{}" href="#Persephone.@cropheight-Tuple{}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L292-L297">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@croptype-Tuple{}" href="#Persephone.@croptype-Tuple{}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L282-L287">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@distanceto-Tuple{Any}" href="#Persephone.@distanceto-Tuple{Any}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L302-L307">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@distancetoedge-Tuple{}" href="#Persephone.@distancetoedge-Tuple{}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L312-L317">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@habitat-Tuple{Any}" href="#Persephone.@habitat-Tuple{Any}"><code>Persephone.@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: <code>@landcover</code>, <code>@croptype</code>, <code>@cropheight</code>, <code>@distanceto</code>, <code>@distancetoedge</code>, <code>@countanimals</code>. The variables <code>model</code> and <code>pos</code> can be used for checks that don'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 · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.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</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/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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="Persephone.Animal" href="#Persephone.Animal"><code>Persephone.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.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L12-L17">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.animalid-Tuple{Animal}" href="#Persephone.animalid-Tuple{Animal}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L28-L32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initnature!-Tuple{Agents.AgentBasedModel}" href="#Persephone.initnature!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}" href="#Persephone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}"><code>Persephone.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's currently active phase function.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L37-L41">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@countanimals-Tuple" href="#Persephone.@countanimals-Tuple"><code>Persephone.@countanimals</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@countanimals(species="", 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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L357-L362">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@cropheight-Tuple{}" href="#Persephone.@cropheight-Tuple{}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L327-L332">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@croptype-Tuple{}" href="#Persephone.@croptype-Tuple{}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L317-L322">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@distanceto-Tuple{Any}" href="#Persephone.@distanceto-Tuple{Any}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L337-L342">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@distancetoedge-Tuple{}" href="#Persephone.@distancetoedge-Tuple{}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L347-L352">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@habitat-Tuple{Any}" href="#Persephone.@habitat-Tuple{Any}"><code>Persephone.@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: <code>@landcover</code>, <code>@croptype</code>, <code>@cropheight</code>, <code>@distanceto</code>, <code>@distancetoedge</code>, <code>@countanimals</code>. The variables <code>model</code> and <code>pos</code> can be used for checks that don'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 && @croptype() != maize && @cropheight() < 10)) && - @distanceto(forest) > 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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L232-L259">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@here-Tuple{Any}" href="#Persephone.@here-Tuple{Any}"><code>Persephone.@here</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@here(property)</code></pre><p>A utility macro to quickly access a property of the animal's current position. This can only be used nested within <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L192-L197">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@initialise!-Tuple{Any, Vararg{Any}}" href="#Persephone.@initialise!-Tuple{Any, Vararg{Any}}"><code>Persephone.@initialise!</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@initialise!(habitatdescriptor; kwargs...)</code></pre><p>This is a wrapper around <code>initpopulation()</code> that can be called within the body of a <code>@species</code> definition block. It saves the user having to define the required <code>initialise!</code> variable by hand.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L116-L121">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@kill-Tuple" href="#Persephone.@kill-Tuple"><code>Persephone.@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. This is a thin wrapper around <code>kill!()</code>, and passes on any arguments. This can only be used nested within <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L202-L207">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@landcover-Tuple{}" href="#Persephone.@landcover-Tuple{}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L272-L277">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@neighbours-Tuple{Any}" href="#Persephone.@neighbours-Tuple{Any}"><code>Persephone.@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 <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L222-L227">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@phase-Tuple{Any, Any}" href="#Persephone.@phase-Tuple{Any, Any}"><code>Persephone.@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 <code>@species</code>).</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.traits</code> (a dict that gives access to all species parameters).</li><li><code>pos</code> gives the animal'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: <code>@respond</code>, <code>@trait</code>, <code>@here</code>, <code>@kill</code>, <code>@reproduce</code>, <code>@neighbours</code>.</p><p>To transition an individual to another phase, simply redefine its phase variable: <code>@trait(phase) = "newphase"</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L126-L152">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@reproduce-Tuple" href="#Persephone.@reproduce-Tuple"><code>Persephone.@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 <code>reproduce!()</code>, and passes on any arguments. This can only be used nested within <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L212-L217">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@respond-Tuple{Any, Any}" href="#Persephone.@respond-Tuple{Any, Any}"><code>Persephone.@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 <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L164-L169">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@species-Tuple{Any, Any}" href="#Persephone.@species-Tuple{Any, Any}"><code>Persephone.@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' biology:</p><pre><code class="language-julia hljs">@species name begin - initialise! = initpopulation() - phase = "phase1" + @distanceto(forest) > 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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L262-L289">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@here-Tuple{Any}" href="#Persephone.@here-Tuple{Any}"><code>Persephone.@here</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@here(property)</code></pre><p>A utility macro to quickly access a property of the animal's current position (i.e. <code>landcover</code>, <code>fieldid</code>, or <code>events</code> - see the <code>Pixel</code> struct). This can only be used nested within <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L217-L223">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@initialise-Tuple{Any, Vararg{Any}}" href="#Persephone.@initialise-Tuple{Any, Vararg{Any}}"><code>Persephone.@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 <code>@species</code>. It passes the given habitat descriptor function and keyword arguments on to <code>initpopulation()</code> 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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L123-L131">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@kill-Tuple" href="#Persephone.@kill-Tuple"><code>Persephone.@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 <code>kill!()</code>, and passes on any arguments. This can only be used nested within <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L228-L233">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@landcover-Tuple{}" href="#Persephone.@landcover-Tuple{}"><code>Persephone.@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 <code>@phase</code> or <code>@habitat</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L307-L312">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@neighbours-Tuple{Any}" href="#Persephone.@neighbours-Tuple{Any}"><code>Persephone.@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 <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L251-L256">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@phase-Tuple{Any, Any}" href="#Persephone.@phase-Tuple{Any, Any}"><code>Persephone.@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 <code>@species</code>).</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.traits</code> (a dict that gives access to all species parameters).</li><li><code>pos</code> gives the animal'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: <code>@trait</code>, <code>@setphase</code>, <code>@respond</code>, <code>@here</code>, <code>@kill</code>, <code>@reproduce</code>, <code>@neighbours</code>.</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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L136-L164">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@reproduce-Tuple" href="#Persephone.@reproduce-Tuple"><code>Persephone.@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 <code>reproduce!()</code>, and passes on any arguments. This can only be used nested within <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L241-L246">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@respond-Tuple{Any, Any}" href="#Persephone.@respond-Tuple{Any, Any}"><code>Persephone.@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 <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L203-L208">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@setphase-Tuple{Any}" href="#Persephone.@setphase-Tuple{Any}"><code>Persephone.@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 <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L194-L198">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@species-Tuple{Any, Any}" href="#Persephone.@species-Tuple{Any, Any}"><code>Persephone.@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' biology:</p><pre><code class="language-julia hljs">@species name begin + + @initialise(@habitat(...)) + speciesvar1 = 3.14 ... + @phase phase1 begin ... end -end</code></pre><p>The definition body (enclosed in the begin/end block) has two sections. First comes 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 <code>@phase</code> for details).</p><p>There are two parameters that all species must define:</p><ul><li><code>initialise!</code> should specify a function that will be used to create the starting population for this species. This function must take two arguments, a species dict and an <code>AgentBasedModel</code> object. The easiest way to create this function is by using <code>initpopulation()</code>. (To save typing, <code>@initialise!()</code> can be called instead. It defines this variable and calls <code>initpopulation()</code>, all in one go.)</li><li><code>phase</code> should be a string specifying the name of the first phase that individuals of this species will be assigned to on birth.</li></ul><p>Access to the rest of the model is given by 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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L64-L100">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@trait-Tuple{Any}" href="#Persephone.@trait-Tuple{Any}"><code>Persephone.@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's trait value. This can only be used nested within <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlnature.jl#L178-L183">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="Persephone.countanimals" href="#Persephone.countanimals"><code>Persephone.countanimals</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">countanimals(pos, model, speciesname, radius=0)</code></pre><p>Count the number of animals of the given species in this location (optionally supplying a radius).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlpopulations.jl#L126-L130">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initpopulation-Tuple{Function}" href="#Persephone.initpopulation-Tuple{Function}"><code>Persephone.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 <code>@habitat</code>).</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 <code>@countanimals</code> 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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlpopulations.jl#L7-L28">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initrandompopulation-Tuple{Int64}" href="#Persephone.initrandompopulation-Tuple{Int64}"><code>Persephone.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 <code>initpopulation()</code>. 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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlpopulations.jl#L64-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.kill!" href="#Persephone.kill!"><code>Persephone.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="")</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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlpopulations.jl#L90-L95">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}" href="#Persephone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlpopulations.jl#L116-L120">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}" href="#Persephone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlpopulations.jl#L106-L110">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.reproduce!" href="#Persephone.reproduce!"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlpopulations.jl#L77-L81">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="Persephone.initecologicaldata-Tuple{}" href="#Persephone.initecologicaldata-Tuple{}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlecologicaldata.jl#L9-L13">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.saveindividualdata-Tuple{Agents.AgentBasedModel}" href="#Persephone.saveindividualdata-Tuple{Agents.AgentBasedModel}"><code>Persephone.saveindividualdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">saveindividualdata(model)</code></pre><p>Print a comma-separated set of lines 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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlecologicaldata.jl#L41-L48">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.savepopulationdata-Tuple{Agents.AgentBasedModel}" href="#Persephone.savepopulationdata-Tuple{Agents.AgentBasedModel}"><code>Persephone.savepopulationdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">savepopulationdata(model)</code></pre><p>Print a comma-separated set of lines 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/21ea890b0d857096d7183e787d85ef08433416d6/s../nature/index.htmlecologicaldata.jl#L21-L27">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../io/index.html">« Input, Output, and Settings</a><a class="docs-footer-nextpage" href="../species/index.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="Friday 6 January 2023 23:25">Friday 6 January 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 <code>@initialise!()</code>, 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 <code>@initialise!</code> and <code>@phase</code> 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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L70-L99">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.@trait-Tuple{Any}" href="#Persephone.@trait-Tuple{Any}"><code>Persephone.@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's trait value. This can only be used nested within <code>@phase</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlnature.jl#L176-L181">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="Persephone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.countanimals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">countanimals(pos, model; species="", 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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlpopulations.jl#L137-L141">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initpopulation-Tuple{Function}" href="#Persephone.initpopulation-Tuple{Function}"><code>Persephone.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 <code>@habitat</code>).</p></li><li><p><code>phase</code> determines which life phase individuals will be assigned to. If this is <code>nothing</code>, the species' 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 <code>@countanimals</code> 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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlpopulations.jl#L7-L32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initrandompopulation-Tuple{Int64}" href="#Persephone.initrandompopulation-Tuple{Int64}"><code>Persephone.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 <code>initpopulation()</code>. 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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlpopulations.jl#L70-L75">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.kill!" href="#Persephone.kill!"><code>Persephone.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="")</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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlpopulations.jl#L99-L104">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}" href="#Persephone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlpopulations.jl#L126-L130">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}" href="#Persephone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlpopulations.jl#L115-L119">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.reproduce!" href="#Persephone.reproduce!"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlpopulations.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="Persephone.initecologicaldata-Tuple{Agents.AgentBasedModel}" href="#Persephone.initecologicaldata-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlecologicaldata.jl#L9-L13">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.saveindividualdata-Tuple{Agents.AgentBasedModel}" href="#Persephone.saveindividualdata-Tuple{Agents.AgentBasedModel}"><code>Persephone.saveindividualdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">saveindividualdata(model)</code></pre><p>Print a comma-separated set of lines 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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlecologicaldata.jl#L41-L48">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.savepopulationdata-Tuple{Agents.AgentBasedModel}" href="#Persephone.savepopulationdata-Tuple{Agents.AgentBasedModel}"><code>Persephone.savepopulationdata</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">savepopulationdata(model)</code></pre><p>Print a comma-separated set of lines 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/4954227da853bdb7bd242d937841a008cca9e54b/s../nature/index.htmlecologicaldata.jl#L21-L27">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../io/index.html">« Input, Output, and Settings</a><a class="docs-footer-nextpage" href="../species/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/build/search/index.html b/docs/build/search/index.html index c35cd9340dd19f70a65a307b4c628da1e8ed1bcb..c1b636b2e7ab1b5ae18e4455c2182261be2045d1 100644 --- a/docs/build/search/index.html +++ b/docs/build/search/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Search · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action><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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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="Friday 6 January 2023 23:25">Friday 6 January 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 · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action><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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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="Friday 20 January 2023 11:33">Friday 20 January 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> diff --git a/docs/build/search_index.js b/docs/build/search_index.js index ca5334f6b61caedaaa659fcbdfcb6071ddaccbdb..d141b2e731d384e196ef8fe0a2ab37366b004740 100644 --- a/docs/build/search_index.js +++ b/docs/build/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"species-dsl/index.html#Defining-new-species","page":"Defining new species","title":"Defining new species","text":"","category":"section"},{"location":"species-dsl/index.html","page":"Defining new species","title":"Defining new species","text":"TODO","category":"page"},{"location":"species-dsl/index.html#The-Persephone-species-DSL","page":"Defining new species","title":"The Persephone species DSL","text":"","category":"section"},{"location":"species-dsl/index.html#Implementation-details","page":"Defining new species","title":"Implementation details","text":"","category":"section"},{"location":"developing/index.html#Developing-Persephone","page":"Developing Persephone","title":"Developing Persephone","text":"","category":"section"},{"location":"developing/index.html#Workflow","page":"Developing Persephone","title":"Workflow","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"Pull the current development 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 should always be in a runnable and (as far as possible) error-free state.)\nImplement your changes.\nRun run.sh to make sure the model executes without crashing. Also run the test suite (cd test; julia runtests.jl).\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/index.html#Agents.jl","page":"Developing Persephone","title":"Agents.jl","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","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/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"Tutorial on collaborating on Julia packages: https://www.matecdev.com/posts/julia-package-collaboration.html.","category":"page"},{"location":"developing/index.html#Julia-editors","page":"Developing Persephone","title":"Julia editors","text":"","category":"section"},{"location":"developing/index.html#Emacs","page":"Developing Persephone","title":"Emacs","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"There are a couple of addons that make working with Julia much nicer in Emacs:","category":"page"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","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/index.html#VSCode","page":"Developing Persephone","title":"VSCode","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"See here.","category":"page"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"TODO: add more detail.","category":"page"},{"location":"developing/index.html#Other-useful-stuff","page":"Developing Persephone","title":"Other useful stuff","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","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.\ngit-bug is a commandline bug tracker that integrates directly with git. It can also be used as a local interface to Gitlab issues. To install on Linux, download the binary, copy it to /usr/local/bin/git-bug, and set it as executable with chmod +x /usr/local/bin/git-bug. To set up Gitlab integration, run git bug bridge configure from within the relevant repository.","category":"page"},{"location":"nature/#Nature","page":"Nature","title":"Nature","text":"","category":"section"},{"location":"nature/#nature.jl","page":"Nature","title":"nature.jl","text":"","category":"section"},{"location":"nature/","page":"Nature","title":"Nature","text":"This file is responsible for managing the animal modules.","category":"page"},{"location":"nature/","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/nature.jl\"]","category":"page"},{"location":"nature/#Persephone.Animal","page":"Nature","title":"Persephone.Animal","text":"Animal\n\nThis is the generic agent type for all animals. Species are differentiated by trait dictionaries passed by them during initialisation.\n\n\n\n\n\n","category":"type"},{"location":"nature/#Persephone.animalid-Tuple{Animal}","page":"Nature","title":"Persephone.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/#Persephone.initnature!-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.initnature!","text":"initnature!(model)\n\nInitialise the model with all simulated animal populations.\n\n\n\n\n\n","category":"method"},{"location":"nature/#Persephone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}","page":"Nature","title":"Persephone.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/#Persephone.@countanimals","page":"Nature","title":"Persephone.@countanimals","text":"@countanimals(speciesname, 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/#Persephone.@cropheight-Tuple{}","page":"Nature","title":"Persephone.@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/#Persephone.@croptype-Tuple{}","page":"Nature","title":"Persephone.@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/#Persephone.@distanceto-Tuple{Any}","page":"Nature","title":"Persephone.@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/#Persephone.@distancetoedge-Tuple{}","page":"Nature","title":"Persephone.@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/#Persephone.@habitat-Tuple{Any}","page":"Nature","title":"Persephone.@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/#Persephone.@here-Tuple{Any}","page":"Nature","title":"Persephone.@here","text":"@here(property)\n\nA utility macro to quickly access a property of the animal's current position. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/#Persephone.@initialise!-Tuple{Any, Vararg{Any}}","page":"Nature","title":"Persephone.@initialise!","text":"@initialise!(habitatdescriptor; kwargs...)\n\nThis is a wrapper around initpopulation() that can be called within the body of a @species definition block. It saves the user having to define the required initialise! variable by hand.\n\n\n\n\n\n","category":"macro"},{"location":"nature/#Persephone.@kill-Tuple","page":"Nature","title":"Persephone.@kill","text":"@kill\n\nKill this animal. 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/#Persephone.@landcover-Tuple{}","page":"Nature","title":"Persephone.@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/#Persephone.@neighbours-Tuple{Any}","page":"Nature","title":"Persephone.@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/#Persephone.@phase-Tuple{Any, Any}","page":"Nature","title":"Persephone.@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.traits (a dict that gives access to all species parameters).\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: @respond, @trait, @here, @kill, @reproduce, @neighbours.\n\nTo transition an individual to another phase, simply redefine its phase variable: @trait(phase) = \"newphase\".\n\n\n\n\n\n","category":"macro"},{"location":"nature/#Persephone.@reproduce-Tuple","page":"Nature","title":"Persephone.@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/#Persephone.@respond-Tuple{Any, Any}","page":"Nature","title":"Persephone.@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/#Persephone.@species-Tuple{Any, Any}","page":"Nature","title":"Persephone.@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 initialise! = initpopulation()\n phase = \"phase1\"\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 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 @phase for details).\n\nThere are two parameters that all species must define:\n\ninitialise! should specify a function that will be used to create the starting population for this species. This function must take two arguments, a species dict and an AgentBasedModel object. The easiest way to create this function is by using initpopulation(). (To save typing, @initialise!() can be called instead. It defines this variable and calls initpopulation(), all in one go.)\nphase should be a string specifying the name of the first phase that individuals of this species will be assigned to on birth.\n\nAccess to the rest of the model is given by the model variable (an object of type AgentBasedModel).\n\n\n\n\n\n","category":"macro"},{"location":"nature/#Persephone.@trait-Tuple{Any}","page":"Nature","title":"Persephone.@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/#populations.jl","page":"Nature","title":"populations.jl","text":"","category":"section"},{"location":"nature/","page":"Nature","title":"Nature","text":"This file contains a set of utility functions for species, including initialisation, reproduction, and mortality.","category":"page"},{"location":"nature/","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/populations.jl\"]","category":"page"},{"location":"nature/#Persephone.countanimals","page":"Nature","title":"Persephone.countanimals","text":"countanimals(pos, model, speciesname, radius=0)\n\nCount the number of animals of the given species in this location (optionally supplying a radius).\n\n\n\n\n\n","category":"function"},{"location":"nature/#Persephone.initpopulation-Tuple{Function}","page":"Nature","title":"Persephone.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).\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/#Persephone.initrandompopulation-Tuple{Int64}","page":"Nature","title":"Persephone.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/#Persephone.kill!","page":"Nature","title":"Persephone.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/#Persephone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persephone.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/#Persephone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persephone.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/#Persephone.reproduce!","page":"Nature","title":"Persephone.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/#ecologicaldata.jl","page":"Nature","title":"ecologicaldata.jl","text":"","category":"section"},{"location":"nature/","page":"Nature","title":"Nature","text":"This file contains a set of life-history related utility functions needed by species.","category":"page"},{"location":"nature/","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/ecologicaldata.jl\"]","category":"page"},{"location":"nature/#Persephone.initecologicaldata-Tuple{}","page":"Nature","title":"Persephone.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/#Persephone.saveindividualdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.saveindividualdata","text":"saveindividualdata(model)\n\nPrint a comma-separated set of lines 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/#Persephone.savepopulationdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.savepopulationdata","text":"savepopulationdata(model)\n\nPrint a comma-separated set of lines 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":"simulation/index.html#Simulation","page":"Simulation","title":"Simulation","text":"","category":"section"},{"location":"simulation/index.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/index.html#simulation.jl","page":"Simulation","title":"simulation.jl","text":"","category":"section"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"This file includes the basal functions for initialising and running simulations.","category":"page"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"Modules = [Persephone]\nPages = [\"core/simulation.jl\"]","category":"page"},{"location":"simulation/index.html#Persephone.finalise-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Persephone.initialise","page":"Simulation","title":"Persephone.initialise","text":"initialise(config, seed)\n\nInitialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object.\n\n\n\n\n\n","category":"function"},{"location":"simulation/index.html#Persephone.simulate","page":"Simulation","title":"Persephone.simulate","text":"simulate(config)\n\nCarry out a complete simulation run.\n\n\n\n\n\n","category":"function"},{"location":"simulation/index.html#Persephone.stepsimulation!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.stepsimulation!","text":"stepsimulation!(model)\n\nExecute one update of the model.\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#landscape.jl","page":"Simulation","title":"landscape.jl","text":"","category":"section"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"This file manages the landscape maps that underlie the model.","category":"page"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"Modules = [Persephone]\nPages = [\"core/landscape.jl\"]","category":"page"},{"location":"simulation/index.html#Persephone.EventType","page":"Simulation","title":"Persephone.EventType","text":"The types of landscape event that can be simulated\n\n\n\n\n\n","category":"type"},{"location":"simulation/index.html#Persephone.FarmEvent","page":"Simulation","title":"Persephone.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/index.html#Persephone.LandCover","page":"Simulation","title":"Persephone.LandCover","text":"The land cover classes encoded in the Mundialis Sentinel data.\n\n\n\n\n\n","category":"type"},{"location":"simulation/index.html#Persephone.Pixel","page":"Simulation","title":"Persephone.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/index.html#Persephone.createevent!","page":"Simulation","title":"Persephone.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/index.html#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}","page":"Simulation","title":"Persephone.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/index.html#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persephone.LandCover}","page":"Simulation","title":"Persephone.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/index.html#Persephone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Persephone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Persephone.initlandscape-Tuple{}","page":"Simulation","title":"Persephone.initlandscape","text":"initlandscape()\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/index.html#Persephone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Persephone.updateevents!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Farm-submodel","page":"Farm submodel","title":"Farm submodel","text":"","category":"section"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"Eventually, Persephone will include multiple farm-decision submodels. At the moment, we are only working with a very basic mock-up.","category":"page"},{"location":"farm/index.html#farm.jl","page":"Farm submodel","title":"farm.jl","text":"","category":"section"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"This file is responsible for managing the farm module(s).","category":"page"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"Modules = [Persephone]\nPages = [\"farm/index.htmlfarm.jl\"]","category":"page"},{"location":"farm/index.html#Persephone.initfarms!-Tuple{Agents.AgentBasedModel}","page":"Farm submodel","title":"Persephone.initfarms!","text":"initfarms!(model)\n\nInitialise the model with a set of farm agents.\n\n\n\n\n\n","category":"method"},{"location":"farm/index.html#Persephone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}","page":"Farm submodel","title":"Persephone.stepagent!","text":"stepagent!(farmer, model)\n\nUpdate a farmer by one day.\n\n\n\n\n\n","category":"method"},{"location":"architecture/index.html#Source-code-architecture","page":"Source code architecture","title":"Source code architecture","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"TODO","category":"page"},{"location":"architecture/index.html#Model-components","page":"Source code architecture","title":"Model components","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"core\nfarm\nnature\ncrop","category":"page"},{"location":"architecture/index.html#Important-implementation-details","page":"Source code architecture","title":"Important implementation details","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"configuration/param()\noutput data\nAgents.jl","category":"page"},{"location":"crops/index.html#Crop-submodel","page":"Crop submodel","title":"Crop submodel","text":"","category":"section"},{"location":"crops/index.html","page":"Crop submodel","title":"Crop submodel","text":"Eventually, Persephone 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/index.html#crops.jl","page":"Crop submodel","title":"crops.jl","text":"","category":"section"},{"location":"crops/index.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/index.html","page":"Crop submodel","title":"Crop submodel","text":"Modules = [Persephone]\nPages = [\"crop/crops.jl\"]","category":"page"},{"location":"crops/index.html#Persephone.CropType","page":"Crop submodel","title":"Persephone.CropType","text":"The crop types simulated by the model\n\n\n\n\n\n","category":"type"},{"location":"crops/index.html#Persephone.FarmPlot","page":"Crop submodel","title":"Persephone.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/index.html#Persephone.averagefieldsize-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.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/index.html#Persephone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.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/index.html#Persephone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.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/index.html#Persephone.initfields!-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.initfields!","text":"initfields!(model)\n\nInitialise the model with its farm plots.\n\n\n\n\n\n","category":"method"},{"location":"crops/index.html#Persephone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.stepagent!","text":"stepagent!(farmplot, model)\n\nUpdate a farm plot by one day.\n\n\n\n\n\n","category":"method"},{"location":"","page":"Introduction","title":"Introduction","text":"CurrentModule = Persephone","category":"page"},{"location":"#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"Persephone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).","category":"page"},{"location":"","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":"#Running-the-model","page":"Introduction","title":"Running the model","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"To run a single experiment, execute:","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"./run.jl -c <CONFIG>","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"Other commandline arguments are:","category":"page"},{"location":"","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":"#Model-input","page":"Introduction","title":"Model input","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"TODO: describe config & map files","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"Last updated: 2023-01-06 (commit 21ea890) ","category":"page"},{"location":"io/index.html#Input,-Output,-and-Settings","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"","category":"section"},{"location":"io/index.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/index.html#parameters.toml","page":"Input, Output, and Settings","title":"parameters.toml","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"This is the default configuration file for Persephone, containing all model parameters. The syntax is described here: https://toml.io/index.htmlen/","category":"page"},{"location":"io/index.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/index.html#input.jl","page":"Input, Output, and Settings","title":"input.jl","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persephone]\nPages = [\"core/input.jl\"]","category":"page"},{"location":"io/index.html#Persephone.getsettings-Tuple{String}","page":"Input, Output, and Settings","title":"Persephone.getsettings","text":"getsettings(configfile)\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":"method"},{"location":"io/index.html#Persephone.parsecommandline-Tuple{}","page":"Input, Output, and Settings","title":"Persephone.parsecommandline","text":"parsecommandline()\n\nCertain software parameters can be set via the commandline.\n\n\n\n\n\n","category":"method"},{"location":"io/index.html#output.jl","page":"Input, Output, and Settings","title":"output.jl","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persephone]\nPages = [\"core/output.jl\"]","category":"page"},{"location":"io/index.html#Persephone.DataOutput","page":"Input, Output, and Settings","title":"Persephone.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/index.html#Persephone.setupdatadir-Tuple{}","page":"Input, Output, and Settings","title":"Persephone.setupdatadir","text":"setupdatadir()\n\nCreates the output directory and copies relevant files into it.\n\n\n\n\n\n","category":"method"},{"location":"species/index.html#Species","page":"Species","title":"Species","text":"","category":"section"},{"location":"species/index.html","page":"Species","title":"Species","text":"The ecological submodel in Persephone simulates a range of species in agricultural landscapes.","category":"page"},{"location":"species/index.html#Skylark","page":"Species","title":"Skylark","text":"","category":"section"},{"location":"species/index.html","page":"Species","title":"Species","text":"Modules = [Persephone]\nPages = [\"nature/species/index.htmlskylark.jl\"]","category":"page"}] +[{"location":"species-dsl/index.html#Defining-new-species","page":"Defining new species","title":"Defining new species","text":"","category":"section"},{"location":"species-dsl/index.html","page":"Defining new species","title":"Defining new species","text":"TODO","category":"page"},{"location":"species-dsl/index.html#The-Persephone-species-DSL","page":"Defining new species","title":"The Persephone species DSL","text":"","category":"section"},{"location":"species-dsl/index.html#Implementation-details","page":"Defining new species","title":"Implementation details","text":"","category":"section"},{"location":"developing/index.html#Developing-Persephone","page":"Developing Persephone","title":"Developing Persephone","text":"","category":"section"},{"location":"developing/index.html#Workflow","page":"Developing Persephone","title":"Workflow","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"Pull the current development 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 should always be in a runnable and (as far as possible) error-free state.)\nImplement your changes.\nRun run.sh to make sure the model executes without crashing. Also run the test suite (cd test; julia runtests.jl).\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/index.html#Agents.jl","page":"Developing Persephone","title":"Agents.jl","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","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/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"Tutorial on collaborating on Julia packages: https://www.matecdev.com/posts/julia-package-collaboration.html.","category":"page"},{"location":"developing/index.html#Julia-editors","page":"Developing Persephone","title":"Julia editors","text":"","category":"section"},{"location":"developing/index.html#Emacs","page":"Developing Persephone","title":"Emacs","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"There are a couple of addons that make working with Julia much nicer in Emacs:","category":"page"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","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/index.html#VSCode","page":"Developing Persephone","title":"VSCode","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"See here.","category":"page"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"TODO: add more detail.","category":"page"},{"location":"developing/index.html#Other-useful-stuff","page":"Developing Persephone","title":"Other useful stuff","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","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.\ngit-bug is a commandline bug tracker that integrates directly with git. It can also be used as a local interface to Gitlab issues. To install on Linux, download the binary, copy it to /usr/local/bin/git-bug, and set it as executable with chmod +x /usr/local/bin/git-bug. To set up Gitlab integration, run git bug bridge configure from within the relevant repository.","category":"page"},{"location":"nature/index.html#Nature","page":"Nature","title":"Nature","text":"","category":"section"},{"location":"nature/index.html#nature.jl","page":"Nature","title":"nature.jl","text":"","category":"section"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"This file is responsible for managing the animal modules.","category":"page"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/index.htmlnature.jl\"]","category":"page"},{"location":"nature/index.html#Persephone.Animal","page":"Nature","title":"Persephone.Animal","text":"Animal\n\nThis is the generic agent type for all animals. Species are differentiated by trait dictionaries passed by them during initialisation.\n\n\n\n\n\n","category":"type"},{"location":"nature/index.html#Persephone.animalid-Tuple{Animal}","page":"Nature","title":"Persephone.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/index.html#Persephone.initnature!-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.initnature!","text":"initnature!(model)\n\nInitialise the model with all simulated animal populations.\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}","page":"Nature","title":"Persephone.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/index.html#Persephone.@countanimals-Tuple","page":"Nature","title":"Persephone.@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/index.html#Persephone.@cropheight-Tuple{}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@croptype-Tuple{}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@distanceto-Tuple{Any}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@distancetoedge-Tuple{}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@habitat-Tuple{Any}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@here-Tuple{Any}","page":"Nature","title":"Persephone.@here","text":"@here(property)\n\nA utility macro to quickly access a property of the animal's current position (i.e. landcover, fieldid, or events - see the Pixel struct). This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@initialise-Tuple{Any, Vararg{Any}}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@kill-Tuple","page":"Nature","title":"Persephone.@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/index.html#Persephone.@landcover-Tuple{}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@neighbours-Tuple{Any}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@phase-Tuple{Any, Any}","page":"Nature","title":"Persephone.@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.traits (a dict that gives access to all species parameters).\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, @here, @kill, @reproduce, @neighbours.\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/index.html#Persephone.@reproduce-Tuple","page":"Nature","title":"Persephone.@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/index.html#Persephone.@respond-Tuple{Any, Any}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@setphase-Tuple{Any}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@species-Tuple{Any, Any}","page":"Nature","title":"Persephone.@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/index.html#Persephone.@trait-Tuple{Any}","page":"Nature","title":"Persephone.@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/index.html#populations.jl","page":"Nature","title":"populations.jl","text":"","category":"section"},{"location":"nature/index.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/index.html","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/index.htmlpopulations.jl\"]","category":"page"},{"location":"nature/index.html#Persephone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Nature","title":"Persephone.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/index.html#Persephone.initpopulation-Tuple{Function}","page":"Nature","title":"Persephone.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/index.html#Persephone.initrandompopulation-Tuple{Int64}","page":"Nature","title":"Persephone.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/index.html#Persephone.kill!","page":"Nature","title":"Persephone.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/index.html#Persephone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persephone.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/index.html#Persephone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persephone.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/index.html#Persephone.reproduce!","page":"Nature","title":"Persephone.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/index.html#ecologicaldata.jl","page":"Nature","title":"ecologicaldata.jl","text":"","category":"section"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"This file contains a set of life-history related utility functions needed by species.","category":"page"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/index.htmlecologicaldata.jl\"]","category":"page"},{"location":"nature/index.html#Persephone.initecologicaldata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.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/index.html#Persephone.saveindividualdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.saveindividualdata","text":"saveindividualdata(model)\n\nPrint a comma-separated set of lines 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/index.html#Persephone.savepopulationdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.savepopulationdata","text":"savepopulationdata(model)\n\nPrint a comma-separated set of lines 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":"simulation/index.html#Simulation","page":"Simulation","title":"Simulation","text":"","category":"section"},{"location":"simulation/index.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/index.html#simulation.jl","page":"Simulation","title":"simulation.jl","text":"","category":"section"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"This file includes the basal functions for initialising and running simulations.","category":"page"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"Modules = [Persephone]\nPages = [\"core/simulation.jl\"]","category":"page"},{"location":"simulation/index.html#Persephone.PARAMFILE","page":"Simulation","title":"Persephone.PARAMFILE","text":"The file that stores all default parameters.\n\n\n\n\n\n","category":"constant"},{"location":"simulation/index.html#Persephone.finalise-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Persephone.initialise","page":"Simulation","title":"Persephone.initialise","text":"initialise(config=PARAMFILE, seed=nothing)\n\nInitialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object. Optionally allows specifying the configuration file and overriding the seed parameter.\n\n\n\n\n\n","category":"function"},{"location":"simulation/index.html#Persephone.simulate","page":"Simulation","title":"Persephone.simulate","text":"simulate(config=PARAMFILE, seed=nothing)\n\nCarry out a complete simulation run, optionally specifying a configuration file and a seed for the RNG.\n\n\n\n\n\n","category":"function"},{"location":"simulation/index.html#Persephone.stepsimulation!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.stepsimulation!","text":"stepsimulation!(model)\n\nExecute one update of the model.\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#landscape.jl","page":"Simulation","title":"landscape.jl","text":"","category":"section"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"This file manages the landscape maps that underlie the model.","category":"page"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"Modules = [Persephone]\nPages = [\"core/landscape.jl\"]","category":"page"},{"location":"simulation/index.html#Persephone.EventType","page":"Simulation","title":"Persephone.EventType","text":"The types of landscape event that can be simulated\n\n\n\n\n\n","category":"type"},{"location":"simulation/index.html#Persephone.FarmEvent","page":"Simulation","title":"Persephone.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/index.html#Persephone.LandCover","page":"Simulation","title":"Persephone.LandCover","text":"The land cover classes encoded in the Mundialis Sentinel data.\n\n\n\n\n\n","category":"type"},{"location":"simulation/index.html#Persephone.Pixel","page":"Simulation","title":"Persephone.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/index.html#Persephone.createevent!","page":"Simulation","title":"Persephone.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/index.html#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}","page":"Simulation","title":"Persephone.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/index.html#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persephone.LandCover}","page":"Simulation","title":"Persephone.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/index.html#Persephone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Persephone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Persephone.initlandscape-Tuple{String, String}","page":"Simulation","title":"Persephone.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/index.html#Persephone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Persephone.updateevents!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.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/index.html#Farm-submodel","page":"Farm submodel","title":"Farm submodel","text":"","category":"section"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"Eventually, Persephone will include multiple farm-decision submodels. At the moment, we are only working with a very basic mock-up.","category":"page"},{"location":"farm/index.html#farm.jl","page":"Farm submodel","title":"farm.jl","text":"","category":"section"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"This file is responsible for managing the farm module(s).","category":"page"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"Modules = [Persephone]\nPages = [\"farm/index.htmlfarm.jl\"]","category":"page"},{"location":"farm/index.html#Persephone.initfarms!-Tuple{Agents.AgentBasedModel}","page":"Farm submodel","title":"Persephone.initfarms!","text":"initfarms!(model)\n\nInitialise the model with a set of farm agents.\n\n\n\n\n\n","category":"method"},{"location":"farm/index.html#Persephone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}","page":"Farm submodel","title":"Persephone.stepagent!","text":"stepagent!(farmer, model)\n\nUpdate a farmer by one day.\n\n\n\n\n\n","category":"method"},{"location":"architecture/index.html#Source-code-architecture","page":"Source code architecture","title":"Source code architecture","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"TODO","category":"page"},{"location":"architecture/index.html#Model-components","page":"Source code architecture","title":"Model components","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"core\nfarm\nnature\ncrop","category":"page"},{"location":"architecture/index.html#Important-implementation-details","page":"Source code architecture","title":"Important implementation details","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"configuration/param()\noutput data\nAgents.jl","category":"page"},{"location":"crops/index.html#Crop-submodel","page":"Crop submodel","title":"Crop submodel","text":"","category":"section"},{"location":"crops/index.html","page":"Crop submodel","title":"Crop submodel","text":"Eventually, Persephone 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/index.html#crops.jl","page":"Crop submodel","title":"crops.jl","text":"","category":"section"},{"location":"crops/index.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/index.html","page":"Crop submodel","title":"Crop submodel","text":"Modules = [Persephone]\nPages = [\"crop/crops.jl\"]","category":"page"},{"location":"crops/index.html#Persephone.CropType","page":"Crop submodel","title":"Persephone.CropType","text":"The crop types simulated by the model\n\n\n\n\n\n","category":"type"},{"location":"crops/index.html#Persephone.FarmPlot","page":"Crop submodel","title":"Persephone.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/index.html#Persephone.averagefieldsize-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.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/index.html#Persephone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.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/index.html#Persephone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.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/index.html#Persephone.initfields!-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.initfields!","text":"initfields!(model)\n\nInitialise the model with its farm plots.\n\n\n\n\n\n","category":"method"},{"location":"crops/index.html#Persephone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.stepagent!","text":"stepagent!(farmplot, model)\n\nUpdate a farm plot by one day.\n\n\n\n\n\n","category":"method"},{"location":"","page":"Introduction","title":"Introduction","text":"CurrentModule = Persephone","category":"page"},{"location":"#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"Persephone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).","category":"page"},{"location":"","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":"#Running-the-model","page":"Introduction","title":"Running the model","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"To run a single experiment, execute:","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"./run.jl -c <CONFIG>","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"Other commandline arguments are:","category":"page"},{"location":"","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":"#Model-input","page":"Introduction","title":"Model input","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"TODO: describe config & map files","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"Last updated: 2023-01-20 (commit 4954227) ","category":"page"},{"location":"io/index.html#Input,-Output,-and-Settings","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"","category":"section"},{"location":"io/index.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/index.html#parameters.toml","page":"Input, Output, and Settings","title":"parameters.toml","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"This is the default configuration file for Persephone, containing all model parameters. The syntax is described here: https://toml.io/index.htmlen/","category":"page"},{"location":"io/index.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/index.html#input.jl","page":"Input, Output, and Settings","title":"input.jl","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persephone]\nPages = [\"core/input.jl\"]","category":"page"},{"location":"io/index.html#Persephone.getsettings","page":"Input, Output, and Settings","title":"Persephone.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/index.html#Persephone.parsecommandline-Tuple{}","page":"Input, Output, and Settings","title":"Persephone.parsecommandline","text":"parsecommandline()\n\nCertain software parameters can be set via the commandline.\n\n\n\n\n\n","category":"method"},{"location":"io/index.html#Persephone.@param-Tuple{Any}","page":"Input, Output, and Settings","title":"Persephone.@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 that this macro only works in a context where the model object is available.\n\n\n\n\n\n","category":"macro"},{"location":"io/index.html#output.jl","page":"Input, Output, and Settings","title":"output.jl","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persephone]\nPages = [\"core/output.jl\"]","category":"page"},{"location":"io/index.html#Persephone.DataOutput","page":"Input, Output, and Settings","title":"Persephone.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/index.html#Persephone.newdataoutput-Tuple{Agents.AgentBasedModel, String, String, Function, String}","page":"Input, Output, and Settings","title":"Persephone.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/index.html#Persephone.outputdata-Tuple{Agents.AgentBasedModel}","page":"Input, Output, and Settings","title":"Persephone.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/index.html#Persephone.setupdatadir-Tuple{Agents.AgentBasedModel}","page":"Input, Output, and Settings","title":"Persephone.setupdatadir","text":"setupdatadir()\n\nCreates the output directory and copies relevant files into it.\n\n\n\n\n\n","category":"method"},{"location":"species/index.html#Species","page":"Species","title":"Species","text":"","category":"section"},{"location":"species/index.html","page":"Species","title":"Species","text":"The ecological submodel in Persephone simulates a range of species in agricultural landscapes.","category":"page"},{"location":"species/index.html#Skylark","page":"Species","title":"Skylark","text":"","category":"section"},{"location":"species/index.html","page":"Species","title":"Species","text":"Modules = [Persephone]\nPages = [\"nature/index.htmlspecies/index.htmlskylark.jl\"]","category":"page"}] } diff --git a/docs/build/simulation/index.html b/docs/build/simulation/index.html index 6e72151fa01dbdad4355079297f7ac3f1c810049..7f49220ca188c515923543fad27c920d8d15c3a0 100644 --- a/docs/build/simulation/index.html +++ b/docs/build/simulation/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Simulation · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li class="is-active"><a class="tocitem" href>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/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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="Persephone.finalise-Tuple{Agents.AgentBasedModel}" href="#Persephone.finalise-Tuple{Agents.AgentBasedModel}"><code>Persephone.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't do anything except print some information.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/src/core/simulation.jl#L52-L56">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initialise" href="#Persephone.initialise"><code>Persephone.initialise</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">initialise(config, seed)</code></pre><p>Initialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/src/core/simulation.jl#L6-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.simulate" href="#Persephone.simulate"><code>Persephone.simulate</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">simulate(config)</code></pre><p>Carry out a complete simulation run.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/21ea890b0d857096d7183e787d85ef08433416d6/src/core/simulation.jl#L64-L68">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.stepsimulation!-Tuple{Agents.AgentBasedModel}" href="#Persephone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/simulation.jl#L36-L40">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="Persephone.EventType" href="#Persephone.EventType"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.FarmEvent" href="#Persephone.FarmEvent"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L26-L31">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.LandCover" href="#Persephone.LandCover"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L6">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.Pixel" href="#Persephone.Pixel"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L13-L19">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.createevent!" href="#Persephone.createevent!"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L86-L90">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}" href="#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L119-L124">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persephone.LandCover}" href="#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persephone.LandCover}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L153-L158">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L164-L169">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L108-L112">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initlandscape-Tuple{}" href="#Persephone.initlandscape-Tuple{}"><code>Persephone.initlandscape</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initlandscape()</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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L38-L43">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L99-L103">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.updateevents!-Tuple{Agents.AgentBasedModel}" href="#Persephone.updateevents!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/21ea890b0d857096d7183e787d85ef08433416d6/src/core/landscape.jl#L65-L69">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../species-dsl/index.html">« Defining new species</a><a class="docs-footer-nextpage" href="../io/index.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="Friday 6 January 2023 23:25">Friday 6 January 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 · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li class="is-active"><a class="tocitem" href>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/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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="Persephone.PARAMFILE" href="#Persephone.PARAMFILE"><code>Persephone.PARAMFILE</code></a> — <span class="docstring-category">Constant</span></header><section><div><p>The file that stores all default parameters.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/src/core/simulation.jl#L6-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.finalise-Tuple{Agents.AgentBasedModel}" href="#Persephone.finalise-Tuple{Agents.AgentBasedModel}"><code>Persephone.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't do anything except print some information.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/src/core/simulation.jl#L63-L67">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initialise" href="#Persephone.initialise"><code>Persephone.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. Optionally allows specifying the configuration file and overriding the <code>seed</code> parameter.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/src/core/simulation.jl#L13-L19">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.simulate" href="#Persephone.simulate"><code>Persephone.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>Carry out a complete simulation run, optionally specifying a configuration file and a seed for the RNG.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.idiv.de/xo30xoqa/persephone/blob/4954227da853bdb7bd242d937841a008cca9e54b/src/core/simulation.jl#L75-L80">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.stepsimulation!-Tuple{Agents.AgentBasedModel}" href="#Persephone.stepsimulation!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/simulation.jl#L43-L47">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="Persephone.EventType" href="#Persephone.EventType"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.FarmEvent" href="#Persephone.FarmEvent"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L26-L31">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.LandCover" href="#Persephone.LandCover"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L6">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.Pixel" href="#Persephone.Pixel"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L13-L19">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.createevent!" href="#Persephone.createevent!"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L86-L90">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}" href="#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L119-L124">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persephone.LandCover}" href="#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persephone.LandCover}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L153-L158">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L164-L169">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L108-L112">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.initlandscape-Tuple{String, String}" href="#Persephone.initlandscape-Tuple{String, String}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L38-L43">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}" href="#Persephone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L99-L103">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.updateevents!-Tuple{Agents.AgentBasedModel}" href="#Persephone.updateevents!-Tuple{Agents.AgentBasedModel}"><code>Persephone.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/4954227da853bdb7bd242d937841a008cca9e54b/src/core/landscape.jl#L65-L69">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../species-dsl/index.html">« Defining new species</a><a class="docs-footer-nextpage" href="../io/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/build/species-dsl/index.html b/docs/build/species-dsl/index.html index 35591c07007a1d0945d93bb1b43a5ed3b2d87bc9..03f2da6cd79d9622ab5cb9990f5b01aa22194617 100644 --- a/docs/build/species-dsl/index.html +++ b/docs/build/species-dsl/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Defining new species · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li class="is-active"><a class="tocitem" href>Defining new species</a><ul class="internal"><li><a class="tocitem" href="#The-Persephone-species-DSL"><span>The Persephone 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/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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>Defining new species</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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><p><em>TODO</em></p><h2 id="The-Persephone-species-DSL"><a class="docs-heading-anchor" href="#The-Persephone-species-DSL">The Persephone species DSL</a><a id="The-Persephone-species-DSL-1"></a><a class="docs-heading-anchor-permalink" href="#The-Persephone-species-DSL" title="Permalink"></a></h2><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></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../architecture/index.html">« Source code architecture</a><a class="docs-footer-nextpage" href="../simulation/index.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="Friday 6 January 2023 23:25">Friday 6 January 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>Defining new species · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li class="is-active"><a class="tocitem" href>Defining new species</a><ul class="internal"><li><a class="tocitem" href="#The-Persephone-species-DSL"><span>The Persephone 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/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li><a class="tocitem" href="../species/index.html">Species</a></li></ul></li><li><a class="tocitem" href="../crops/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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>Defining new species</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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><p><em>TODO</em></p><h2 id="The-Persephone-species-DSL"><a class="docs-heading-anchor" href="#The-Persephone-species-DSL">The Persephone species DSL</a><a id="The-Persephone-species-DSL-1"></a><a class="docs-heading-anchor-permalink" href="#The-Persephone-species-DSL" title="Permalink"></a></h2><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></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../architecture/index.html">« Source code architecture</a><a class="docs-footer-nextpage" href="../simulation/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/build/species/index.html b/docs/build/species/index.html index 63081363d86dedd6e295d5c72b30d19073cd11b1..496e4c31c8354541dea28b84cc00395c5d73d6b0 100644 --- a/docs/build/species/index.html +++ b/docs/build/species/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Species · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li class="is-active"><a class="tocitem" href>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/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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 Persephone 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/index.html">« Nature</a><a class="docs-footer-nextpage" href="../crops/index.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="Friday 6 January 2023 23:25">Friday 6 January 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 · Persephone</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="Persephone logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../index.html">Persephone</a></span></div><form class="docs-search" action="../search/index.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><span class="tocitem">Developing</span><ul><li><a class="tocitem" href="../developing/index.html">Developing Persephone</a></li><li><a class="tocitem" href="../architecture/index.html">Source code architecture</a></li><li><a class="tocitem" href="../species-dsl/index.html">Defining new species</a></li></ul></li><li><span class="tocitem">Core</span><ul><li><a class="tocitem" href="../simulation/index.html">Simulation</a></li><li><a class="tocitem" href="../io/index.html">Input, Output, and Settings</a></li></ul></li><li><span class="tocitem">Nature</span><ul><li><a class="tocitem" href="../nature/index.html">Nature</a></li><li class="is-active"><a class="tocitem" href>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/index.html">Crop submodel</a></li><li><a class="tocitem" href="../farm/index.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</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>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 Persephone 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/index.html">« Nature</a><a class="docs-footer-nextpage" href="../crops/index.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="Friday 20 January 2023 11:33">Friday 20 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/docs/builddocs.jl b/docs/builddocs.jl index 63a545a8941a06788f317f557bcd80ed13219544..9d78e36062b5d66b28e8fb01cf3af4f651311306 100644 --- a/docs/builddocs.jl +++ b/docs/builddocs.jl @@ -5,6 +5,8 @@ push!(LOAD_PATH, "../src/") using Documenter, Persephone +#TODO add ODD +#FIXME links to source code don't work makedocs(sitename="Persephone", modules = [Persephone], repo = "https://git.idiv.de/xo30xoqa/persephone/blob/{commit}{path}#{line}", diff --git a/docs/src/index.md b/docs/src/index.md index dafb246d518afc83e2d3e088196d5839c99cd749..ec4bb9c2326c0e1834bb6059873f004d7ac8ca71 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -40,4 +40,4 @@ optional arguments: *TODO: describe config & map files* -*Last updated: 2023-01-06 (commit 21ea890)* +*Last updated: 2023-01-20 (commit 4954227)*