Skip to contents

Extract nominal investment and maintenance costs per action for a given project, paired with their uncertainty bounds from the case.

Usage

prepare_sa_cost(case, project)

Arguments

case

An object of class Case containing project definitions, actions, and uncertainty parameters.

project

Character scalar, name of the project whose actions and costs are to be extracted.

Value

A data.frame with columns parameter, nominal, min, max, and type.

Details

The function extracts actions involved in project using prepare_action(). For each action, investment costs (cost_during) and maintenance costs (cost_after) are aggregated across steps. Actions with non-zero nominal costs are retained and labeled as investment_<action> and maintenance_<action>.

These nominal values are then merged with the uncertainty bounds (min, max, type) defined in case["uncertainty"] where cost_ prefix is stripped to match the parameter names.

Note that costs for the reference project are currently assumed to be zero; costs are extracted directly for project and are not yet calculated as a differential between project and reference.

Author

Frédéric Grelot, frederic.grelot.1994_cran@m4x.org

Examples

case = import_case(
    system.file("extdata", "case", "complete.ods", package = "floodam.cba")
)
#> import Case from /tmp/RtmpvMoJJK/temp_libpath2b69f6f14b9e9/floodam.cba/extdata/case/complete.ods
#>  ... done
project = setdiff(unique(case["project"][["project"]]), "baseline")[1]
prepare_sa_cost(case, project)
#>                   parameter nominal min max     type
#> 1  investment_reinforcement    1200   0 0.5 relative
#> 2       maintenance_nothing     200   0 0.5 relative
#> 3 maintenance_reinforcement    -100   0 0.5 relative