statistic_tools package

Submodules

statistic_tools.heatmap module

statistic_tools.heatmap.export_heatmaps(heatmaps, output_dir='statistics_plots')[source]

During the simulation, the system keeps track of how often each species (e.g., rabbit, fox) appears at different positions on the map. Based on this data, it generates heatmaps—visual representations where color intensity reflects how frequently individuals of a species were present at certain locations. The program creates one heatmap per species, then saves each heatmap as a separate PNG image file in a predefined folder (e.g., statistics_plots). This allows the user to later inspect the spatial behavior of each species—seeing, for instance, where rabbits were most active or where foxes tended to cluster.

statistic_tools.heatmap.display_heatmap(species: str, path: str = 'statistics_plots') None[source]

This feature allows the user to display a previously saved heatmap image for a specific species (such as fox or rabbit). The system locates the corresponding .png file in the folder where statistical results are stored (e.g., statistics_plots/heatmap_Fox.png) and renders the image on screen. This visualization helps the user understand where individuals of that species most frequently moved or were located during the simulation.

statistic_tools.population module

statistic_tools.population.export_population_chart(population_history, output_dir='statistics_plots')[source]

This function is designed to visualize how the population size of each species changed over time during the simulation. Each species is associated with a list that tracks the number of living individuals at every simulation step. Using this data, the function generates a line chart: each species is represented by a distinct colored line showing how its population increased, decreased, or remained stable over time. The parameter population_history is a dictionary where the keys are species names (e.g., “Fox”, “Rabbit”), and the values are lists of integers representing the population size at each step. The output_dir parameter specifies the folder where the generated chart (typically in PNG format) should be saved.

statistic_tools.population.display_population_chart(path: str = 'statistics_plots/population_chart.png') None[source]

This function is intended to display the population chart image (population_chart.png) that was saved after the simulation — if the file actually exists in the specified folder (typically statistics_plots/). The chart visually represents how the population of each species changed over time during the simulation — showing the number of living individuals per species at each simulation step. The program first checks whether the file is present in the folder. If it exists, the image is loaded and displayed on screen, allowing the user to review the results without rerunning the simulation. If the file doesn’t exist, the program may display a warning or error message.

Module contents