### Persephone - a socio-economic-ecological model of European agricultural landscapes.
###
### Daniel Vedder <daniel.vedder@idiv.de>
### Lea Kolb <lea-deborah.kolb@idiv.de>
### (c) 2022-2023, licensed under the terms of the MIT license
###
### This file defines the module/package for the Persephone model.
### To run the model, either execute `run.jl` from the commandline,
### or import the module using your own wrapper script or software.
###

module Persephone

## define dependencies
using
    Agents,
    ArgParse,
    Dates,
    GeoArrays, #XXX this is a big dependency - can we get rid of it?
    Logging,
    LoggingExtras,
    #MacroTools, #http://fluxml.ai/MacroTools.jl/stable/utilities/
    Random,
    StableRNGs,
    TOML

## define exported functions and variables
export
    #types
    Pixel,
    FarmEvent,
    FarmPlot,
    Animal,
    Farmer,
    DataOutput,
    #macros
    @param,
    @species,
    @initialise,
    @phase,
    @trait,
    @setphase,
    @respond,
    @here,
    @kill,
    @reproduce,
    @neighbours,
    @habitat,
    @landcover,
    @cropheight,
    @croptype,
    @distanceto,
    @distancetoedge,
    @countanimals,
    @rand,
    #functions
    simulate,
    simulate!,
    initialise,
    stepsimulation!,
    createevent!,
    finalise!

## include all module files (note that the order matters - if file
## b references something from file a, it must be included later)
include("core/input.jl")
include("core/output.jl")
include("core/landscape.jl")
include("farm/farm.jl")
include("crop/crops.jl")
include("nature/nature.jl")
include("nature/populations.jl")
include("nature/ecologicaldata.jl")
#TODO loop over files in nature/species directory
# (the below doesn't work yet)
# for f in readdir("nature/species", join=true)
#     endswith(f, ".jl") && include(f)
# end
#include("nature/species/skylark.jl")
include("nature/species/wolpertinger.jl")
include("nature/species/wyvern.jl")
include("core/simulation.jl")

end