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

Renamed lifehistory.jl -> populations.jl

parent 2fb98390
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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")
......
### 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment