Simulation
The core
directory holds source files that are important for all submodels, including scheduling, landscape, and input/output functions.
simulation.jl
This file includes the basal functions for initialising and running simulations.
Persephone.finalise
— Methodfinalise(model)
Wrap up the simulation. Output all remaining data and exit.
Persephone.initialise
— Functioninitialise(config, seed)
Initialise the model: read in parameters, create the output data directory, and instantiate the AgentBasedModel object.
Persephone.simulate
— Functionsimulate(config)
Carry out a complete simulation run.
Persephone.stepsimulation!
— Methodstepsimulation!(model)
Execute one update of the model.
landscape.jl
This file manages the landscape maps that underlie the model.
Persephone.EventType
— TypeThe types of landscape event that can be simulated
Persephone.FarmEvent
— TypeFarmEvent
A data structure to define a landscape event, giving its type, spatial extent, and duration.
Persephone.LandCover
— TypeThe land cover classes encoded in the Mundialis Sentinel data.
Persephone.Pixel
— TypePixel
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.)
Persephone.createevent!
— Functioncreateevent(model, pos, name, duration=1)
Add a farm event to the specified pixels for a given duration.
Persephone.farmplot
— Methodfarmplot(model, position)
Return the farm plot at this position (utility wrapper).
Persephone.initlandscape
— Methodinitlandscape()
Initialise the model landscape based on the map files specified in the configuration. Returns a matrix of pixels.
Persephone.landcover
— Methodlandcover(model, position)
Return the land cover class at this position (utility wrapper).
Persephone.updateevents!
— Methodupdateevents!(model)
Cycle through the list of events, removing those that have expired.