Skip to content
Gustav Delius edited this page Aug 16, 2026 · 4 revisions

mizer Developer Guide

This guide provides an overview of mizer's internal architecture, design principles, and developer workflows.

Architecture Overview

  • MizerParams (S4): Central object representing the model specification. Modified via setter functions (setFishing(), setMetabolicRate(), etc.) that return new copies.
  • MizerSim (S4): Holds simulation time-series results (n, n_pp, n_other, effort).
  • S3 Methods on S4 Classes: Mizer deliberately registers methods for MizerParams and MizerSim as S3 methods (e.g. plot.MizerParams) rather than setMethod(), to avoid promoting base generics to S4 generics session-wide.
  • Two Quadrature Schemes: second_order_w selects first-order boundary values vs second-order finite-volume bin averages.
  • Gated Validation: validParams() uses validation_key() fingerprinting to cache validation checks efficiently.

Detailed Developer Guides

Guide Description
Array Wrapper Classes S3 wrapper classes around rate arrays, slot[] <- value rules, and method outputs
Integrating over Size Grid Bin averaging, sizeIntegral(), encounter kernels, and quadrature rules
Species Parameter Defaults Ownership of parameter defaults (setter-owned vs central) and given_species_params
Condition & Signal Handling User notifications, info_level, signal_info(), and frozen parameter warnings
Documenting S3 Generics Shared man pages, @usage NULL, @param ..., and avoiding codoc check errors
Upgrading Mizer Data Class changes, new slots, updating upgradeParams(), and updating stored fixtures
Test Organisation Naming conventions for test files, snapshots, and splitting files
Test Fixtures & Speed Shared _small fixtures, parallel workers, and experimental test gating
Building Documentation & Website Guide-article generation, llms.txt, _pkgdown.yml, and navbar syncing

Clone this wiki locally