-
Notifications
You must be signed in to change notification settings - Fork 2
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
Round to the nearest integer value #218
base: main
Are you sure you want to change the base?
Conversation
Instead of floor or ceil, always round to the nearest integer value as soon as the floating point calculation is finished. This changes results in r.pops.spread and presumably in rpops, too.
I computed a raster which is a difference There are only cells with -1 in the first year (sum -414): For the last year, it is more variable (min: -10, max: 13, sum: 5650, mean: 0.201901, mean excluding zeros: 1.13614): The pattern copies the data. The overall impact on the average infected count (5 runs) is significant: Before (max 6)After (max 3.8) |
Modified code and modified testFor a selected r.pops.spread test (test_outputs_mortality_treatment, Check mortality together with treatment), the following counts of dead hosts are produced for the original version with floor (and some ceil) and the version with round. In the test, I changed mortality from 0.5 to 0.4 for the new version with round which creates more aligned totals and the image is visually also more aligned with the original. This similarity is supported by the differences between average of infected.
Relative difference for average infected
Difference for average infected
|
…use treatment of infected is based on mortality groups
TODO: Split this into multiple PR to clear identify the source of differences. |
Replaces flooring in quarantine by rounding. The tests here still pass. The r.pops.spread test requires adjustment which can be previewed here: #218
Replaces flooring in quarantine by rounding. The tests here still pass. The r.pops.spread test requires adjustment which can be previewed here: #218
Instead of floor or ceil, always round to the nearest integer value as soon as the floating point calculation is finished.
This changes results in r.pops.spread and presumably in rpops, too.