Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
search_index.js 39.09 KiB
var documenterSearchIndex = {"docs":
[{"location":"species-dsl/index.html#Defining-new-species","page":"Defining new species","title":"Defining new species","text":"","category":"section"},{"location":"species-dsl/index.html","page":"Defining new species","title":"Defining new species","text":"TODO","category":"page"},{"location":"species-dsl/index.html#The-Persephone-species-DSL","page":"Defining new species","title":"The Persephone species DSL","text":"","category":"section"},{"location":"species-dsl/index.html#Implementation-details","page":"Defining new species","title":"Implementation details","text":"","category":"section"},{"location":"developing/index.html#Developing-Persephone","page":"Developing Persephone","title":"Developing Persephone","text":"","category":"section"},{"location":"developing/index.html#Workflow","page":"Developing Persephone","title":"Workflow","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"Pull the current development version from the master branch on Gitlab:  https://git.idiv.de/xo30xoqa/persephone.\nIf you are working on a new feature, create a new branch to avoid breaking the master branch. (The master branch should always be in a runnable and (as far as possible) error-free state.)\nImplement your changes.\nRun run.sh to make sure the model executes without crashing. Also run the test suite (cd test; julia runtests.jl).\nCommit your work frequently, and try to keep each commit small. Don't forget to add relevant tests to the test suite.\nOnce your satisfied with your work, do another pull/merge from the master branch in case somebody else changed the branch in the meantime. Then merge your work into master and push to the Gitlab server.\nRepeat :-)","category":"page"},{"location":"developing/index.html#Agents.jl","page":"Developing Persephone","title":"Agents.jl","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"Our model uses Agents.jl as a framework. Their repository can be used to inspect the source code or submit bug reports (the authors are quick to respond). Questions can be asked at the  Julia Discourse forum.","category":"page"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"Tutorial on collaborating on Julia packages:  https://www.matecdev.com/posts/julia-package-collaboration.html.","category":"page"},{"location":"developing/index.html#Julia-editors","page":"Developing Persephone","title":"Julia editors","text":"","category":"section"},{"location":"developing/index.html#Emacs","page":"Developing Persephone","title":"Emacs","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"There are a couple of addons that make working with Julia much nicer in Emacs:","category":"page"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"julia-mode gives syntax highlighting. Install with M-x package-install julia-mode.\njulia-snail provides IDE-like features,  especially a fully-functional REPL and the ability to evaluate code straight from inside a buffer. Note that the installation can be somewhat tricky. You first need to manually install all the dependencies of its dependency vterm, then install vterm itself with M-x package-install vterm, before you can do M-x package-install julia-snail. Then add it to your init.el with (require 'julia-snail) and (add-hook 'julia-mode-hook #'julia-snail-mode).\ncompany-mode integrates with Snail to give code  completion. Install with M-x package-install company, then add  (add-hook 'julia-mode-hook #'company-mode) and  (global-set-key (kbd \"C-<tab>\") 'company-complete) to your init.el.\nmagit is a great git interface for Emacs. Install with M-x package-install magit and add (global-set-key (kbd \"C-x g\") 'magit-status) to your init.el.","category":"page"},{"location":"developing/index.html#VSCode","page":"Developing Persephone","title":"VSCode","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"See here.","category":"page"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"TODO: add more detail.","category":"page"},{"location":"developing/index.html#Other-useful-stuff","page":"Developing Persephone","title":"Other useful stuff","text":"","category":"section"},{"location":"developing/index.html","page":"Developing Persephone","title":"Developing Persephone","text":"Revise.jl allows one to reload code without restarting the Julia interpreter. Get it with Pkg.add(\"Revise\"), then  add using Revise to .julia/config/startup.jl to have it automatically available.\ngit-bug is a commandline bug tracker that integrates directly with git. It can also be used as a local interface to Gitlab issues. To install on Linux, download the binary, copy it to /usr/local/bin/git-bug, and set it as executable with chmod +x  /usr/local/bin/git-bug. To set up Gitlab integration, run git bug bridge configure from within the relevant repository.","category":"page"},{"location":"nature/index.html#Nature","page":"Nature","title":"Nature","text":"","category":"section"},{"location":"nature/index.html#nature.jl","page":"Nature","title":"nature.jl","text":"","category":"section"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"This file is responsible for managing the animal modules.","category":"page"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/index.htmlnature.jl\"]","category":"page"},{"location":"nature/index.html#Persephone.Animal","page":"Nature","title":"Persephone.Animal","text":"Animal\n\nThis is the generic agent type for all animals. Species are differentiated by trait dictionaries passed by them during initialisation.\n\n\n\n\n\n","category":"type"},{"location":"nature/index.html#Persephone.animalid-Tuple{Animal}","page":"Nature","title":"Persephone.animalid","text":"animalid(animal)\n\nA small utility function to return a string with the species name and ID of an animal.\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.initnature!-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.initnature!","text":"initnature!(model)\n\nInitialise the model with all simulated animal populations.\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.stepagent!-Tuple{Animal, Agents.AgentBasedModel}","page":"Nature","title":"Persephone.stepagent!","text":"stepagent!(animal, model)\n\nUpdate an animal by one day, executing it's currently active phase function.\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.@countanimals-Tuple","page":"Nature","title":"Persephone.@countanimals","text":"@countanimals(species=\"\", radius=0)\n\nCount the number of animals of the given species in this location. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@cropheight-Tuple{}","page":"Nature","title":"Persephone.@cropheight","text":"@cropheight\n\nReturn the height of the crop at this position, or 0 if there is no crop here. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@croptype-Tuple{}","page":"Nature","title":"Persephone.@croptype","text":"@croptype\n\nReturn the local croptype, or nothing if there is no crop here. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@distanceto-Tuple{Any}","page":"Nature","title":"Persephone.@distanceto","text":"@distanceto(habitat)\n\nCalculate the distance to the closest habitat of the specified type or descriptor. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@distancetoedge-Tuple{}","page":"Nature","title":"Persephone.@distancetoedge","text":"@distancetoedge\n\nCalculate the distance to the closest neighbouring habitat. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@habitat-Tuple{Any}","page":"Nature","title":"Persephone.@habitat","text":"@habitat\n\nSpecify habitat suitability for spatial ecological processes.\n\nThis macro works by creating an anonymous function that takes in a model object and a position, and returns true or false depending on the conditions specified in the macro body.\n\nSeveral utility macros can be used within the body of @habitat as a short-hand for common expressions: @landcover, @croptype, @cropheight, @distanceto, @distancetoedge, @countanimals. The variables model and pos can be used for checks that don't have a macro available.\n\nTwo example uses of @habitat might look like this:\n\nmovementhabitat = @habitat(@landcover() in (grass agriculture soil))\n\nnestinghabitat = @habitat((@landcover() == grass || \n                           (@landcover() == agriculture && @croptype() != maize &&\n                            @cropheight() < 10)) &&\n                          @distanceto(forest) > 20)\n\nFor more complex habitat suitability checks, the use of this macro can be circumvented by directly creating an equivalent function.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@here-Tuple{Any}","page":"Nature","title":"Persephone.@here","text":"@here(property)\n\nA utility macro to quickly access a property of the animal's current position (i.e. landcover, fieldid, or  events - see the Pixel struct). This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@initialise-Tuple{Any, Vararg{Any}}","page":"Nature","title":"Persephone.@initialise","text":"@initialise(habitatdescriptor; kwargs...)\n\nCall this macro within the body of @species. It passes the given habitat descriptor function and keyword arguments on to initpopulation() when setting up the simulation.\n\nNote: if this macro is not used, the variable initialise! must be set manually in the species definition.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@kill-Tuple","page":"Nature","title":"Persephone.@kill","text":"@kill\n\nKill this animal (and immediately abort its current update). This is a thin wrapper around kill!(), and passes on any arguments. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@landcover-Tuple{}","page":"Nature","title":"Persephone.@landcover","text":"@landcover\n\nReturns the local landcover. This is a utility wrapper that can only be used nested within @phase or @habitat.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@neighbours-Tuple{Any}","page":"Nature","title":"Persephone.@neighbours","text":"@neighbours(radius)\n\nReturn an iterator over all animals in the given radius around this animal, excluding itself. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@phase-Tuple{Any, Any}","page":"Nature","title":"Persephone.@phase","text":"@phase(name, body)\n\nThis macro is designed to be used within a species definition block (i.e. within the body of a call to @species).\n\nThe idea behind this is that species show very different behaviour during different phases of their lives. Therefore, @phase can be used define the behaviour for one such phase, and the conditions under which the animal transitions to another phase.\n\n@phase works by creating a function that will be called by the model if the animal is in the relevant phase. When it is called, it has access to the following variables:\n\nanimal a reference to the animal itself. This provides access to animal.age,   animal.sex, and animal.traits (a dict that gives access to all species parameters).\npos gives the animal's current position as a coordinate tuple.\nmodel a reference to the model world (an object of type AgentBasedModel).   This allows access to model.date (the current simulation date) and   model.landscape (a two-dimensional array of pixels containing geographic   information).\n\nSeveral utility macros can be used within the body of @phase as a short-hand for common expressions: @trait, @setphase, @respond, @here, @kill, @reproduce, @neighbours.\n\nNote that the first phase that is defined in a species definition block will be the phase that animals are assigned at birth, unless the variable phase is explicitly defined by the user in the species definition block.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@reproduce-Tuple","page":"Nature","title":"Persephone.@reproduce","text":"@reproduce\n\nLet this animal reproduce. This is a thin wrapper around reproduce!(), and passes on any arguments. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@respond-Tuple{Any, Any}","page":"Nature","title":"Persephone.@respond","text":"@respond(eventname, body)\n\nDefine how an animal responds to a landscape event that affects its current position. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@setphase-Tuple{Any}","page":"Nature","title":"Persephone.@setphase","text":"@setphase(newphase)\n\nSwitch this animal over to a different phase. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@species-Tuple{Any, Any}","page":"Nature","title":"Persephone.@species","text":"@species(name, body)\n\nA macro used to create new species definitions for the nature model. This is effectively a simple domain-specific language, establishing a custom syntax to describe species' biology:\n\n@species name begin\n\n    @initialise(@habitat(...))\n    speciesvar1 = 3.14\n    ...\n\n    @phase phase1 begin\n        ...\n    end\nend\n\nThe definition body (enclosed in the begin/end block) has two sections. First comes a call to @initialise!(), and optionally a list of species-specific parameters, which are assigned just like normal variables. Second come one or more phase definitions, that describe the behaviour of the species during various parts of its life cycle. (See the documentation to @initialise! and @phase for details).\n\nCode in a species definition block can access the rest of the model using the model variable (an object of type AgentBasedModel).\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#Persephone.@trait-Tuple{Any}","page":"Nature","title":"Persephone.@trait","text":"@trait(traitname)\n\nA utility macro to quickly access an animal's trait value. This can only be used nested within @phase.\n\n\n\n\n\n","category":"macro"},{"location":"nature/index.html#populations.jl","page":"Nature","title":"populations.jl","text":"","category":"section"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"This file contains a set of utility functions for species, including initialisation, reproduction, and mortality.","category":"page"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/index.htmlpopulations.jl\"]","category":"page"},{"location":"nature/index.html#Persephone.countanimals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Nature","title":"Persephone.countanimals","text":"countanimals(pos, model; species=\"\", radius=0)\n\nCount the number of animals in this location (optionally supplying a species name and radius).\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.initpopulation-Tuple{Function}","page":"Nature","title":"Persephone.initpopulation","text":"initpopulation(habitatdescriptor; popsize=-1, pairs=false, asexual=false)\n\nCreates a function that initialises individuals at random locations across the landscape. This can be used to create the initialise! variable in a species definition block.\n\nhabitatdescriptor is a function that determines whether a given location is suitable   or not (create this using @habitat).\nphase determines which life phase individuals will be assigned to. If this is nothing,   the species' default post-natal life stage will be used (although note that this is   probably not what you want).\npopsize determines the number of individuals that will be created. If this is zero or   negative, one individual will be created in every suitable location in the landscape.   If popsize is greater than the number of suitable locations, multiple individuals   will be created in one place. (Maximum population density can be set in the habitat   descriptor using the @countanimals macro.)\nIf pairs is true, a male and a female individual will be created in each selected   location, otherwise, only one individual will be created at a time.\nIf asexual is true, all created individuals are assigned the sex hermaphrodite,   otherwise, they are randomly assigned male of female. (If pairs is true, asexual   is ignored.)\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.initrandompopulation-Tuple{Int64}","page":"Nature","title":"Persephone.initrandompopulation","text":"initrandompopulation(popsize; kwargs...)\n\nA simplified version of initpopulation(). Creates a function that initialises popsize individuals, spread at random across the landscape.\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.kill!","page":"Nature","title":"Persephone.kill!","text":"kill(animal, model, probability=1.0, cause=\"\")\n\nKill this animal, optionally with a given percentage probability. Returns true if the animal dies, false if not.\n\n\n\n\n\n","category":"function"},{"location":"nature/index.html#Persephone.nearby_animals-Tuple{Animal, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persephone.nearby_animals","text":"nearby_animals(animal, model, radius)\n\nReturn an iterator over all animals in the given radius around this animal, excluding itself.\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.nearby_animals-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Int64}","page":"Nature","title":"Persephone.nearby_animals","text":"nearby_animals(pos, model, radius)\n\nReturn an iterator over all animals in the given radius around this position.\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.reproduce!","page":"Nature","title":"Persephone.reproduce!","text":"reproduce!(animal, model, n=1)\n\nProduce one or more offspring for the given animal at its current location.\n\n\n\n\n\n","category":"function"},{"location":"nature/index.html#ecologicaldata.jl","page":"Nature","title":"ecologicaldata.jl","text":"","category":"section"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"This file contains a set of life-history related utility functions needed by species.","category":"page"},{"location":"nature/index.html","page":"Nature","title":"Nature","text":"Modules = [Persephone]\nPages = [\"nature/index.htmlecologicaldata.jl\"]","category":"page"},{"location":"nature/index.html#Persephone.initecologicaldata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.initecologicaldata","text":"initecologicaldata()\n\nCreate output files for each data group collected by the nature model.\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.saveindividualdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.saveindividualdata","text":"saveindividualdata(model)\n\nPrint a comma-separated set of lines to individuals.csv, listing all properties of all animal individuals in the model. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter nature.indoutfreq. WARNING: Produces very big files!\n\n\n\n\n\n","category":"method"},{"location":"nature/index.html#Persephone.savepopulationdata-Tuple{Agents.AgentBasedModel}","page":"Nature","title":"Persephone.savepopulationdata","text":"savepopulationdata(model)\n\nPrint a comma-separated set of lines to populations.csv, giving the current date and population size for each animal species. May be called never, daily, monthly, yearly, or at the end of a simulation, depending on the parameter nature.popoutfreq.\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#Simulation","page":"Simulation","title":"Simulation","text":"","category":"section"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"The core directory holds source files that are important for all submodels, including scheduling, landscape, and input/output functions.","category":"page"},{"location":"simulation/index.html#simulation.jl","page":"Simulation","title":"simulation.jl","text":"","category":"section"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"This file includes the basal functions for initialising and running simulations.","category":"page"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"Modules = [Persephone]\nPages = [\"core/simulation.jl\"]","category":"page"},{"location":"simulation/index.html#Persephone.PARAMFILE","page":"Simulation","title":"Persephone.PARAMFILE","text":"The file that stores all default parameters.\n\n\n\n\n\n","category":"constant"},{"location":"simulation/index.html#Persephone.finalise-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.finalise","text":"finalise(model)\n\nWrap up the simulation. Currently doesn't do anything except print some information.\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#Persephone.initialise","page":"Simulation","title":"Persephone.initialise","text":"initialise(config=PARAMFILE, seed=nothing)\n\nInitialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object. Optionally allows specifying the configuration file and overriding the seed parameter.\n\n\n\n\n\n","category":"function"},{"location":"simulation/index.html#Persephone.simulate","page":"Simulation","title":"Persephone.simulate","text":"simulate(config=PARAMFILE, seed=nothing)\n\nCarry out a complete simulation run, optionally specifying a configuration file and a seed for the RNG.\n\n\n\n\n\n","category":"function"},{"location":"simulation/index.html#Persephone.stepsimulation!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.stepsimulation!","text":"stepsimulation!(model)\n\nExecute one update of the model.\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#landscape.jl","page":"Simulation","title":"landscape.jl","text":"","category":"section"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"This file manages the landscape maps that underlie the model.","category":"page"},{"location":"simulation/index.html","page":"Simulation","title":"Simulation","text":"Modules = [Persephone]\nPages = [\"core/landscape.jl\"]","category":"page"},{"location":"simulation/index.html#Persephone.EventType","page":"Simulation","title":"Persephone.EventType","text":"The types of landscape event that can be simulated\n\n\n\n\n\n","category":"type"},{"location":"simulation/index.html#Persephone.FarmEvent","page":"Simulation","title":"Persephone.FarmEvent","text":"FarmEvent\n\nA data structure to define a landscape event, giving its type, spatial extent, and duration.\n\n\n\n\n\n","category":"type"},{"location":"simulation/index.html#Persephone.LandCover","page":"Simulation","title":"Persephone.LandCover","text":"The land cover classes encoded in the Mundialis Sentinel data.\n\n\n\n\n\n","category":"type"},{"location":"simulation/index.html#Persephone.Pixel","page":"Simulation","title":"Persephone.Pixel","text":"Pixel\n\nA pixel is a simple data structure to combine land use and ownership information in a single object. The model landscape consists of a matrix of pixels. (Note: further landscape information may be added here in future.)\n\n\n\n\n\n","category":"type"},{"location":"simulation/index.html#Persephone.createevent!","page":"Simulation","title":"Persephone.createevent!","text":"createevent!(model, pixels, name, duration=1)\n\nAdd a farm event to the specified pixels (a vector of position tuples) for a given duration.\n\n\n\n\n\n","category":"function"},{"location":"simulation/index.html#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Function}","page":"Simulation","title":"Persephone.distanceto","text":"distanceto(pos, model, habitatdescriptor)\n\nCalculate the distance from the given location to the closest location matching the habitat descriptor function. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#Persephone.distanceto-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel, Persephone.LandCover}","page":"Simulation","title":"Persephone.distanceto","text":"distanceto(pos, model, habitattype)\n\nCalculate the distance from the given location to the closest habitat of the specified type. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#Persephone.distancetoedge-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.distancetoedge","text":"distancetoedge(pos, model)\n\nCalculate the distance from the given location to the closest neighbouring habitat. Caution: can be computationally expensive!\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#Persephone.farmplot-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.farmplot","text":"farmplot(position, model)\n\nReturn the farm plot at this position, or nothing if there is none (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#Persephone.initlandscape-Tuple{String, String}","page":"Simulation","title":"Persephone.initlandscape","text":"initlandscape(landcovermap, farmfieldsmap)\n\nInitialise the model landscape based on the map files specified in the configuration. Returns a matrix of pixels.\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#Persephone.landcover-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.landcover","text":"landcover(position, model)\n\nReturn the land cover class at this position (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"simulation/index.html#Persephone.updateevents!-Tuple{Agents.AgentBasedModel}","page":"Simulation","title":"Persephone.updateevents!","text":"updateevents!(model)\n\nCycle through the list of events, removing those that have expired.\n\n\n\n\n\n","category":"method"},{"location":"farm/index.html#Farm-submodel","page":"Farm submodel","title":"Farm submodel","text":"","category":"section"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"Eventually, Persephone will include multiple farm-decision submodels. At the moment,  we are only working with a very basic mock-up.","category":"page"},{"location":"farm/index.html#farm.jl","page":"Farm submodel","title":"farm.jl","text":"","category":"section"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"This file is responsible for managing the farm module(s).","category":"page"},{"location":"farm/index.html","page":"Farm submodel","title":"Farm submodel","text":"Modules = [Persephone]\nPages = [\"farm/index.htmlfarm.jl\"]","category":"page"},{"location":"farm/index.html#Persephone.initfarms!-Tuple{Agents.AgentBasedModel}","page":"Farm submodel","title":"Persephone.initfarms!","text":"initfarms!(model)\n\nInitialise the model with a set of farm agents.\n\n\n\n\n\n","category":"method"},{"location":"farm/index.html#Persephone.stepagent!-Tuple{Farmer, Agents.AgentBasedModel}","page":"Farm submodel","title":"Persephone.stepagent!","text":"stepagent!(farmer, model)\n\nUpdate a farmer by one day.\n\n\n\n\n\n","category":"method"},{"location":"architecture/index.html#Source-code-architecture","page":"Source code architecture","title":"Source code architecture","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"TODO","category":"page"},{"location":"architecture/index.html#Model-components","page":"Source code architecture","title":"Model components","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"core\nfarm\nnature\ncrop","category":"page"},{"location":"architecture/index.html#Important-implementation-details","page":"Source code architecture","title":"Important implementation details","text":"","category":"section"},{"location":"architecture/index.html","page":"Source code architecture","title":"Source code architecture","text":"configuration/param()\noutput data\nAgents.jl","category":"page"},{"location":"crops/index.html#Crop-submodel","page":"Crop submodel","title":"Crop submodel","text":"","category":"section"},{"location":"crops/index.html","page":"Crop submodel","title":"Crop submodel","text":"Eventually, Persephone will include a full-blown crop-growth model (an adaptation of AquaCrop, created by the FAO). At the moment, we are only working with a very basic mock-up.","category":"page"},{"location":"crops/index.html#crops.jl","page":"Crop submodel","title":"crops.jl","text":"","category":"section"},{"location":"crops/index.html","page":"Crop submodel","title":"Crop submodel","text":"This includes the types and functions needed for all crop growth model, which are also referenced by the other submodels.","category":"page"},{"location":"crops/index.html","page":"Crop submodel","title":"Crop submodel","text":"Modules = [Persephone]\nPages = [\"crop/crops.jl\"]","category":"page"},{"location":"crops/index.html#Persephone.CropType","page":"Crop submodel","title":"Persephone.CropType","text":"The crop types simulated by the model\n\n\n\n\n\n","category":"type"},{"location":"crops/index.html#Persephone.FarmPlot","page":"Crop submodel","title":"Persephone.FarmPlot","text":"FarmPlot\n\nThis represents one field, i.e. a collection of pixels with the same management. This is the spatial unit with which the crop growth model and the farm model work.\n\n\n\n\n\n","category":"type"},{"location":"crops/index.html#Persephone.averagefieldsize-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.averagefieldsize","text":"averagefieldsize(model)\n\nCalculate the average field size in hectares for the model landscape.\n\n\n\n\n\n","category":"method"},{"location":"crops/index.html#Persephone.cropheight-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.cropheight","text":"cropheight(model, position)\n\nReturn the height of the crop at this position, or nothing if there is no crop here (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"crops/index.html#Persephone.croptype-Tuple{Tuple{Int64, Int64}, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.croptype","text":"croptype(model, position)\n\nReturn the crop at this position, or nothing if there is no crop here (utility wrapper).\n\n\n\n\n\n","category":"method"},{"location":"crops/index.html#Persephone.initfields!-Tuple{Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.initfields!","text":"initfields!(model)\n\nInitialise the model with its farm plots.\n\n\n\n\n\n","category":"method"},{"location":"crops/index.html#Persephone.stepagent!-Tuple{FarmPlot, Agents.AgentBasedModel}","page":"Crop submodel","title":"Persephone.stepagent!","text":"stepagent!(farmplot, model)\n\nUpdate a farm plot by one day.\n\n\n\n\n\n","category":"method"},{"location":"","page":"Introduction","title":"Introduction","text":"CurrentModule = Persephone","category":"page"},{"location":"#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"Persephone is an agent-based, socio-economic-ecological model of agricultural landscapes in Europe under the Common Agricultural Policy (CAP).","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"It's aim is to investigate how policy affects farmer decision-making, and how this in turn affects various animal species. It includes a farm submodel, a crop-growth submodel, and an ecological submodels.","category":"page"},{"location":"#Running-the-model","page":"Introduction","title":"Running the model","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"To run a single experiment, execute:","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"./run.jl -c <CONFIG>","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"Other commandline arguments are:","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"usage: run.jl [-c CONFIGFILE] [-s SEED] [-o OUTDIR] [-l LOGLEVEL] \n              [--version] [-h]\n\noptional arguments:\n  -c, --configfile CONFIGFILE\n                        name of the configuration file\n  -s, --seed SEED       inital random seed (type: Int64)\n  -o, --outdir OUTDIR   location of the output directory\n  -l, --loglevel LOGLEVEL\n                        verbosity: \"debug\", \"info\", or \"quiet\"\n  --version             show version information and exit\n  -h, --help            show this help message and exit","category":"page"},{"location":"#Model-input","page":"Introduction","title":"Model input","text":"","category":"section"},{"location":"","page":"Introduction","title":"Introduction","text":"TODO: describe config & map files","category":"page"},{"location":"","page":"Introduction","title":"Introduction","text":"Last updated: 2023-01-20 (commit 4954227)  ","category":"page"},{"location":"io/index.html#Input,-Output,-and-Settings","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"These functions are responsible for reading in all model configurations (passed by config file or commandline), administrating them during a run, and printing any output.","category":"page"},{"location":"io/index.html#parameters.toml","page":"Input, Output, and Settings","title":"parameters.toml","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"This is the default configuration file for Persephone, containing all model parameters. The syntax is described here: https://toml.io/index.htmlen/","category":"page"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"DO NOT MODIFY THIS FILE FOR SIMULATION EXPERIMENTS! Instead, copy it to another directory, modify the copy, and then pass it to the model using the --config parameter.","category":"page"},{"location":"io/index.html#input.jl","page":"Input, Output, and Settings","title":"input.jl","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persephone]\nPages = [\"core/input.jl\"]","category":"page"},{"location":"io/index.html#Persephone.getsettings","page":"Input, Output, and Settings","title":"Persephone.getsettings","text":"getsettings(configfile, seed=nothing)\n\nCombines all configuration options to produce a single settings dict. Precedence: commandline parameters - user config file - default values\n\n\n\n\n\n","category":"function"},{"location":"io/index.html#Persephone.parsecommandline-Tuple{}","page":"Input, Output, and Settings","title":"Persephone.parsecommandline","text":"parsecommandline()\n\nCertain software parameters can be set via the commandline.\n\n\n\n\n\n","category":"method"},{"location":"io/index.html#Persephone.@param-Tuple{Any}","page":"Input, Output, and Settings","title":"Persephone.@param","text":"@param(domainparam)\n\nReturn a configuration parameter from the global settings. The argument should be in the form <domain>.<parameter>, for example @param(core.outdir). Possible values for <domain> are core, nature, farm, or crop. For a full list of parameters, see src/parameters.toml.\n\nNote that this macro only works in a context where the model object is available.\n\n\n\n\n\n","category":"macro"},{"location":"io/index.html#output.jl","page":"Input, Output, and Settings","title":"output.jl","text":"","category":"section"},{"location":"io/index.html","page":"Input, Output, and Settings","title":"Input, Output, and Settings","text":"Modules = [Persephone]\nPages = [\"core/output.jl\"]","category":"page"},{"location":"io/index.html#Persephone.DataOutput","page":"Input, Output, and Settings","title":"Persephone.DataOutput","text":"DataOutput\n\nA struct for organising model output. This is designed for text-based data output that is updated more or less regularly (e.g. population data in csv files). Submodels can register their own output functions using newdataoutput().\n\nStruct fields:     - filename: the name of the file to be created in the user-specified output directory     - header: a string to be written to the start of the file as it is initialised     - outputfunction: a function that takes a model object and returns a string to write to file     - frequency: how often to call the output function (daily/monthly/yearly/end/never)\n\n\n\n\n\n","category":"type"},{"location":"io/index.html#Persephone.newdataoutput-Tuple{Agents.AgentBasedModel, String, String, Function, String}","page":"Input, Output, and Settings","title":"Persephone.newdataoutput","text":"newdataoutput(model, filename, header, outputfunction, frequency)\n\nCreate and register a new data output. This function must be called by all submodels that want to have their output functions called regularly.\n\n\n\n\n\n","category":"method"},{"location":"io/index.html#Persephone.outputdata-Tuple{Agents.AgentBasedModel}","page":"Input, Output, and Settings","title":"Persephone.outputdata","text":"outputdata(model)\n\nCycle through all registered data outputs and activate them according to their configured frequency.\n\n\n\n\n\n","category":"method"},{"location":"io/index.html#Persephone.setupdatadir-Tuple{Agents.AgentBasedModel}","page":"Input, Output, and Settings","title":"Persephone.setupdatadir","text":"setupdatadir()\n\nCreates the output directory and copies relevant files into it.\n\n\n\n\n\n","category":"method"},{"location":"species/index.html#Species","page":"Species","title":"Species","text":"","category":"section"},{"location":"species/index.html","page":"Species","title":"Species","text":"The ecological submodel in Persephone simulates a range of species in agricultural landscapes.","category":"page"},{"location":"species/index.html#Skylark","page":"Species","title":"Skylark","text":"","category":"section"},{"location":"species/index.html","page":"Species","title":"Species","text":"Modules = [Persephone]\nPages = [\"nature/index.htmlspecies/index.htmlskylark.jl\"]","category":"page"}]
}