Commit 2f7ce05b authored by Loup's avatar Loup
Browse files

change AUDPC and add AUDPC_rel

parent 3c32e772
......@@ -2068,7 +2068,7 @@ loadOutputs <- function(epid_outputs = "all", evol_outputs = "all"){
, evol_outputs = evol_outputs
, thres_breakdown = 50000
, GLAnoDis = 1.48315
, audpc100S = 0.38)
, audpc100S = 0.76)
return(outputList)
}
......
......@@ -118,7 +118,7 @@
#' L = as.numeric(cultivars$yield_L),
#' I = as.numeric(cultivars$yield_I),
#' R = as.numeric(cultivars$yield_R)),
#' production_cost_perHa = as.numeric(cultivars$production_cost),
#' planting_cost_perHa = as.numeric(cultivars$planting_cost),
#' market_value = as.numeric(cultivars$market_value))
#'
#' evol_res <- evol_output(, time_param, Npoly, cultivars, genes)
......
......@@ -110,7 +110,7 @@
epid_output <- function(types = "all", time_param, Npatho, area, rotation, croptypes, cultivars_param, eco_param,
GLAnoDis = cultivars_param$max_density[1] ## true for non-growing host
, ylim_param = list(
audpc = c(0, 0.38),
audpc = c(0, 0.76), #0.38),
audpc_rel = c(0, 1),
gla = c(0, 1.48),
gla_rel = c(0, 1),
......@@ -356,7 +356,11 @@ epid_output <- function(types = "all", time_param, Npatho, area, rotation, cropt
switch(type,
"audpc" = {
numerator <- sum(as.numeric(I_host[host, ts_year]), as.numeric(R_host[host, ts_year]))
denominator <- sum(as.numeric(K_host[host, y] * length(ts_year)))
denominator <- nTSpY * areaTot ## sum(as.numeric(K_host[host, y] * length(ts_year)))
},
"audpc_rel" = {
numerator <- sum(as.numeric(I_host[host, ts_year]), as.numeric(R_host[host, ts_year]))
denominator <- sum(as.numeric(N_host[host, ts_year]))
},
"gla" = {
numerator <- sum(as.numeric(H_host[host, ts_year]))
......@@ -384,9 +388,16 @@ epid_output <- function(types = "all", time_param, Npatho, area, rotation, cropt
## metrics for all landscape
switch(type,
"audpc" = {
# "audpc" = {
# numerator_tot <- sum(as.numeric(I_host[, ts_year]), as.numeric(R_host[, ts_year]))
# denominator_tot <- sum(as.numeric(K_host[, y] * length(ts_year)))
# if (denominator_tot > 0) {
# output_matrix[y, "total"] <- numerator_tot / denominator_tot
# }
# },
"audpc_rel" = {
numerator_tot <- sum(as.numeric(I_host[, ts_year]), as.numeric(R_host[, ts_year]))
denominator_tot <- sum(as.numeric(K_host[, y] * length(ts_year)))
denominator_tot <- sum(as.numeric(N_host[, ts_year]))
if (denominator_tot > 0) {
output_matrix[y, "total"] <- numerator_tot / denominator_tot
}
......@@ -398,7 +409,7 @@ epid_output <- function(types = "all", time_param, Npatho, area, rotation, cropt
output_matrix[y, "total"] <- numerator_tot / denominator_tot
}
},
{ ## i.e. if gla | substr(type,1,3)=="eco"
{ ## i.e. if audpc | gla | substr(type,1,3)=="eco"
output_matrix[y, "total"] <- sum(output_matrix[y, 1:Nhost], na.rm = TRUE)
}
)
......@@ -436,7 +447,11 @@ epid_output <- function(types = "all", time_param, Npatho, area, rotation, cropt
switch(type, "audpc" = {
main_output <- "AUDPC"
ylab_output <- "Proportion of diseased hosts: (I+R)/K"
ylab_output <- expression("Equivalent nb of diseased hosts / time step / m"^2) ## expression('title'^2)
round_ylab_output <- 2
}, "audpc_rel" = {
main_output <- expression("Relative AUDPC")
ylab_output <- "Proportion of diseased hosts: (I+R)/N"
round_ylab_output <- 2
}, "gla" = {
main_output <- expression("Green leaf area (GLA)") ## expression('title'[2])
......
......@@ -241,7 +241,7 @@ simul_landsepi <- function(seed = 12345, time_param = list(Nyears = 20, nTSpY =
genes, landscape = NULL, area,
rotation, basic_patho_param, disp_patho, disp_host, pI0 = 5e-4,
epid_outputs = "all", evol_outputs = "all", thres_breakdown = 50000,
GLAnoDis = 1.48315, audpc100S = 0.38,
GLAnoDis = 1.48315, audpc100S = 0.76, #0.38,
writeTXT = TRUE, graphic = TRUE, videoMP4 = FALSE, keepRawResults = FALSE) {
# Host parameters
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment