Skip to content
Snippets Groups Projects
Commit a91f39e4 authored by xo30xoqa's avatar xo30xoqa
Browse files

Set up Documenter.jl to create HTML documentation

parent a958dd60
Branches
Tags
No related merge requests found
Showing
with 16248 additions and 1 deletion
......@@ -50,7 +50,6 @@ optional arguments:
verbosity: "debug", "info", or "quiet"
--version show version information and exit
-h, --help show this help message and exit
```
To run the test suite, do the following:
......
#!/bin/bash
echo "Preprocessing..."
# include a date stamp with the latest commit
sed -i -e "s/\*Last updated:.*/\*Last updated: $(git log --format="%cd (commit %h)" --date=short -1)\* /" src/index.md
echo "Building documentation..."
julia builddocs.jl
# Disabling the pretty-url feature of `makedocs` doesn't work, so we have to
# revert it manually
echo "Postprocessing..."
sed -i -e "s/io\//io\/index.html/g" build/index.html build/search_index.js
sed -i -e "s/developing\//developing\/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/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
sed -i -e "s/simulation\//simulation\/index.html/g" build/index.html build/search_index.js
sed -i -e "s/search\//search\/index.html/g" build/index.html build/search_index.js
sed -i -e "s/href=\"..\/\"/href=\"..\/index.html\"/g" build/*/index.html
sed -i -e "s/..\/io\//..\/io\/index.html/g" build/*/index.html
sed -i -e "s/..\/developing\//..\/developing\/index.html/g" build/*/index.html
sed -i -e "s/..\/nature\//..\/nature\/index.html/g" build/*/index.html
sed -i -e "s/..\/species\//..\/species\/index.html/g" build/*/index.html
sed -i -e "s/..\/crops\//..\/crops\/index.html/g" build/*/index.html
sed -i -e "s/..\/farm\//..\/farm\/index.html/g" build/*/index.html
sed -i -e "s/..\/simulation\//..\/simulation\/index.html/g" build/*/index.html
sed -i -e "s/..\/search\//..\/search\/index.html/g" build/*/index.html
echo "Done."
// Generated by Documenter.jl
requirejs.config({
paths: {
'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/julia.min',
'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min',
'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min',
'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/contrib/auto-render.min',
'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min',
'katex': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min',
'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min',
'highlight-julia-repl': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/julia-repl.min',
},
shim: {
"highlight-julia": {
"deps": [
"highlight"
]
},
"katex-auto-render": {
"deps": [
"katex"
]
},
"headroom-jquery": {
"deps": [
"jquery",
"headroom"
]
},
"highlight-julia-repl": {
"deps": [
"highlight"
]
}
}
});
////////////////////////////////////////////////////////////////////////////////
require(['jquery', 'katex', 'katex-auto-render'], function($, katex, renderMathInElement) {
$(document).ready(function() {
renderMathInElement(
document.body,
{
"delimiters": [
{
"left": "$",
"right": "$",
"display": false
},
{
"left": "$$",
"right": "$$",
"display": true
},
{
"left": "\\[",
"right": "\\]",
"display": true
}
]
}
);
})
})
////////////////////////////////////////////////////////////////////////////////
require(['jquery', 'highlight', 'highlight-julia', 'highlight-julia-repl'], function($) {
$(document).ready(function() {
hljs.highlightAll();
})
})
////////////////////////////////////////////////////////////////////////////////
require([], function() {
function addCopyButtonCallbacks() {
for (const el of document.getElementsByTagName("pre")) {
const button = document.createElement("button");
button.classList.add("copy-button", "fas", "fa-copy");
el.appendChild(button);
const success = function () {
button.classList.add("success", "fa-check");
button.classList.remove("fa-copy");
};
const failure = function () {
button.classList.add("error", "fa-times");
button.classList.remove("fa-copy");
};
button.addEventListener("click", function () {
copyToClipboard(el.innerText).then(success, failure);
setTimeout(function () {
button.classList.add("fa-copy");
button.classList.remove("success", "fa-check", "fa-times");
}, 5000);
});
}
}
function copyToClipboard(text) {
// clipboard API is only available in secure contexts
if (window.navigator && window.navigator.clipboard) {
return window.navigator.clipboard.writeText(text);
} else {
return new Promise(function (resolve, reject) {
try {
const el = document.createElement("textarea");
el.textContent = text;
el.style.position = "fixed";
el.style.opacity = 0;
document.body.appendChild(el);
el.select();
document.execCommand("copy");
resolve();
} catch (err) {
reject(err);
} finally {
document.body.removeChild(el);
}
});
}
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", addCopyButtonCallbacks);
} else {
addCopyButtonCallbacks();
}
})
////////////////////////////////////////////////////////////////////////////////
require(['jquery', 'headroom', 'headroom-jquery'], function($, Headroom) {
// Manages the top navigation bar (hides it when the user starts scrolling down on the
// mobile).
window.Headroom = Headroom; // work around buggy module loading?
$(document).ready(function() {
$('#documenter .docs-navbar').headroom({
"tolerance": {"up": 10, "down": 10},
});
})
})
////////////////////////////////////////////////////////////////////////////////
require(['jquery'], function($) {
// Modal settings dialog
$(document).ready(function() {
var settings = $('#documenter-settings');
$('#documenter-settings-button').click(function(){
settings.toggleClass('is-active');
});
// Close the dialog if X is clicked
$('#documenter-settings button.delete').click(function(){
settings.removeClass('is-active');
});
// Close dialog if ESC is pressed
$(document).keyup(function(e) {
if (e.keyCode == 27) settings.removeClass('is-active');
});
});
})
////////////////////////////////////////////////////////////////////////////////
require(['jquery'], function($) {
// Manages the showing and hiding of the sidebar.
$(document).ready(function() {
var sidebar = $("#documenter > .docs-sidebar");
var sidebar_button = $("#documenter-sidebar-button")
sidebar_button.click(function(ev) {
ev.preventDefault();
sidebar.toggleClass('visible');
if (sidebar.hasClass('visible')) {
// Makes sure that the current menu item is visible in the sidebar.
$("#documenter .docs-menu a.is-active").focus();
}
});
$("#documenter > .docs-main").bind('click', function(ev) {
if ($(ev.target).is(sidebar_button)) {
return;
}
if (sidebar.hasClass('visible')) {
sidebar.removeClass('visible');
}
});
})
// Resizes the package name / sitename in the sidebar if it is too wide.
// Inspired by: https://github.com/davatron5000/FitText.js
$(document).ready(function() {
e = $("#documenter .docs-autofit");
function resize() {
var L = parseInt(e.css('max-width'), 10);
var L0 = e.width();
if(L0 > L) {
var h0 = parseInt(e.css('font-size'), 10);
e.css('font-size', L * h0 / L0);
// TODO: make sure it survives resizes?
}
}
// call once and then register events
resize();
$(window).resize(resize);
$(window).on('orientationchange', resize);
});
// Scroll the navigation bar to the currently selected menu item
$(document).ready(function() {
var sidebar = $("#documenter .docs-menu").get(0);
var active = $("#documenter .docs-menu .is-active").get(0);
if(typeof active !== 'undefined') {
sidebar.scrollTop = active.offsetTop - sidebar.offsetTop - 15;
}
})
})
////////////////////////////////////////////////////////////////////////////////
require(['jquery'], function($) {
function set_theme(theme) {
var active = null;
var disabled = [];
for (var i = 0; i < document.styleSheets.length; i++) {
var ss = document.styleSheets[i];
var themename = ss.ownerNode.getAttribute("data-theme-name");
if(themename === null) continue; // ignore non-theme stylesheets
// Find the active theme
if(themename === theme) active = ss;
else disabled.push(ss);
}
if(active !== null) {
active.disabled = false;
if(active.ownerNode.getAttribute("data-theme-primary") === null) {
document.getElementsByTagName('html')[0].className = "theme--" + theme;
} else {
document.getElementsByTagName('html')[0].className = "";
}
disabled.forEach(function(ss){
ss.disabled = true;
});
}
// Store the theme in localStorage
if(typeof(window.localStorage) !== "undefined") {
window.localStorage.setItem("documenter-theme", theme);
} else {
console.error("Browser does not support window.localStorage");
}
}
// Theme picker setup
$(document).ready(function() {
// onchange callback
$('#documenter-themepicker').change(function themepick_callback(ev){
var themename = $('#documenter-themepicker option:selected').attr('value');
set_theme(themename);
});
// Make sure that the themepicker displays the correct theme when the theme is retrieved
// from localStorage
if(typeof(window.localStorage) !== "undefined") {
var theme = window.localStorage.getItem("documenter-theme");
if(theme !== null) {
$('#documenter-themepicker option').each(function(i,e) {
e.selected = (e.value === theme);
})
} else {
$('#documenter-themepicker option').each(function(i,e) {
e.selected = $("html").hasClass(`theme--${e.value}`);
})
}
}
})
})
////////////////////////////////////////////////////////////////////////////////
require(['jquery'], function($) {
// update the version selector with info from the siteinfo.js and ../versions.js files
$(document).ready(function() {
// If the version selector is disabled with DOCUMENTER_VERSION_SELECTOR_DISABLED in the
// siteinfo.js file, we just return immediately and not display the version selector.
if (typeof DOCUMENTER_VERSION_SELECTOR_DISABLED === 'boolean' && DOCUMENTER_VERSION_SELECTOR_DISABLED) {
return;
}
var version_selector = $("#documenter .docs-version-selector");
var version_selector_select = $("#documenter .docs-version-selector select");
version_selector_select.change(function(x) {
target_href = version_selector_select.children("option:selected").get(0).value;
window.location.href = target_href;
});
// add the current version to the selector based on siteinfo.js, but only if the selector is empty
if (typeof DOCUMENTER_CURRENT_VERSION !== 'undefined' && $('#version-selector > option').length == 0) {
var option = $("<option value='#' selected='selected'>" + DOCUMENTER_CURRENT_VERSION + "</option>");
version_selector_select.append(option);
}
if (typeof DOC_VERSIONS !== 'undefined') {
var existing_versions = version_selector_select.children("option");
var existing_versions_texts = existing_versions.map(function(i,x){return x.text});
DOC_VERSIONS.forEach(function(each) {
var version_url = documenterBaseURL + "/../" + each;
var existing_id = $.inArray(each, existing_versions_texts);
// if not already in the version selector, add it as a new option,
// otherwise update the old option with the URL and enable it
if (existing_id == -1) {
var option = $("<option value='" + version_url + "'>" + each + "</option>");
version_selector_select.append(option);
} else {
var option = existing_versions[existing_id];
option.value = version_url;
option.disabled = false;
}
});
}
// only show the version selector if the selector has been populated
if (version_selector_select.children("option").length > 0) {
version_selector.toggleClass("visible");
}
})
})
docs/build/assets/logo.png

100 KiB

// Generated by Documenter.jl
requirejs.config({
paths: {
'lunr': 'https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min',
'lodash': 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min',
'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
}
});
////////////////////////////////////////////////////////////////////////////////
require(['jquery', 'lunr', 'lodash'], function($, lunr, _) {
$(document).ready(function() {
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;
while (i--) uri[o.key[i]] = m[i] || "";
uri[o.q.name] = {};
uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
if ($1) uri[o.q.name][$1] = $2;
});
return uri;
};
parseUri.options = {
strictMode: false,
key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
q: {
name: "queryKey",
parser: /(?:^|&)([^&=]*)=?([^&]*)/g
},
parser: {
strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
}
};
$("#search-form").submit(function(e) {
e.preventDefault()
})
// list below is the lunr 2.1.3 list minus the intersect with names(Base)
// (all, any, get, in, is, only, which) and (do, else, for, let, where, while, with)
// ideally we'd just filter the original list but it's not available as a variable
lunr.stopWordFilter = lunr.generateStopWordFilter([
'a',
'able',
'about',
'across',
'after',
'almost',
'also',
'am',
'among',
'an',
'and',
'are',
'as',
'at',
'be',
'because',
'been',
'but',
'by',
'can',
'cannot',
'could',
'dear',
'did',
'does',
'either',
'ever',
'every',
'from',
'got',
'had',
'has',
'have',
'he',
'her',
'hers',
'him',
'his',
'how',
'however',
'i',
'if',
'into',
'it',
'its',
'just',
'least',
'like',
'likely',
'may',
'me',
'might',
'most',
'must',
'my',
'neither',
'no',
'nor',
'not',
'of',
'off',
'often',
'on',
'or',
'other',
'our',
'own',
'rather',
'said',
'say',
'says',
'she',
'should',
'since',
'so',
'some',
'than',
'that',
'the',
'their',
'them',
'then',
'there',
'these',
'they',
'this',
'tis',
'to',
'too',
'twas',
'us',
'wants',
'was',
'we',
'were',
'what',
'when',
'who',
'whom',
'why',
'will',
'would',
'yet',
'you',
'your'
])
// add . as a separator, because otherwise "title": "Documenter.Anchors.add!"
// would not find anything if searching for "add!", only for the entire qualification
lunr.tokenizer.separator = /[\s\-\.]+/
// custom trimmer that doesn't strip @ and !, which are used in julia macro and function names
lunr.trimmer = function (token) {
return token.update(function (s) {
return s.replace(/^[^a-zA-Z0-9@!]+/, '').replace(/[^a-zA-Z0-9@!]+$/, '')
})
}
lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'juliaStopWordFilter')
lunr.Pipeline.registerFunction(lunr.trimmer, 'juliaTrimmer')
var index = lunr(function () {
this.ref('location')
this.field('title',{boost: 100})
this.field('text')
documenterSearchIndex['docs'].forEach(function(e) {
this.add(e)
}, this)
})
var store = {}
documenterSearchIndex['docs'].forEach(function(e) {
store[e.location] = {title: e.title, category: e.category, page: e.page}
})
$(function(){
searchresults = $('#documenter-search-results');
searchinfo = $('#documenter-search-info');
searchbox = $('#documenter-search-query');
searchform = $('.docs-search');
sidebar = $('.docs-sidebar');
function update_search(querystring) {
tokens = lunr.tokenizer(querystring)
results = index.query(function (q) {
tokens.forEach(function (t) {
q.term(t.toString(), {
fields: ["title"],
boost: 100,
usePipeline: true,
editDistance: 0,
wildcard: lunr.Query.wildcard.NONE
})
q.term(t.toString(), {
fields: ["title"],
boost: 10,
usePipeline: true,
editDistance: 2,
wildcard: lunr.Query.wildcard.NONE
})
q.term(t.toString(), {
fields: ["text"],
boost: 1,
usePipeline: true,
editDistance: 0,
wildcard: lunr.Query.wildcard.NONE
})
})
})
searchinfo.text("Number of results: " + results.length)
searchresults.empty()
results.forEach(function(result) {
data = store[result.ref]
link = $('<a class="docs-label">'+data.title+'</a>')
link.attr('href', documenterBaseURL+'/'+result.ref)
if (data.category != "page"){
cat = $('<span class="docs-category">('+data.category+', '+data.page+')</span>')
} else {
cat = $('<span class="docs-category">('+data.category+')</span>')
}
li = $('<li>').append(link).append(" ").append(cat)
searchresults.append(li)
})
}
function update_search_box() {
querystring = searchbox.val()
update_search(querystring)
}
searchbox.keyup(_.debounce(update_search_box, 250))
searchbox.change(update_search_box)
// Disable enter-key form submission for the searchbox on the search page
// and just re-run search rather than refresh the whole page.
searchform.keypress(
function(event){
if (event.which == '13') {
if (sidebar.hasClass('visible')) {
sidebar.removeClass('visible');
}
update_search_box();
event.preventDefault();
}
}
);
search_query_uri = parseUri(window.location).queryKey["q"]
if(search_query_uri !== undefined) {
search_query = decodeURIComponent(search_query_uri.replace(/\+/g, '%20'))
searchbox.val(search_query)
}
update_search_box();
})
})
})
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
// Small function to quickly swap out themes. Gets put into the <head> tag..
function set_theme_from_local_storage() {
// Intialize the theme to null, which means default
var theme = null;
// If the browser supports the localstorage and is not disabled then try to get the
// documenter theme
if(window.localStorage != null) {
// Get the user-picked theme from localStorage. May be `null`, which means the default
// theme.
theme = window.localStorage.getItem("documenter-theme");
}
// Check if the browser supports user color preference
var darkPreference = false;
// Check if the users preference is for dark color scheme
if(window.matchMedia('(prefers-color-scheme: dark)').matches === true) {
darkPreference = true;
}
// Initialize a few variables for the loop:
//
// - active: will contain the index of the theme that should be active. Note that there
// is no guarantee that localStorage contains sane values. If `active` stays `null`
// we either could not find the theme or it is the default (primary) theme anyway.
// Either way, we then need to stick to the primary theme.
//
// - disabled: style sheets that should be disabled (i.e. all the theme style sheets
// that are not the currently active theme)
var active = null; var disabled = []; var darkTheme = null;
for (var i = 0; i < document.styleSheets.length; i++) {
var ss = document.styleSheets[i];
// The <link> tag of each style sheet is expected to have a data-theme-name attribute
// which must contain the name of the theme. The names in localStorage much match this.
var themename = ss.ownerNode.getAttribute("data-theme-name");
// attribute not set => non-theme stylesheet => ignore
if(themename === null) continue;
// To distinguish the default (primary) theme, it needs to have the data-theme-primary
// attribute set.
var isprimary = (ss.ownerNode.getAttribute("data-theme-primary") !== null);
// Check if the theme is primary dark theme
var isDarkTheme = (ss.ownerNode.getAttribute("data-theme-primary-dark") !== null);
// If ss is for dark theme then set the value of darkTheme to the name of the theme
if(isDarkTheme) darkTheme = themename;
// If we find a matching theme (and it's not the default), we'll set active to non-null
if(themename === theme) active = i;
// Store the style sheets of inactive themes so that we could disable them
if(themename !== theme) disabled.push(ss);
}
if(active !== null) {
// If we did find an active theme, we'll (1) add the theme--$(theme) class to <html>
document.getElementsByTagName('html')[0].className = "theme--" + theme;
// and (2) disable all the other theme stylesheets
disabled.forEach(function(ss){
ss.disabled = true;
});
}
else if(darkTheme !== null && darkPreference === true) {
// If we did find an active theme, we'll (1) add the theme--$(theme) class to <html>
document.getElementsByTagName('html')[0].className = "theme--" + darkTheme;
// and (2) disable all the other theme stylesheets
disabled.forEach(function(ss){
if (ss.ownerNode.getAttribute("data-theme-name") !== darkTheme) {
ss.disabled = true;
}
});
}
}
set_theme_from_local_storage();
function maybeAddWarning () {
// DOCUMENTER_NEWEST is defined in versions.js, DOCUMENTER_CURRENT_VERSION and DOCUMENTER_STABLE
// in siteinfo.js.
// If either of these are undefined something went horribly wrong, so we abort.
if (
window.DOCUMENTER_NEWEST === undefined ||
window.DOCUMENTER_CURRENT_VERSION === undefined ||
window.DOCUMENTER_STABLE === undefined
) {
return
};
// Current version is not a version number, so we can't tell if it's the newest version. Abort.
if (!/v(\d+\.)*\d+/.test(window.DOCUMENTER_CURRENT_VERSION)) {
return
};
// Current version is newest version, so no need to add a warning.
if (window.DOCUMENTER_NEWEST === window.DOCUMENTER_CURRENT_VERSION) {
return
};
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs.
if (document.body.querySelector('meta[name="robots"]') === null) {
const meta = document.createElement('meta');
meta.name = 'robots';
meta.content = 'noindex';
document.getElementsByTagName('head')[0].appendChild(meta);
};
const div = document.createElement('div');
div.classList.add('outdated-warning-overlay');
const closer = document.createElement('button');
closer.classList.add('outdated-warning-closer', 'delete');
closer.addEventListener('click', function () {
document.body.removeChild(div);
});
const href = window.documenterBaseURL + '/../' + window.DOCUMENTER_STABLE;
div.innerHTML = 'This documentation is not for the latest stable release, but for either the development version or an older release.<br><a href="' + href + '">Click here to go to the documentation for the latest stable release.</a>';
div.appendChild(closer);
document.body.appendChild(div);
};
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', maybeAddWarning);
} else {
maybeAddWarning();
};
<!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><a class="tocitem" href="../developing/index.html">Developing Persephone</a></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://github.com//blob/master/docs/src/crops.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</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.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></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></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></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></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="Wednesday 4 January 2023 14:40">Wednesday 4 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!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 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><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>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://github.com//blob/master/docs/src/developing.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</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&#39;t forget to add relevant tests to the test suite.</p></li><li><p>Once your satisfied with your work, do another pull/merge from the <code>master</code> branch in case somebody else changed the branch in the meantime. Then merge your work into <code>master</code> and push to the Gitlab server.</p></li><li><p>Repeat :-)</p></li></ol><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 &#39;julia-snail)</code> and <code>(add-hook &#39;julia-mode-hook #&#39;julia-snail-mode)</code>.</p></li><li><p><a href="http://company-mode.github.io/"><code>company-mode</code></a> integrates with Snail to give code completion. Install with <code>M-x package-install company</code>, then add <code>(add-hook &#39;julia-mode-hook #&#39;company-mode)</code> and <code>(global-set-key (kbd &quot;C-&lt;tab&gt;&quot;) &#39;company-complete)</code> to your <code>init.el</code>.</p></li><li><p><a href="https://magit.vc/"><code>magit</code></a> is a great git interface for Emacs. Install with <code>M-x package-install magit</code> and add <code>(global-set-key (kbd &quot;C-x g&quot;) &#39;magit-status)</code> to your <code>init.el</code>.</p></li></ol><h3 id="VSCode"><a class="docs-heading-anchor" href="#VSCode">VSCode</a><a id="VSCode-1"></a><a class="docs-heading-anchor-permalink" href="#VSCode" title="Permalink"></a></h3><p>See <a href="https://www.julia-vscode.org/">here</a>.</p><p><em>TODO: add more detail.</em></p><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(&quot;Revise&quot;)</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="../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="Wednesday 4 January 2023 14:40">Wednesday 4 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!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><a class="tocitem" href="../developing/index.html">Developing Persephone</a></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://github.com//blob/master/docs/src/farm.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</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></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></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="Wednesday 4 January 2023 14:40">Wednesday 4 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!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></ul></li><li><a class="tocitem" href="developing/index.html">Developing Persephone</a></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://github.com//blob/master/docs/src/index.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</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&#39;s aim is to investigate how policy affects farmer decision-making, and how this in turn affects various animal species. It includes a farm submodel, a crop-growth submodel, and an ecological submodels.</p><h2 id="Running-the-model"><a class="docs-heading-anchor" href="#Running-the-model">Running the model</a><a id="Running-the-model-1"></a><a class="docs-heading-anchor-permalink" href="#Running-the-model" title="Permalink"></a></h2><p>To run a single experiment, execute:</p><pre><code class="nohighlight hljs">./run.jl -c &lt;CONFIG&gt;</code></pre><p>Other commandline arguments are:</p><pre><code class="nohighlight hljs">usage: run.jl [-c CONFIGFILE] [-s SEED] [-o OUTDIR] [-l LOGLEVEL]
[--version] [-h]
optional arguments:
-c, --configfile CONFIGFILE
name of the configuration file
-s, --seed SEED inital random seed (type: Int64)
-o, --outdir OUTDIR location of the output directory
-l, --loglevel LOGLEVEL
verbosity: &quot;debug&quot;, &quot;info&quot;, or &quot;quiet&quot;
--version show version information and exit
-h, --help show this help message and exit</code></pre><p><em>Last updated: 2023-01-04 (commit a958dd6)</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="Wednesday 4 January 2023 14:40">Wednesday 4 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!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><a class="tocitem" href="../developing/index.html">Developing Persephone</a></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://github.com//blob/master/docs/src/io.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</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></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></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></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></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="Wednesday 4 January 2023 14:40">Wednesday 4 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!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><a class="tocitem" href="../developing/index.html">Developing Persephone</a></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="#lifehistory.jl"><span>lifehistory.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://github.com//blob/master/docs/src/nature.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</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></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></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></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&#39;s currently active phase function.</p></div></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&#39;s current position. This can only be used nested within <code>@phase</code>.</p></div></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></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>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></p><p>To transition an individual to another phase, simply redefine its phase variable: <code>@trait(phase) = &quot;newphase&quot;</code>.</p></div></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></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></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&#39; biology:</p><pre><code class="language-julia hljs">@species name begin
initialise! = initpopulation()
phase = &quot;phase1&quot;
...
@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>initpopultion()</code>.</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></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&#39;s trait value. This can only be used nested within <code>@phase</code>.</p></div></section></article><h2 id="lifehistory.jl"><a class="docs-heading-anchor" href="#lifehistory.jl">lifehistory.jl</a><a id="lifehistory.jl-1"></a><a class="docs-heading-anchor-permalink" href="#lifehistory.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.initrandompopulation" href="#Persephone.initrandompopulation"><code>Persephone.initrandompopulation</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">initrandompopulation(popsize, asexual=true)</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. If <code>popsize</code> is less than 1, it is interpreted as a population density (i.e. 1 animal per <code>popsize</code> pixels).</p></div></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=&quot;&quot;)</code></pre><p>Kill this animal, optionally with a given percentage probability. Returns true if the animal dies, false if not.</p></div></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></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></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></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></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="Wednesday 4 January 2023 14:40">Wednesday 4 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!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><a class="tocitem" href="../developing/index.html">Developing Persephone</a></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="Wednesday 4 January 2023 14:40">Wednesday 4 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>
var documenterSearchIndex = {"docs":
[{"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.@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.@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.@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).\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\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 initpopultion().\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/#lifehistory.jl","page":"Nature","title":"lifehistory.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/lifehistory.jl\"]","category":"page"},{"location":"nature/#Persephone.initrandompopulation","page":"Nature","title":"Persephone.initrandompopulation","text":"initrandompopulation(popsize, asexual=true)\n\nA simplified version of initpopulation(). Creates a function that initialises popsize individuals, spread at random across the landscape. If popsize is less than 1, it is interpreted as a population density (i.e. 1 animal per popsize pixels).\n\n\n\n\n\n","category":"function"},{"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.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. Output all remaining data and exit.\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, pos, name, duration=1)\n\nAdd a farm event to the specified pixels for a given duration.\n\n\n\n\n\n","category":"function"},{"location":"simulation/index.html#Persephone.farmplot-Tuple{Agents.AgentBasedModel, Tuple{Int64, Int64}}","page":"Simulation","title":"Persephone.farmplot","text":"farmplot(model, position)\n\nReturn the farm plot at this position (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{Agents.AgentBasedModel, Tuple{Int64, Int64}}","page":"Simulation","title":"Persephone.landcover","text":"landcover(model, position)\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":"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.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.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":"","page":"Introduction","title":"Introduction","text":"Last updated: 2023-01-04 (commit a958dd6) ","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"}]
}
<!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><a class="tocitem" href="../developing/index.html">Developing Persephone</a></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://github.com//blob/master/docs/src/simulation.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</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. Output all remaining data and exit.</p></div></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></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></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></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></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></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></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></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, pos, name, duration=1)</code></pre><p>Add a farm event to the specified pixels for a given duration.</p></div></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.farmplot-Tuple{Agents.AgentBasedModel, Tuple{Int64, Int64}}" href="#Persephone.farmplot-Tuple{Agents.AgentBasedModel, Tuple{Int64, Int64}}"><code>Persephone.farmplot</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">farmplot(model, position)</code></pre><p>Return the farm plot at this position (utility wrapper).</p></div></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></section></article><article class="docstring"><header><a class="docstring-binding" id="Persephone.landcover-Tuple{Agents.AgentBasedModel, Tuple{Int64, Int64}}" href="#Persephone.landcover-Tuple{Agents.AgentBasedModel, Tuple{Int64, Int64}}"><code>Persephone.landcover</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">landcover(model, position)</code></pre><p>Return the land cover class at this position (utility wrapper).</p></div></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></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../developing/index.html">« Developing Persephone</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="Wednesday 4 January 2023 14:40">Wednesday 4 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!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><a class="tocitem" href="../developing/index.html">Developing Persephone</a></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://github.com//blob/master/docs/src/species.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</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="Wednesday 4 January 2023 14:40">Wednesday 4 January 2023</span>. Using Julia version 1.9.0-alpha1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
# Build the HTML documentation for Persephone using Documenter.jl
# https://documenter.juliadocs.org/stable/
push!(LOAD_PATH, "../src/")
using Documenter, Persephone
makedocs(sitename="Persephone",
modules = [Persephone],
pages = ["index.md",
"developing.md",
"Core" => [
"simulation.md",
"io.md"],
"Nature" => [
"nature.md",
"species.md"],
"crops.md",
"farm.md"
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment