Skip to contents

Runs one ead_simulation-shaped compute per impact area and folds the results into a single scenario result, the input to alternative_ead(). Wraps the ported Scenario + ScenarioResults.

Usage

scenario_results(
  simulations,
  min_iterations = 100L,
  max_iterations = 100000L,
  deterministic = FALSE
)

Arguments

simulations

list of simulation specs. Each spec is a named list of the ead_simulation() arguments (minus the iteration controls): impact_area_id, stage_damage, and either flow_frequency + flow_stage or frequency_stage, plus optional threshold, levee, and non_failure_stage_damage.

min_iterations, max_iterations

Monte Carlo convergence bounds. Use 1, 1 with deterministic = TRUE for a single mean-value pass.

deterministic

when TRUE, every distribution collapses to its mean (no sampling).

Value

A list: summary (data frame: impact_area_id, damage_category, asset_category, mean_ead), total_ead (all impact areas and categories), and handle (a classed external pointer to the scenario results, consumed by alternative_ead()). The handle is SINGLE-USE: annualization takes ownership of the underlying results. The additive summary_by_risk frame has impact_area_id, damage_category, asset_category, risk_type, and mean_ead columns. Fail and Non_Fail are stored identities; the aggregate uses Total only as a query wildcard. The first three entries retain the 0.1.1 schema and order.