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
897e96cd
Commit
897e96cd
authored
10 months ago
by
xo30xoqa
Browse files
Options
Downloads
Patches
Plain Diff
Fixed skylark migration bug
closes #90
parent
be69f7fe
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+22
-1
22 additions, 1 deletion
CHANGELOG.md
src/nature/species/skylark.jl
+12
-8
12 additions, 8 deletions
src/nature/species/skylark.jl
with
34 additions
and
9 deletions
CHANGELOG.md
+
22
−
1
View file @
897e96cd
...
...
@@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to
[
Semantic Versioning
](
https://semver.org/spec/v2.0.0.html
)
.
## [0.5.2] - unreleased
### Added
### Changed
-
input files that are now copied to a separate
`inputs`
directory within the output directory
-
`EventType`
renamed to
`Management`
for clarity
-
`insectbiomass()`
uses units
### Deprecated
### Removed
### Fixed
-
all skylarks now migrate (#90)
## [v0.5.1] - 13-06-2024
### Added
...
...
@@ -115,7 +136,7 @@ way the species definition macros work and are used.
<!-- Template
## [
Unreleased] - <date>
## [
version] - unreleased
<comments>
...
...
This diff is collapsed.
Click to expand it.
src/nature/species/skylark.jl
+
12
−
8
View file @
897e96cd
...
...
@@ -126,7 +126,7 @@ As a non-breeding adult, move around with other individuals and check for migrat
month
,
day
=
monthday
(
model
.
date
)
migrate
=
(((
month
<
arrive
[
1
])
||
(
month
==
arrive
[
1
]
&&
day
<
arrive
[
2
]))
||
((
month
>
leave
[
1
])
||
(
month
==
leave
[
1
]
&&
day
>=
leave
[
2
])))
if
migrate
#FIXME not all migrate?
if
migrate
@kill
(
self
.
migrationmortality
,
"migration"
)
returndate
=
Date
(
year
(
model
.
date
)
+
1
,
arrive
[
1
],
arrive
[
2
])
@setphase
(
mating
)
...
...
@@ -146,9 +146,9 @@ Move around until a mate is found.
self
.
mate
=
-
1
return
end
mon
th
,
day
=
monthday
(
model
.
date
)
nest
=
((
mon
th
==
self
.
nestingbegin
[
1
]
&&
day
>=
self
.
nestingbegin
[
2
]
&&
@chance
(
0.05
))
||
(
mon
th
>
self
.
nestingbegin
[
1
]))
#XXX why the chance?
mon
,
day
=
monthday
(
model
.
date
)
nest
=
((
mon
==
self
.
nestingbegin
[
1
]
&&
day
>=
self
.
nestingbegin
[
2
]
&&
@chance
(
0.05
))
||
(
mon
>
self
.
nestingbegin
[
1
]))
#XXX why the chance?
nest
&&
@setphase
(
nestbuilding
)
return
end
...
...
@@ -162,7 +162,11 @@ Move around until a mate is found.
end
end
#@debug("$(animalid(self)) didn't find a mate.")
@walk
(
"random"
,
100
m
)
#XXX magic number
if
month
(
model
.
date
)
>
self
.
nestingend
# stop trying to find a mate if it's too late
@setphase
(
nonbreeding
)
else
@walk
(
"random"
,
100
m
)
#XXX magic number
end
end
"""
...
...
@@ -256,9 +260,9 @@ should currently be on migration. Also sets other individual-specific variables.
# calculate migration dates for this individual
self
.
migrationdates
=
migrationdates
(
self
,
model
)
leave
,
arrive
=
self
.
migrationdates
mon
th
,
day
=
monthday
(
model
.
date
)
migrate
=
(((
mon
th
<
arrive
[
1
])
||
(
mon
th
==
arrive
[
1
]
&&
day
<
arrive
[
2
]))
||
((
mon
th
>
leave
[
1
])
||
(
mon
th
==
leave
[
1
]
&&
day
>=
leave
[
2
])))
mon
,
day
=
monthday
(
model
.
date
)
migrate
=
(((
mon
<
arrive
[
1
])
||
(
mon
==
arrive
[
1
]
&&
day
<
arrive
[
2
]))
||
((
mon
>
leave
[
1
])
||
(
mon
==
leave
[
1
]
&&
day
>=
leave
[
2
])))
if
migrate
returndate
=
Date
(
year
(
model
.
date
),
arrive
[
1
],
arrive
[
2
])
model
.
date
!=
@param
(
core
.
startdate
)
&&
(
returndate
+=
Year
(
1
))
...
...
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