1. Introduction
Computer-generated ecosystems are becoming more and more popular in informatics. Through graphical observation, a real-time 3D environment simulation can help in the monitoring of numerous events and creatures to see and understand their reactions. It can show how animals live, such as when they eat or drink, as well as how they behave toward other species, such as when they hunt or flee from predators, when they group up as a pack and explore the terrain together, or when they find a mate and reproduce. Seeing models of the simulated creatures rather than just reading the simple resulting statistical values of the populations is a more visually appealing experience that may demonstrate the animals’ habits and may aid in understanding the relationship between the animals’ attribute values and their behaviors.
In an ever-changing ecosystem, reaching a balanced equilibrium state is the most difficult goal. The population of a species fluctuates, and without stabilization, any population can become extinct in a blink of an eye. To survive in a complex ecosystem environment, animals must adapt to a variety of effects. With a simplified predator–prey model, animals in the same species are always identical; they act (behave) similarly, have the same attributes (traits), and are often indistinguishable from each other. These kinds of models are irreconcilable with real-life ecosystems, where species are under the constant development of enhancing their abilities. For example, predators evolve while sharpening their senses for hunting and prey adapts and boosts its survival skills.
All living organisms have inherited anatomy, physiological features, such as eye color, muscle and bone structure, and behavior patterns, which contain inherited traits and learned characteristics. Inherited traits are inborn, unlearned inclinations, which are genetically determined, such as survival instincts and reproduction motivations. These traits are supplemented with learned elements, which are acquired by choice or through experiences—for example, dislikes of certain foods. The combinations of these complex patterns result in even more complicated responses from each individual for every situation.
Parents genetically pass on their traits to their offspring; their genotypic combination results in the formation of unique, distinct offspring. Each individual is different from others because their genetic codes are somewhat mixed in the reproduction process. In the case of dioecious reproduction, the offspring inherit half of their genes from each parent. This is why children often look similar to their parents, but they do not look exactly like them—some of the genes that are passed on to children stay hidden. Additionally, during the process, an unexpected change (error) can occur in the DNA sequence, when the DNA is copied, due to many factors. This alteration in the genome of an organism is called a mutation. Mutational effects can be beneficial, harmful, or neutral, depending on their context or location.
In this paper, we created and implemented an evolution model and incorporated it into the simulation framework that we developed in our previous work [
1], which was based on a simple predator–prey model. Our objective was to give the animals higher chances of adapting to different effects with evolutional changes. In the simulation environment model, these effects can be terrain conditions (mountains and water obstacles), other types of animal species (multiple prey and predator species), and population sizes. In
Section 2, we summarize the related biological work and implementations of simulations. In
Section 3, we will briefly present our previous system and detail why it was necessary to develop a new model (based on genetic selection) for stabilization. In
Section 4, we present how we enhanced the predator–prey model with evolutional approaches and in
Section 5, we show the steps of the implementation. In
Section 6, we show and analyze some demonstration runs from the simulation program. In
Section 7, we discuss potential areas of use, and in
Section 8, we propose improvements to future evolutional models.
2. Related Work
The predator–prey model of Alfred J. Lotka (1925) [
2] and Vito Volterra (1926) [
3], which is known as “The Lotka–Volterra equations”, is one of the earliest and most well-known ecological models. This simple model has been renewed with additional and alternative ideas, such as multi-species systems and ratio-dependent functions. The early model (logistic theory and ratio-dependent functional responses) can be examined in the “The origins and evolution of predator–prey theory”, an article by Berryman [
4]. In addition to predator–prey models, a similar host–parasitoid system was created by Nicholson and Bailey. Both models use differential equations to describe population growth, but neither model assumes that the growth of the victim population is affected by density dependence. A very good summary can be read in [
5] by Abrams, which is about the two systems in prey evolution, coevolution and stability.
Instead of examining real-life evolution, scientists tried to create different mathematical models to calculate and determine populations with genetic tools. One of the most commonly used indicators is the “effective population size” developed by Wright [
6,
7], which means the number of individuals in an ideal population that take part in the reproducing process. The simplest model which uses this indicator is where all the individuals are of the same sex and selfing is permitted [
8], but many other indicators exist with more complex models and formulas. However, as it is difficult to account for all important aspects in a reproducing process [
9], these projected effective population numbers tend to underestimate the realized effective population size. To solve the complexity of these assets, breeding cycle formulas have been created [
10] where subpopulations have the same size and generations are not overlapping. Many software products have been developed to simulate the inbreeding process [
11,
12,
13] and have been extended with many additions.
Historically, the first simplified evolutionary segregation theory was the “Mendelian inheritance” [
14], which was formulated after Mendel’s elementary hybridization experiments with pea [
15]. This pattern describes organisms’ inheritance of traits in a reproduction process. Inheritance is the transmission of discrete units of inheritance (genes) from parents to children. Mendel found that paired pea traits were either dominant or recessive. When pure-bred parent plants were cross-bred, prevailing characteristics were continuously seen within the offspring, though recessive traits had been hidden until the first-generation (F1) hybrid plants were allowed to self-pollinate. Mendel determined a 3:1 ratio of dominant to recessive traits by counting the number of second-generation (F2) progeny with dominant or recessive traits. Contrary to the popular belief of his time, he concluded that traits did not blend but remained distinct in subsequent generations. He did not know about or discover genes, but he hypothesized that there were two factors for each basic trait, one of which was inherited from each parent. Mendel’s inheritance factors are now known to be the genes, or more specifically alleles—different variants of the same gene. He discovered that when organisms with multiple traits were crossed, the offspring did not always match the parents. This is due to the principle of independent assortment, which states that different traits are inherited independently.
Natural selection [
16,
17] is a basic process of evolution when in an ecosystem the living participant organisms continually change over time. Each individual is naturally different from one another. These differences are observable characteristics or traits of an organism, which are called phenotypes. The survival and reproduction of individuals depend on their adaptive capability. In contrast with artificial selection, where the animals’ population and its breeding habits are controlled by external influences (for example, by humans), in natural selection, the most adaptive individuals can survive and inherit the gene structure. This theory is often expressed as “survival of the fittest” [
18], which describes the best and the easiest of the mechanism.
“The Genetical Theory of Natural Selection” [
19] was the most important book that combined the Mendelian genetics with Charles Darwin’s theory of natural selection, refusing the orthogenesis evolutionary hypothesis, which stated the species directional evolution and was championed by Jean-Baptiste Lamarck, Pierre Teilhard de Chardin, and Henri Bergson [
20,
21,
22]. This book helped to form the modern synthesis [
23], in which the ideas of the 19th century were integrated with multiple new subfield studies.
In research on evolutionary models, there are two main terms that come to the fore, the first is the “paradox of enrichment”, which is used when increasing the food for the prey destabilizes the predator population. It is due to the following: first, the population of the prey grows, thereby the population of the predators grows as well. This mutual growth goes on until an edge point, where the land’s food supply for the prey starts to decline, or the predators’ combined food requirement overcomes the repopulation rate of the preys, and both populations decay into a low state [
24,
25,
26]. Another problem with creating balance is the “biological control paradox” [
27,
28], where it was shown that both low and stable pest (prey) balance cannot be sustained. In real-life, the model can be observed well between parasites and their hosts, where their populations shift in cycles [
29].
Overall, it is a real challenge to create stable systems in which the species has adaptive traits. Traditionally, evolution was thought to affect the stability of predator–prey systems by shifting the values of population dynamic parameters into or out of regions where population dynamics cause cycles [
30,
31,
32]. In [
33], two models were analyzed: the first one is in which only a single reproducing prey population had the ability to change, while the other model is in which there were two prey populations with different vulnerability traits. There are models where the predators have the ability to evolve [
34]. And many new systems have been created recently in related topics with more advanced animals, for example, cows of Kenya [
35,
36] or salamander movements [
37].
4. Our New Extended Simulation System Using Gene Evolution
We created an evolutional approach to the model, where the species still have their predetermined attributes as starting points, which change as they age, but some of the attributes can evolve. Every animal has a simplified gene model, which alternates its default attributes. When two individuals (parents) with different gene structures create offspring, then their genes are combined together according to a simplified Mendel-inheritance model. This new gene creation is determined and set when the child is born. Every sibling has a different mixed gene structure originating from their parents making every child unique from the other siblings and their parents. Genes are determined with value-pair dominant and recessive values in every gene type. The dominant is the better value inherited from parents matching gene type, while the recessive is set by the second best. However, while the animals’ gene structures are changing, their skills do not surpass their parents’ set attribute values. Additionally, in order to evolve the values from the gene mixing process, genes can mutate, making the genes’ value randomly better or worse. This makes every generation of animals different from the other, and every generation contains a large variety of animals with different attributes.
With the natural selection in an ecosystem, the fittest animals can survive. The fittest is always determined by the current state and situations of the ecosystem. While the ecosystem is constantly changing, animals need to adapt. Without the animals knowing exactly what is the best attributes for the current state, they can only “guess”, meaning they have to create several children and hope at least one of them is evolved in such a way that may enable that they can survive to create offspring on its own, making an ever adaptive generational link. For example, if the predator population is low, the prey’s population will grow and consume nearly all the food on the map, resulting in a food shortage for them. The natural response would be to improve the metabolism ability to survive, but while they do this, the predators may start to improve their speed capabilities. If the predators become much faster than the prey, then they can catch them more frequently and if they have a bad metabolism (because they improved their speed and not the metabolism rate), then they can and will hunt down the majority of the prey to satisfy their needs. If they overhunt the prey, then the opposite occurs, and predators will have a food-shortage problem. If they respond correctly and increase their metabolism to adapt to the low scattered food resources, then they can survive, and thus—due to the lack of predation pressure—allows the prey population to rebound, but in the meantime, a lot of predators will become deceased. With the low predator population, we arrived back to the starting point of the example. This means that both parties periodically try to balance their population over time, resulting in an adequate (extinction-resistant) predator–prey fluctuation.
The previous example described a well-balanced system, but most of the time, this is not so simple, because if the predators behave really aggressively and dominantly, and if the prey population is low, then they might not increase their metabolism, rather their speed to compete with each other for food. This will result in a catastrophe because they will continue hunting down the already few remaining prey to extinction. This is the same with the prey if they compete with each other for the vegetation by developing their speed capabilities, then they sentence themselves to extinction. On the other hand, if they increase their metabolism rate only until the vegetation can sustain the current prey population, then they can start to increase their speed, but they do not start to compete, instead, they start to increase their survival rate. With bigger speed values they have a better survival chance against the predators’ attacks, while an excellent metabolism value does not help in this kind of situation. Consequently, the animals always have to adapt to their current situation, where the less compatible animals die, the fitter animals can more likely survive and can pass on their gene structure to future generations.
8. Conclusion and Future Works
Ecosystem simulation research and development are significant assets for ecology improvement since these frameworks provide a number of benefits, such as tracking the evolution of individual species, changes in population quantity, quality, and different ratios through time. Further opportunities for the system usage include prediction of endangered species extinction, as well as possible prevention or improvement due to artificial colonization and predicting natural disasters’ environmental impacts like climate change, earthquakes, and sea-level rise.
In this article, we have shown how to extend our system of 3D ecosystem simulation based on the predator–prey model with inheritance. Having the gene evolution algorithms built into the system, it more effectively models the ecological environment, than the old, non-evolutional version of the framework. Simulations can generate simulation data for further ecosystem research (sustainability, overpopulation, species extinction, migration) that are easier to interpret due to the appearance of 3D.
The model in some aspects is rather simple, therefore we present some ideas for further improvements in the model, for example, animal behaviors and optimization areas for conducting simulations with bigger populations, user interfaces for easier program usage.
As a model improvement, more gene types could be created to polish more of the animals’ adaptation ability. We plan to implement more mechanics in animal behaviors, framework features, and monitoring, exporting, and analyzing more data for various studies. We intend to improve and optimize some of the existing mechanics, such as more complex escape strategies for the prey, in which the animal considers all enemies and their distances and terrain formations and calculates the appropriate vector. Furthermore, redesigning the animal’s view mechanism would be more efficient.
We are planning to implement a role mechanism, which would imply that different tasks (such as hunter, explorer, and so on) may be assigned to animals within packs depending on their exceptional talents (using the new gene system). Smaller animals will have the capability to hide from predators in certain areas (such as bushes or nests). New sleeping mechanics and day–night cycles can also be considered. The model can be extended by a new family mechanics which has a greater and stronger impact on the decision-making capability than the current pack system has. For example, if a family member is in a hard situation (such as an attack), the pack (the family) will aid the individual immediately, even risking their lives, or the older members may give or share food with the younger ones in case they are hungry to a critical extent. Another way to extend the model is introducing a basic type of communication (information transmission) among family, pack and race members in order to exchange location information, such as food and water locations, dangerous regions, even basic planned hunting processes, for example, approaching and encircling the prey collectively.
Moreover, more sophisticated fighting mechanics could be defined that replaces the predators’ existing immediate killing hunting mechanics. This would create a new vitality meter (in addition to hunger and thirst meters), which would display whether the animal is full of energy (i.e., not thirsty, hungry, or injured) or depleted, and this could influence other states, such as the amount of damage they receive and inflict on others. When an animal takes an injury or has a low energy level, they begin to lose attribute value, such as speed, until the energy level reaches an ideal level, at which point the attribute will slowly be restored to its previous value. A new combat system may be built using this new fighting mechanism, such as intra-species battles over food or females, or during a hunt, a duel can be performed where the prey can attack back instead of fleeing (making a damage system that drains both competitors’ life force), or where one of the animals can choose to flee if his life level is low. If there are other animals in the area, then they can decide to aid. If a lot of prey form a band to fight back, then they could chase away or even kill a single predator, thus the predators may not always win the fight, and species without a natural enemy could also be in danger not just from hunger and thirst, but from other rallying species.
Multiple user features could improve the usage of the program, such as an animal customization interface that would allow users to create new species and alter their attributes within the software. Currently, these can be specified in a configuration file, not interactively. These new species may be used in the custom simulations and may be saved for future simulations. Instead of utilizing simply heightmaps, users could use new randomly or procedurally created maps like Perlin noise [
42] and other noise types merged.
We believe that the current system is also capable of simulating simplified ecosystems, providing a simulation framework for a wide variety of research, and with the above possible improvements, even finer modeling and even more accurate predictions could be made.