Add construction-cost helper for Mulde-Rigole optimisation#9
Merged
Conversation
New exported helpers: - default_cost_rates(): Austrian unit-cost rates from Johannes Leimgruber (OeStaP, 2026-03-27): Aushub 70, Profilierung 10 (per m²), Bodenfilter 200, Sickerbox 350, Schotterrigol 50 EUR per m³. - compute_costs(param_grid, ...): attaches a per-scenario breakdown (cost_aushub, cost_profilierung, cost_bodenfilter, cost_speicher) plus cost_total to a parameter grid that already carries mulde_area / mulde_height / filter_height / storage_height. Storage layer choice via the storage_type argument (defaults to Sickerbox) or, for mixed sweeps, a storage_type column in param_grid. Reproduces Johannes's worked example exactly: Mulde 30 cm, filter 30 cm, storage 60 cm, area 50 m² Sickerbox -> 18 200 EUR Schotterrigol -> 9 200 EUR Demo wired into vignettes/example_wien_minimal.Rmd: the results datatable now ships cost_* columns and uses filter = "top" so the table is sortable / filterable for cost-aware optimisation. https://claude.ai/code/session_014QrjF51tg7cMVmsgjmfPNG
Per maintainer request to keep naming mostly English: Rate fields in default_cost_rates(): aushub_eur_per_m3 -> excavation_eur_per_m3 profilierung_eur_per_m2 -> profiling_eur_per_m2 bodenfilter_eur_per_m3 -> filter_eur_per_m3 sickerbox_eur_per_m3 -> infiltration_box_eur_per_m3 schotterrigol_eur_per_m3 -> gravel_trench_eur_per_m3 Output cost columns from compute_costs(): cost_aushub -> cost_excavation cost_profilierung -> cost_profiling cost_bodenfilter -> cost_filter cost_speicher -> cost_storage cost_total (unchanged) storage_type accepted values: "Sickerbox" -> "infiltration_box" "Schotterrigol" -> "gravel_trench" The Austrian source terms are preserved alongside the English identifiers in the doc string so the link to Leimgruber's original "Kostenansätze Optimierung" memo is still explicit. https://claude.ai/code/session_014QrjF51tg7cMVmsgjmfPNG
Append cost_excavation, cost_profiling, cost_filter, cost_storage and cost_total to the merged simulation_results_optimisation tibble used by both full vignettes. The downstream DT::datatable already passes filter = "top", so the new cost columns become filterable / sortable in the rendered solution-space HTML widget without further changes. The chunks remain gated on data_available && is_windows && !is_ghactions so this stays a no-op on CI; cost columns appear when the vignette is rendered locally on Windows with the engine and inputs in place. https://claude.ai/code/session_014QrjF51tg7cMVmsgjmfPNG
Document the work merged in PRs #5-#9 plus the cost-optimisation changes still in this PR: - New helpers: download_engine(), compute_costs(), default_cost_rates(). - New minimal CI smoke-test vignette example_wien_minimal. - Per-scenario input data shipped under inst/extdata/models/. - CI restructure: Windows-only matrix, Claude Code Actions, Node 24 readiness. - Dependency moves (plotly to Suggests, tidyr/rlang/readr to their correct fields). - Documentation and ASCII-portability bug fixes. - Two obsolete vignettes dot-prefixed. The historical "Added a NEWS.md file..." line is preserved as the 0.0.0.9000 baseline; ongoing changes go into the "(development version)" section per tidyverse style. https://claude.ai/code/session_014QrjF51tg7cMVmsgjmfPNG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a construction-cost function for the Mulde-Rigole optimisation, based on the unit-cost rates Johannes Leimgruber (OeStaP) shared on 2026-03-27.
New exports
default_cost_rates()— Austrian unit-cost rates as a named list:compute_costs(param_grid, storage_type, cost_rates)— attaches per-scenariocost_aushub,cost_profilierung,cost_bodenfilter,cost_speicherand acost_totalcolumn. Storage layer choice via thestorage_typeargument (default"Sickerbox") or a per-rowstorage_typecolumn inparam_grid.Validation
Johannes's worked example reproduces exactly:
Vignette demo
vignettes/example_wien_minimal.Rmdnow ships the cost columns in its results datatable, and the table usesfilter = "top"so users can sort / filter oncost_totaldirectly. The accompanying paragraph explains the Sickerbox vs Schotterrigol trade-off (≈95 % vs ≈30 % porosity).Test plan
compute_costs()reproduces Johannes's example (verified locally; CI also runs the example via the minimal vignette on Windows)windows-latest(devel/oldrel/release) is greencost_aushub/cost_profilierung/cost_bodenfilter/cost_speicher/cost_totalcolumnshttps://claude.ai/code/session_014QrjF51tg7cMVmsgjmfPNG
Generated by Claude Code