Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Darwin World 🐑

Java Desktop App that models simulation inspired by the Charles Darwin's theory of natural selection. The application allows users to configure various parameters related to the map, animals, and simulation settings, follow real-time ecosystem changes and analyze statistics.

Project realized as a part of Object Oriented Programming Course at AGH University of Krakow by:

Zrzut ekranu 2026-03-06 134634

Project guidelines (in Polish) are located here.
A variant F is implemented (pheromones).

About

This project is a visualization of the world of herbivores traveling in search of food to survive and a partner to reproduce to expand the number of individuals of their species. Species develop over time through the mechanism of gene transmission from parents. Genes motivate the behavior and movement of animals.

The simulation world consists of a regular, rectangular area divided into square fields. Most of the world is covered by steppes, on which there are few plants that animals eat. Some areas are treated as jungles, where plants grow much faster. Plants grow in random places, but their concentration is greater in the jungle than in the steppe, the jungle is indicated by the darker shade of green.

Each animal has a certain amount of energy, which decreases each day. Finding and eating a plant increases the energy level by a certain amount.

Daily changes to the above world include:

  • removing dead animals from the map
  • turning and moving each animal
  • consuming plants
  • breeding of animals capable of reproducing located in the same field
  • growing new plants

The simulation shows how the population changes over time and allows you to observe the mechanisms that govern the considered animal world. The user can track how herbivores behave depending on the state of the ecosystem in which they live.

Features

Configuration

The simulation is highly customizable. The user can both set a myriad of parameters and use ready-made configurations that provide stunts that are interesting to observe.

Zrzut ekranu 2026-03-06 134542

As a user, you can choose:

  • height and width of the map
  • map variant
    • normal - the animal always moves as it's genotype says
    • pheromones - when the animals mate on some tile, they leave the smell of pheromones of that tile, that can attract other surrounding animals to it, the smell decays over time, with parameters:
      • decay time
      • using smell probability
      • smell radius
  • starting number of plants
  • energy provided by eating one plant
  • number of plants growing every day
  • checkbox to save statistics into .csv file
  • starting number of animals
  • initial animal energy
  • energy loss per day
  • energy necessary to consider an animal as ready to reproduce
  • energy of parents used to create offspring
  • length of the animals' genome
  • minimum and maximum number of mutations in offspring (may be equal to 0)

Visualization

The visualisation shows the animals, their rotation as well as their energy bar, the scale adjusts automatically, and works for small maps: Zrzut ekranu 2026-03-06 134728

As well as big maps: Zrzut ekranu 2026-03-06 135111 And very big ones
(the pink color is a heat map of the pheromone smell strenght)
[you may need to wait for the gif to load]: pheromones 2

Multhreading

Multiple simulations can run simultaneously thanks to multithreading. multithreading 2

Logs

The application can save simulation logs to a csv file if this option is selected in the start window. The above contains the following information for each day:

  • number of animals living on the map
  • number of plants
  • number of free fields on the map
  • most popular genotypes
  • average energy level
  • average lifespan
  • average number of children

How to run

App was developed and tested in IntelliJ IDEA using Java 25. Therefore you can run it directly in IntelliJ by clicking the Run button.
The app was tested at Windows and MacOS operating systems, however it should work as well on Linux OS
presentation 2

About

A Darwinian simulation of animal life developed in Java as an object-oriented programming project at AGH UST.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages