Skip to content

[FEAT] Port PotentialCSpatialLagRegression and AllocationCClueLikeSaturation (LuccME-BR components) #6

Open

Description

@profsergiocosta

Objective

Add the two continuous LuccME components that disslucc lacks and that the LuccME-BR model (Bezerra et al. 2022, PLOS ONE e0256052) is built from:

  • PotentialCSpatialLagRegression — potential = const + Σβx + ρ·(mean of the cell and its Moore neighbours), one parameter block per region;
  • AllocationCClueLikeSaturation — CLUE-like continuous allocation with a per-cell saturation indicator (changeLimiarValue / maxChangeAboveLimiar), one parameter block per region.

They were ported and validated in profsergiocosta/luccmebr-reconstruction (src/luccmebr/); this moves them here so that repository keeps only the model.

Technical Specifications & Context

  • components/potential/spatial_lag.py → PotentialSpatialLagRegression (interface of PotentialLinearRegression), components/allocation/saturation.py → AllocationClueLikeSaturation (interface of AllocationClueLike), specs in schemas.py.
  • Faithful to LuccME 6244dd4, including what looks accidental: the constant adaptation accumulates year to year; correctCellChange runs (spelled correctly in the Saturation variant) and its BACKP carries over from cell to cell; the neighbourhood LuccME names "11x11" is TerraME's mxn default, 3 × 3 with the cell.
  • Goldens lab03 and lab06 from terrame-docker (the two labs that combine exactly these components; lab06 also updates a driver in 2009, which shows LuccME pairs dynamic variables by position, not by id).
  • Those goldens never reach correctCellChange, the saturation branch or isolated cells, so these parts are also checked against the original Lua functions run with lupa (tests/lua/, provisional — to be replaced by component-level goldens generated in terrame-docker).
  • Existing components and Lab1/Lab15 numbers untouched.

Acceptance Criteria (Definition of Done)

  • Implementation completed in the target modules
  • Tests: potential alone and full model vs lab03/lab06 goldens (every cell, every year, plus TerraME's logged iterations and maximum error); differential tests vs the Lua for the branches the goldens do not reach
  • pytest tests/ -v still reports the same Lab1/Lab15 validation numbers
  • docs/decisions.md, docs/validation.md, docs/api.md updated
  • Pull request passes CI checks and is reviewed

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions