Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Persefone.jl
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Persefone
Persefone.jl
Commits
4b11014b
Commit
4b11014b
authored
2 years ago
by
xo30xoqa
Browse files
Options
Downloads
Patches
Plain Diff
Renamed lifehistory.jl -> populations.jl
parent
2fb98390
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/src/nature.md
+4
-3
4 additions, 3 deletions
docs/src/nature.md
src/Persephone.jl
+1
-1
1 addition, 1 deletion
src/Persephone.jl
src/nature/populations.jl
+4
-5
4 additions, 5 deletions
src/nature/populations.jl
with
9 additions
and
9 deletions
docs/src/nature.md
+
4
−
3
View file @
4b11014b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/Persephone.jl
+
1
−
1
View file @
4b11014b
...
...
@@ -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"
)
...
...
This diff is collapsed.
Click to expand it.
src/nature/
lifehistory
.jl
→
src/nature/
populations
.jl
+
4
−
5
View file @
4b11014b
### 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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment