Project: step 6
Free extensions
Goal:
Implement free extensions.
There are all sorts of possible extensions to the project. Some ideas are given to you randomly below as a source of inspiration. Let your imagination run wild. Any "pretty" (intellectually or visually) non-trivial extension of your work is welcome!
No materials are provided for this step. If you do this, you'll want to place the relevant code in a new directory part6 so that the required part in part5 remains intact.
You'll want to document any .json configuration files you create specifically for plugins.
The extension examples provided below can serve as sources of inspiration for you. Feel free to ask for our opinion to anticipate the complexity of implementing the suggested ideas.
Sophistication/improvement of the simulation tool
The simulation tool can be improved in many ways. Here are some suggestions:
- Allowing the "logging" of statistics in files: this involves adding in Application the management of an additional key (for example 'H' ) whose effect would be to log the data produced by the statistics in a file.
For example, for general statistics, the content of this file could be:
Scorpions Lizards Cacti
5,000 31,000 45,000
4,000 30,000 45,000
...
(which corresponds to the values of the series of points associated with the "general statistics" graph at the moment when the 'H' key is pressed). This allows you to keep track of them without restarting the entire simulation and allows curve displays via gnuplot :
gnuplot -e "plot for [i=1:6] 'file_name' u i w l title columnheader(i)"
- Allow for a non-graphical simulation mode that would run numerous simulations in a loop: the goal would be to identify, for example, initial settlements that allow for the greatest longevity and stability of populations.
- Allow restart points : It is interesting to be able to stop the simulation and restart it a few days later at the point where it was left off. The idea would therefore be to store information about the state of the simulated system (which animals, in which locations, etc.) in a file and use it when launching the simulation to create the environment. It is possible to record the state of the system in files in .json format (similar to those used for simulation settings but more detailed). Note that the provided JSON directory contains the necessary functionality for writing data in json format.
- Improving performance: in the basic version of the project, managing interactions between organic entities is potentially very costly (for each animal, for example, we must examine all the existing entities to see who is in the field of vision). When the number of entities increases, the program's performance is affected. To work around this problem, it is possible to sample the space with a certain number of "cells" (portions of space gridding the world in which the organic entities live). The idea is that each animal knows at all times which cell it is in, and each cell knows the list of entities it contains, for example. Each time an animal moves, it is removed from its cell and added to its new cell. This makes it possible to quickly find entities in an animal's field of vision (without going through the entire list of organic entities again).
Sophistication of the simulated environment
Obstacle management
Obstacles introduced into the environment could alter the behavior patterns of animals (for example, they might have to go around the obstacles or expend more energy crossing them, or even hide behind them to escape predators).
Diversification of flora
One can imagine that there are different varieties of plants, some of which could have toxic effects on those who consume them.
Diversification of wildlife
Introduce predators for scorpions or other types of animals competing for the same resources.
Fog
One can imagine placing fog zones (resulting from pollution or natural causes) in the environment. This fog can lead to a decrease in the vision capabilities of animals and/or can reduce their energy or disorient them.
Exogenous factors and better management of the timing of events
We can imagine introducing a more realistic management of time with seasons affecting the reproduction or growth of plants. We can also simulate exogenous factors impacting population dynamics, such as episodes of epidemics, drought, or flooding affecting the proliferation of plants or the fertility of animals.
And as mentioned above, let your imagination run wild...