Skip to content

Commit

Permalink
initialise interception_probability function
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Melloy committed Feb 15, 2021
1 parent b64bb4d commit a85694e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tests/testthat/test-interception_probability.R
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)
})

1 comment on commit a85694e

@IhsanKhaliq
Copy link
Owner

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, and adjust 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 think k is not spore_interception_paramter.

Please sign in to comment.