https://github.com/jastka4/meadow-simulation
Project for university. Multithreaded meadow simulation in C++.
https://github.com/jastka4/meadow-simulation
conditional-variables cpp17 meadow multithreading pwr simulation
Last synced: 12 months ago
JSON representation
Project for university. Multithreaded meadow simulation in C++.
- Host: GitHub
- URL: https://github.com/jastka4/meadow-simulation
- Owner: jastka4
- License: gpl-3.0
- Created: 2019-06-05T01:47:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-23T19:17:45.000Z (almost 7 years ago)
- Last Synced: 2025-02-16T21:17:10.525Z (about 1 year ago)
- Topics: conditional-variables, cpp17, meadow, multithreading, pwr, simulation
- Language: C++
- Homepage:
- Size: 434 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Meadow simulation
Multithreaded meadow simulation using C++17 and CLion IDE. The was project created for a university course on operating systems (Wrocław University of Science and Technology).
In this simulation there are animals that can eat, drink water and think. It is done in a loop until an animal is alive. Conditional variables were used to synchronize threads.
**Threads**:
- Cow (eats grass),
- Rabbit (eats grass and can be eaten by a wolf),
- Wolf (hunts only at night),
- Sun (day and night cycle).
**Resources**:
- Pond (animals can drink water),
- Rabbit Hole (rabbits try to escape there when hunted by a wolf),
- Grass (eaten by cows and rabbits).
## Images
An example of a simulation state at the beginning:

An example of a simulation state at night:
