-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initialise interception_probability function
- Loading branch information
Paul Melloy
committed
Feb 15, 2021
1 parent
b64bb4d
commit a85694e
Showing
1 changed file
with
14 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
test_that("multiplication works", { | ||
expect_equal(2 * 2, 4) | ||
}) | ||
context("Function is use to calculate the max_interception_probability") | ||
|
||
# Define parameters after model defaults | ||
plant_density <- | ||
5 * max(15000) | ||
|
||
spore_interception_parameter <- | ||
0.00006 * (15000 / 350) | ||
|
||
IP <- c(500, 5) | ||
test1 <- | ||
sapply() | ||
interception_probability(target_density = plant_density, | ||
k = spore_interception_parameter) | ||
|
||
test_that("the correct values and attributes of a vector is returned", { | ||
expect_equal(IP, 40, 40) | ||
test_that("function returns the correct probabilities", { | ||
expect_equal(test1, 1) | ||
}) |
a85694e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked both Coventry and Art work, I think this might not be required. Although the function has been written, it's not being used in script on its own. That is, it is been written as
maxInterceptionProbablility
,spore_interception_paramter
, andadjust for interception
, but not on its own. I think spore interception may not be very relevant in our case because we're mainly concerned with within paddock splash dispersal - not with spores coming into the paddock from other paddocks. I thinkk
is notspore_interception_paramter
.