Skip to contents

Calculate annual cost of the scenario simulated

Usage

annual_cost(
  scenario,
  price_per_m3,
  membership_fee,
  grant,
  initialSituation,
  allocation_key = NULL
)

Arguments

scenario

data.frame scenario obtained with create_scenario function

price_per_m3

numeric, water price in euro per cubic meter

membership_fee

numeric annual membership fee in euro per hectare

grant

numeric amount of the grant in percentage

initialSituation

boolean TRUE to simulate initial situation cost, FALSE to simulation supplementary process cost

allocation_key

numeric allocation key, NULL by default

Value

result list

Examples

scenario_apprentissage <- create_scenario(
  system.file("input_1culture_2pop.xlsx", package = "ambre")
)
annual_cost(scenario = scenario_apprentissage,
            price_per_m3 = 0.1,
            membership_fee = 200,
            grant = 0.5,
            initialSituation = TRUE)
#> $plot_annual_cost

#> 
#> $allocation_key
#>   grant  CropName allocation
#> 1   0.5    Tomato     0.1111
#> 2   0.5 Corn seed     0.3889
#> 

annual_cost(scenario = scenario_apprentissage,
            price_per_m3 = 0.1,
            membership_fee = 200,
            grant = 0.5,
            initialSituation = FALSE)
#> $plot_annual_cost

#> 
#> $allocation_key
#>   grant  CropName allocation
#> 1   0.5    Tomato     0.1111
#> 2   0.5 Corn seed     0.3889
#> 

crop <- scenario_apprentissage$CropName
allocation_custom <- data.frame(CropName = crop,
                                allocation = c(0.5, 0.5))
annual_cost(scenario = scenario_apprentissage,
            price_per_m3 = 0.1,
            membership_fee = 200,
            grant = 0,
            initialSituation = TRUE,
            allocation_key = allocation_custom)
#> $plot_annual_cost

#> 
#> $allocation_key
#>   grant  CropName allocation
#> 1     0    Tomato        0.5
#> 2     0 Corn seed        0.5
#> 

annual_cost(scenario = scenario_apprentissage,
            price_per_m3 = 0.1,
            membership_fee = 200,
            grant = 0,
            initialSituation = FALSE,
            allocation_key = allocation_custom)
#> $plot_annual_cost

#> 
#> $allocation_key
#>   grant  CropName allocation
#> 1     0    Tomato        0.5
#> 2     0 Corn seed        0.5
#>