Skip to content

Fix/terrame ca equivalence - #20

Merged
profsergiocosta merged 5 commits into
mainfrom
fix/terrame-ca-equivalence
Oct 21, 2026
Merged

profsergiocosta merged 5 commits into
mainfrom
fix/terrame-ca-equivalence

Conversation

@profsergiocosta

Copy link
Copy Markdown
Member

No description provided.

profsergiocosta and others added 5 commits October 21, 2026 08:41
Parity.lua builds the neighborhood with wrap = true; libpysal's Rook cannot
wrap, so the waves stopped at the grid edges. Add grid_neighbors(), which
builds Von Neumann or Moore neighborhoods from the "row-col" index with
optional wrap, and use it in Parity (setup(wrap=False) keeps the old grid).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pz64hUFuJziQcwY2aRXQkz
The comment mapped TerraME (x, y) to "{y}-{x}", but the seeds were at row
15. They are now "25-20" and "25-30", consistent with Parity; the smallest
valid grid becomes 31 columns x 26 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pz64hUFuJziQcwY2aRXQkz
Growth.lua uses createNeighborhood{strategy = "vonneumann"}; the model used
Queen (8 neighbors), which grows a different cluster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pz64hUFuJziQcwY2aRXQkz
Fire.lua leaves each cell empty with probability 0.1 and sets one cell,
drawn among all cells, burning. Add FireState.EMPTY = 3 and the empty
parameter to the vector and raster models; initial_fire_density now
defaults to 0.0 (single ignition) and, above zero, keeps the old random
fraction of burning cells. Docs, the notebook and the Streamlit example
show the fourth state with a fixed colour scale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pz64hUFuJziQcwY2aRXQkz
Parity and Excitable are compared step by step with a NumPy transcription
of the Lua rules (the Parity test also checks that wrap matters); Growth
and Fire are checked for neighborhood and initial state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pz64hUFuJziQcwY2aRXQkz
@profsergiocosta
profsergiocosta merged commit 4bfaf40 into main Oct 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant