Skip to contents

This function calculates the initial dose that is a product of inflow concentration and volume for each exposure events.

Usage

initial_dose_calculation(scenario)

Arguments

scenario

dataFrame scenario with volume and inflow_concentration columns

Value

scenario_with_initial_dose

Examples

library(dplyr)
library(purrr)
scenario_test <- create_scenario(system.file("input_1culture_2pop.xlsx", package = "ambre"))

scenario_conc <- inflow_concentration(scenario = scenario_test,
 pathogenName = c("Campylobacter jejuni"))
#> Simulated pathogen: Campylobacter jejuni
#> Create 1000 random distribution(s): uniform (n: 60, min: 100.000000, max: 5000.000000)
#> Providing inflow events ... ok. (0.00 secs) 
#> Providing inflow paras ... ok. (0.00 secs) 
#> Simulated pathogen: Campylobacter jejuni
#> Create 1000 random distribution(s): uniform (n: 48, min: 100.000000, max: 5000.000000)
#> Providing inflow events ... ok. (0.00 secs) 
#> Providing inflow paras ... ok. (0.00 secs) 

scenario_volume <-
  scenario_conc |>                     
  mutate(
    volume = map(
      .x = config,                                         
      .f = ~ simulate_exposure(config = .x)              
    )
  )
#> Simulated exposure: volume per event
#> Distribution set from 'triangle' to 'uniform' because 'min' equals 'max'
#> Create 1000 random distribution(s): uniform (n: 60, min: 0.001000, max: 0.001000)
#> Simulated exposure: volume per event
#> Distribution set from 'triangle' to 'uniform' because 'min' equals 'max'
#> Create 1000 random distribution(s): uniform (n: 48, min: 0.001000, max: 0.001000)

initial_dose_calculation(scenario_volume)
#> # A tibble: 2 × 27
#>   CropName   Area PopulationName    nb_population PathName     STEPtreatmentName
#>   <chr>     <dbl> <chr>                     <dbl> <chr>        <chr>            
#> 1 Tomato       10 Irrigation staff              1 Ingestion o… Q.1 - Activated …
#> 2 Corn seed    35 Maintenance staff             1 Ingestion f… Q.1 - Activated …
#> # ℹ 21 more variables: CollectiveTreatmentName <chr>, InitialProcessName <chr>,
#> #   SupplementaryProcessName <chr>, nb_day_decay <dbl>, config <list>,
#> #   CropID <dbl>, CropHeight <dbl>, PopulationID <dbl>, PathID <dbl>,
#> #   MatrixID <dbl>, STEPtreatmentID <list>, CollectiveTreatmentID <list>,
#> #   InitialProcessID <list>, SupplementaryProcessID <list>,
#> #   InitialTrainName <list>, InitialTrainID <list>,
#> #   SupplementaryTrainName <list>, SupplementaryTrainID <list>, …