Repository navigation
fix: Life wrap, raster Fire neighborhood and SolidDiffusion - #21
Merged
Merged
Conversation
as in TerraME; tests against TerraME runs
Compared with TerraME 2.0.1 runs of the ca package (terrame-goldens v0.1.0),
three models differed:
- GameOfLife (vector and raster) did not wrap around the edges; TerraME's
Life uses createNeighborhood{wrap = true}. New wrap parameter, default
True.
- FireModelRaster passed no neighborhood to focal_sum_mask, which counts
the eight Moore neighbors, so the fire spread diagonally; it now uses
self.dirs (Von Neumann), as TerraME and the vector version.
- SolidDiffusion drew only among atoms and could move a vacancy several
times per step. It now follows TerraME: each vacancy draws one of all its
neighbors, reads the state at the start of the step and moves at most
once; cells in TerraME's order, on NumPy arrays.
With these fixes, the 14 deterministic cases match TerraME cell by cell at
every step, and SolidDiffusion mixes as in TerraME (26.5 vs 27 atoms past
the middle column at t = 400; 35.9 before).
tests/test_goldens.py (marker golden) runs the comparisons from an extract
of the goldens in tests/goldens (with SHA-256 provenance and the script
that makes it): grids cell by cell, ensembles by Kolmogorov-Smirnov and
mean tests. About a minute by default; DISSMODEL_GOLDEN_FULL=1 for every
step and the slow ensembles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compared with TerraME 2.0.1 runs of the ca package (terrame-goldens v0.1.0), three models differed:
With these fixes, the 14 deterministic cases match TerraME cell by cell at every step, and SolidDiffusion mixes as in TerraME (26.5 vs 27 atoms past the middle column at t = 400; 35.9 before).
tests/test_goldens.py (marker golden) runs the comparisons from an extract of the goldens in tests/goldens (with SHA-256 provenance and the script that makes it): grids cell by cell, ensembles by Kolmogorov-Smirnov and mean tests. About a minute by default; DISSMODEL_GOLDEN_FULL=1 for every step and the slow ensembles.