-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more documentation and tests on prop_female and na value changes
- Loading branch information
1 parent
de26e55
commit 7b32501
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
library(testthat) | ||
test_that("Population input settings work as expected", { | ||
population <- new(Population) | ||
nyears <- 10 | ||
nages <- 10 | ||
population$log_M <- rep(-1, nyears*nages) | ||
population$estimate_M <- FALSE | ||
population$log_init_naa <- log(rep(1, nages)) | ||
population$estimate_init_naa <- TRUE | ||
population$nages <- nages | ||
population$ages <- 1:nages | ||
population$nfleets <- 2 | ||
population$nseasons <- 1 | ||
population$nyears <- nyears | ||
population$proportion_female <- rep(0.5, nages) | ||
population$estimate_prop_female <- FALSE | ||
|
||
expect_equal(population$get_id(), 1) | ||
expect_equal(population$log_M, rep(-1, nyears*nages)) | ||
expect_false(population$estimate_M) | ||
expect_equal(population$log_init_naa, rep(0, nages)) | ||
expect_true(population$estimate_init_naa) | ||
expect_false(population$estimate_prop_female) | ||
expect_equal(population$proportion_female, rep(0.5, nages)) | ||
|
||
clear() | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters