diff --git a/docs/src/nature.md b/docs/src/nature.md index 4c012d1388a8eef57081a4caab5e17b3ef1a27af..da980c45112c88dc32ea10b9dc61e7f22854ce6f 100644 --- a/docs/src/nature.md +++ b/docs/src/nature.md @@ -9,13 +9,14 @@ Modules = [Persephone] Pages = ["nature/nature.jl"] ``` -## lifehistory.jl +## populations.jl -This file contains a set of life-history related utility functions needed by species. +This file contains a set of utility functions for species, including initialisation, +reproduction, and mortality. ```@autodocs Modules = [Persephone] -Pages = ["nature/lifehistory.jl"] +Pages = ["nature/populations.jl"] ``` ## ecologicaldata.jl diff --git a/src/Persephone.jl b/src/Persephone.jl index 2408f3fbaac097c71db09b09be09105830f4c6de..904f54d2c656c0580ed650d8ec96d198856be823 100644 --- a/src/Persephone.jl +++ b/src/Persephone.jl @@ -51,7 +51,7 @@ include("core/landscape.jl") include("farm/farm.jl") include("crop/crops.jl") include("nature/nature.jl") -include("nature/lifehistory.jl") +include("nature/populations.jl") include("nature/ecologicaldata.jl") #include("nature/species/skylark.jl") include("nature/species/wolpertinger.jl") diff --git a/src/nature/lifehistory.jl b/src/nature/populations.jl similarity index 87% rename from src/nature/lifehistory.jl rename to src/nature/populations.jl index fd2f5c3a790f0ecb7e79bf7d7939974319761680..d08d40473c7f12b33dfcdd2215b412ffa4af39f8 100644 --- a/src/nature/lifehistory.jl +++ b/src/nature/populations.jl @@ -1,6 +1,7 @@ ### Persephone - a socio-economic-ecological model of European agricultural landscapes. ### -### This file contains a set of life-history related utility functions needed by species. +### This file contains a set of utility functions for species, including initialisation, +### reproduction, and mortality. ### """ @@ -26,8 +27,8 @@ function initrandompopulation(popsize::Union{Int64,Float64}, asexual::Bool=true) end #TODO initpopulation with habitat descriptor -#TODO initpopulation with dispersal from an original source -#TODO initpopulation based on known occurences in real-life +#XXX initpopulation with dispersal from an original source? +#XXX initpopulation based on known occurences in real-life? """ reproduce!(animal, model, n=1) @@ -35,8 +36,6 @@ end Produce one or more offspring for the given animal at its current location. """ function reproduce!(animal::Animal, model::AgentBasedModel, n::Int64=1) - # XXX at the moment we don't have intra-specific variation, so currently we - # don't need sexual recombination here for i in 1:n sex = (animal.sex == hermaphrodite) ? hermaphrodite : rand([male, female]) add_agent!(animal.pos, Animal, model, animal.traits, sex, 0)