Compares the structure, equations, and simulation settings of two
stockflow models.
Value
An object of class compare_stockflow (a list) containing:
labelsNames of the two model objects (captured expressions).
addedVariables present in
sfm2but notsfm1.removedVariables present in
sfm1but notsfm2.type_changedVariables with different types.
eqn_changedVariables with different equations.
sim_settings_diffSimulation settings that differ.
propertiesPer-model counts of variables by type.
Examples
sfm1 <- stockflow("sir")
sfm2 <- stock(sfm1, "susceptible", eqn = 0.5)
compare_models(sfm1, sfm2)
#>
#> ── Stock-and-Flow Comparison: sfm1 vs sfm2 ─────────────────────────────────────
#>
#> ── Structural Differences ──
#> ! Equation changed: `susceptible`: `99999` → `0.5`
#>
#> ── Simulation Settings ──
#> ✔ Identical
#>
#> ── Model Properties ──
#> Stocks 3 3
#> Flows 2 2
#> Auxiliaries 0 0
#> Constants 4 4
#> Lookups 0 0