Skip to content

Commit 24a8ed2

Browse files
committed
Visualization overhaul
Also changed the count_neighbors function to use scipy's convolve for speed.
1 parent 8f9effa commit 24a8ed2

6 files changed

Lines changed: 730 additions & 68 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
__pycache__/
2+
.pytest_cache/
23
.vscode/
34
results/
45
# Virtual environment

docs/prompts.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,9 @@ In the run function, check whether the entries in the cell_params arrays align w
545545
### output
546546
Made large changes to multiple functions. See git commit for details.
547547

548+
### changes
549+
Added color bars to the evolving parameters plots.
550+
548551
## CA and PP tests
549552
Now that the MVP functionality is fulfilled, we need to test it. For this, we create numerous tests for both the CA class and the PP class, testing if incorrect arguments raise the correct errors, if any functions raise unwanted errors, but mostly if the update functions work as intended.
550553

@@ -662,6 +665,16 @@ def test_predators_dominate_with_high_birth_and_zero_predator_death():
662665
### changes
663666
Revealed and fixed error in the PP class' update functions where no parameter key was passed to the _process_reproduction function, resulting in an error.
664667

668+
## More visualizations
669+
Now that we can run simulations, we need to understand what is happening. For this, we first need graphs detailing the population counts as well as the min, mean, and max values of each evolving parameter. Additionally, we need to add functionality that stops mutation after a certain amount of steps, after which we can see which parameter values survive and which go extinct.
670+
671+
### prompt
672+
Add graphs underneath the imshow plots to show the simulation state over time. For the states grid, show the population count of the prey and predator over time. For the evolving parameters, show the min, mean, and max value of that parameter over time. Only measure these values when the figure is updated, to make sure it only adds overhead every interval iterations.
673+
674+
Also create a separate plot left of the states grid plot that shows the distribution of prey neighbors for each prey. I want a histogram showing the amount of prey with each possible prey neighbor count (for moore this is 8). Below that, add a graph showing the 25%, the mean, and the 75% value for the neighbor count.
675+
676+
Lastly, add functionality to stop evolution after a certain time-step. This should be an optional argument to the run function. Also add a function to create snapshots of the histogram, states grid, and cell parameters grids. As these are snapshots, the graphs below these plots should not be included. Add another argument to the run function, which is a list of the iterations to create snapshots at. Save these snapshots to the results folder, where each run should have its own folder with snapshots. Make sure the snapshot file names include the iteration.
677+
665678
### Mean Field class
666679

667680
1. Create a baseline mean-field class based on the attached research paper on predator-prey dynamics. The class should adhere to the papers specifications. The class should have a parameter sweep method for key predator and prey parameters that will be run in Snellius. Also include a method for equilibrium analysis. Make sure to justify the logic for this method. Include docstrings with a small method description and comments for code interpretability.

0 commit comments

Comments
 (0)