-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PoPS Core with overpopulation movements #83
Conversation
a63d5c5
to
415ce0c
Compare
@wenzeslaus the pops_model r wrapper for the pops_model_cpp function is now merged into master and will make the documentation process easier going forward. |
Codecov Report
@@ Coverage Diff @@
## master #83 +/- ##
==========================================
- Coverage 75.57% 75.17% -0.40%
==========================================
Files 40 40
Lines 4687 4818 +131
==========================================
+ Hits 3542 3622 +80
- Misses 1145 1196 +51
Continue to review full report at Codecov.
|
I have updated the description to reflect the current state. It has tests in core, but none here yet. Maybe for a different PR just to get things in for further experiments? @ChrisJones687 Let me know what you think. |
Using The test of use_overpopulation_movements boolean is preserved to keep it explicit (we can consider removing it, but it works in any context, e.g., in pure C++ config in Core). However, the test is extended by There is also A bonus of |
This all looks good. I will add tests for overpopulation to issue #51 for a future PR. |
This uses a separate overpopulation_config which is actually passed to the C++ pops_model function.
The config contains three doubles and it is
List
in C++. I'm not sure if NumericalVector would be more appropriate, however in R it is a List since it has named elements. (In C++ NumericalVector can have named elements, but in R it is coerced to a list AFAIU.)It could be also a Rcpp nullable parameter, but we pass the boolean elsewhere anyway, so it is boolean plus config.
The translation from individual parameters to the double-only config list is done in the R pops_model function before it is passed to C++ pops_model_cpp function, so pops_model does more than just call the C++ function. It hides the difficulties in calling a C++ function, i.e., the parameter number limit. (Later, pops_model or another function, it could translate from whatever "config" used in R to whatever combo of "configs" the C++ will need.)