Skip to contents

Builds equivalent annual damage (EqAD) results from a base-year and a future-year scenario compute. Wraps the ported Alternative::AnnualizationCompute. The scenario handles are consumed: annualization takes ownership of the underlying results, so a handle cannot be used twice (recompute the scenario if needed). Analysis years are validated by the shared C++ implementation before either scenario handle is converted, passed to native code, or consumed.

Usage

alternative_ead(
  base,
  future = NULL,
  base_year,
  future_year,
  period_of_analysis,
  discount_rate,
  alternative_id = 1L
)

Arguments

base, future

results from scenario_results() (or their $handle). future = NULL reuses the base scenario for both years (the single-scenario case).

base_year, future_year

base and future analysis years. The future year must be later than the base year, and their inclusive span must fit within period_of_analysis.

period_of_analysis

length of the analysis period in years. Must be at least two and contain the inclusive base-to-future span.

discount_rate

annual discount rate.

alternative_id

integer label carried into alternative_comparison().

Value

A list: mean_eqad, base_year_ead, future_year_ead, and handle (a classed external pointer, consumed by alternative_comparison(); single-use), followed by a summary data frame with impact_area_id, damage_category, asset_category, risk_type, base_year_ead, future_year_ead, and mean_eqad. The first four entries retain the 0.1.1 schema and order. Summary rows retain exact stored Fail and Non_Fail identities.