
Upgrade a mizerReef 1.x params object to the current (2.0.0+) layout
Source:R/mizerReef-upgrade.R
upgradeReefParams.RdmizerReef 2.x replaced the direct rate-function overrides and flat
other_params layout used by mizerReef 1.x (the version accompanying the
original thesis, on this package's main branch) with S3 dispatch on a
mizerReef marker class and a nested other_params layout. Objects
created with mizerReef 1.x are never automatically upgraded by
mizer::validParams(), because they were never registered as a
"mizerReef" extension in the first place – there is nothing for the
automatic upgrade.mizerReef() hook to trigger on. Call this function
once, by hand, on any params object created with mizerReef 1.x to bring
it up to the current structural layout.
Details
This is a structural migration only. Tuned values that came from your
original model – algae_growth, detritus_external, capacities, the
refuge method and its parameters, species parameters – are carried over
as they were, not reset to package defaults and not silently re-tuned.
In particular, the refuge profile (refuge/bin.id/refuge_lengths) is
recomputed from your preserved method/method_params/a_bar/b_bar
using the current getRefuge() logic, since that is a deterministic
function of already-preserved inputs, not a recalibration.
Because your original algae/detritus tuning is carried over unchanged, an
upgraded object is not guaranteed to be at a genuine joint steady state
under the current algae/detritus mechanism (see vignette("extension_mechanism")
and the algae/detritus sections of setAlgaeParams()/setDetritusParams()
for what changed). Run reefSteady() on the result if you want a fresh
steady state under the current mechanism.
See also
upgrade.mizerReef() for the automatic, incremental micro-version
upgrades that run every time mizer::validParams() is called on an
already-registered mizerReef object – this function is for the
one-off 1.x -> 2.x jump only.