/Evolution-Simulation

This is my first project created using Java and the JavaFX framework. It showcases a simulation of evolution based on Darwin's theory. Allows running multiple simulations simultaneously. 🐌

Primary LanguageJava

Evolution-simulation project 🌎 🌍 🌏

The application enables the user to create own simulation with selected parameters and monitoring statistics related to the number of deaths, average energy level, free fields etc.

Several simulations can be run simultaneously, so it is possible to keep track and compare results.

💡 Idea description:

The idea of this project is based on Darwin's theory. Every day the animals move, eat, reproduce and die. Each of them has a certain amount of energy which is lost by performing daily activities and gained by eating grass. They have their own genotype assigned at birth that determines their next move and which they partially inherit from their parents.

Grass doesn't grow the same everywhere. As in the normal world, it is more likely to grow in preferred fields. The location of these fields depends on the preferences selected at the start.

The world is not fair. Is there such a configuration that will help animals survive as long as possible? Check it yourself.

🛠 Core technology stack:

  • Java 17
  • Gradle
  • JavaFX
  • The icons have been sourced from here.

🐌 ☘️ Default simulation demo:

To get information about the animal you have to click "STOP" button and then click on the animal.

To continue the simulation, click the "START" button.

To close the simulation, click the "EXIT" button.

🔎 Input parameters:

  • Save data - saving to CSV file
  • Width, height - map dimensions

  • Predistination mode:
    • true - Animal's movements are determined by consecutive numbers in the genotype
    • false - In 80% of cases, a animal's movements are determined by the next gene in the genotype. In 20% of cases, a random gene is selected.
  • Toxic-dead mode:
    • true - Grass grows more often where the fewest animals have died.
    • false - Grass grows more often at the equator.
  • Is-crazy mode:
    • true - Mutation reduces/increases the gene by one.
    • false - Mutation changes a gene to a randomly selected gene.
  • hell's portal mode:
    • true - When the animal goes beyond the edge of the map, it ends up in a magical portal. There, its energy decreases the same as in the case of reproduction. After that, the animal is moved anywhere on the map.
    • false - If the animal goes beyond the northern or southern edge, it changes its direction by 180 degrees. If it goes beyond the east/west edge, it will show up on the opposite side.

  • reproduction energy - The energy an animal needs to be able to reproduce.
  • plant energy - The energy an animal gains from eating a plant.
  • initial animal energy - The energy each animal receives at the start of the simulation.
  • start number of animals/plants - Initial number of animals/plants at the start of the simulation.
  • number of plants per-day - Determines how many plants grow each day.
  • length of genotype - Length of each animal's genotype.
  • Minimum/maximum number of mutations - Determines how many genes can be changed as a result of mutation.
  • Energy that animal lost in reproduction.

🎮 How to start?

1. Enter your preferences or select "Default simulation"

2. Click "Confirm" to add next simulation.

3. Place the windows in a convenient for you place.

4. Click "Play" to start simulations.

🏴‍☠️ End of simulation:

You can end the simulation at any time by clicking the "EXIT" button.

In case all animals die, the simulation will end automatically.