Skip to content
Snippets Groups Projects
Commit 55c7dae6 authored by thierrychambert's avatar thierrychambert
Browse files

Fixed some issue

Added observe(param) in server to make sure param used in simulations keep up to date !
parent 7551911b
No related branches found
No related tags found
No related merge requests found
library(eolpop)
source("./inst/ShinyApp/ui.R")
source("./inst/ShinyApp/server.R")
......
......@@ -157,6 +157,7 @@ server <- function(input, output, session){
carrying_cap_eli_result = NULL)
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
observe(param)
##--------------------------------------------
## Display parameter distribution --
......@@ -192,7 +193,6 @@ server <- function(input, output, session){
## Run expert elicitation --
##--------------------------------------------
plot_expert <- function(out, show_se = TRUE, ...){
#plot_elicitation(out, ylab = "Densit de probabilit", xlab = "Valeur du paramtre", cex.lab = 1.2)
plot_elicitation(out, ylab = "", xlab = "Valeur du paramtre", cex.lab = 1.2, yaxt = "n")
mtext(text = "Densit de probabilit", side = 2, line = 2, cex = 1.2)
......@@ -353,6 +353,17 @@ server <- function(input, output, session){
})
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
## Survivals, fecundities and rMAX_species ###~~~~~~~~~~~~~~~~~~~~~~~~~~###
observeEvent({input$run}, {
param$survivals <- input$mat_fill_vr[,1]
param$fecundities <- input$mat_fill_vr[,2]
param$rMAX_species <- rMAX_spp(surv = tail(param$survivals,1), afr = min(which(param$fecundities != 0)))
}) # end observeEvent
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
## Population growth ###~~~~~~~~~~~~~~~~~~~~~~~~~~###
observeEvent({
......@@ -399,14 +410,6 @@ server <- function(input, output, session){
}
})
# Survivals and fecundities
observeEvent({input$run}, {
param$survivals <- input$mat_fill_vr[,1]
param$fecundities <- input$mat_fill_vr[,2]
param$rMAX_species <- rMAX_spp(surv = tail(param$survivals,1), afr = min(which(param$fecundities != 0)))
}) # end observeEvent
# Survival and fecundity calibration
observeEvent({
input$run
......@@ -466,7 +469,7 @@ server <- function(input, output, session){
fecundities = param$f_calibrated,
carrying_capacity = param$carrying_capacity,
theta = param$theta,
theta = theta,
rMAX_species = param$rMAX_species,
model_demo = NULL,
......
......@@ -219,7 +219,8 @@ ui <- fluidPage(
radioButtons(inputId = "pop_size_type",
label = h4("Unit"),
choices = c("Nombre de couple" = "Npair", "Effectif total" = "Ntotal")),
choices = c("Nombre de couple" = "Npair", "Effectif total" = "Ntotal"),
selected = "Ntotal"),
radioButtons(inputId = "pop_size_input_type",
label = h4("Type de saisie"),
......@@ -265,7 +266,7 @@ ui <- fluidPage(
numericInput(inputId = "pop_growth_mean",
label = "Moyenne de la croissance de la population",
value = 1,
value = 1.1,
min = 0, max = Inf, step = 0.01),
numericInput(inputId = "pop_growth_se",
......@@ -311,7 +312,7 @@ ui <- fluidPage(
numericInput(inputId = "carrying_capacity",
label = "Capacit de charge",
value = 1000,
value = 500,
min = 0, max = Inf, step = 100),
matrixInput(inputId = "carrying_cap_mat_expert",
......
......@@ -69,6 +69,7 @@ lambda( build_Leslie(s = s_calibrated, f = f_calibrated) )
#fatal_constant = "M"
#cumulated_impacts = FALSE
pop_growth_mean = 1.1
pop_size_type = "Ntotal"
carrying_capacity = 500
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment