% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/collective_treatment_cost_calculation.R
\name{collective_treatment_cost_calculation}
\alias{collective_treatment_cost_calculation}
\title{Collective treatment cost calculation}
\usage{
collective_treatment_cost_calculation(scenario, grant, allocation_key = NULL)
}
\arguments{
\item{scenario}{data.frame scenario with irrigation_need_m3an column obtained with irrigation_need_calculation}

\item{grant}{numeric amount of the grant in percentage}

\item{allocation_key}{data.frame allocation key, NULL by default}
}
\value{
cost
}
\description{
Calculate cost of the simulated collective treatment train
}
\examples{
scenario_apprentissage <- create_scenario(
  system.file("input_1culture_2pop.xlsx", package = "ambre")
)
irrigation_need <- irrigation_need_calculation(scenario_apprentissage)
collective_treatment_cost_calculation(scenario = irrigation_need, 
                                      grant = 0.5)

crop <- scenario_apprentissage$CropName |> unique()
allocation_custom <- data.frame(CropName = crop,
                                allocation = c(0.5, 0.1, 0.1, 0.1, 0.1, 0.1))
collective_treatment_cost_calculation(scenario = irrigation_need, 
                                      grant = 0,
                                      allocation_key = allocation_custom)
}
