Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 944 Bytes

File metadata and controls

53 lines (34 loc) · 944 Bytes

Omnivore, a contained hebivore-carnivore simulation written in C++

Omnivore is a contained simulation featuring a herbivore (which flees) and a carnivore (which pursues).

Demo gif

Getting Started

First, ensure you have the project's dependencies:

# MacOS
brew install cmake gcc ninja

# Windows
winget install Kitware.CMake
winget install LLVM.LLVM

Then, clone the project:

git clone https://codeberg.org/dalentri/omnivore.git
cd omnivore

Configure the build folder:

cmake -B build -G Ninja

Compile and run the project:

ninja -C build
./build/omnivore

Adding new agents

When adding new agents to the simulation, do so with the following syntax in the main.cpp file:

field.addAgent(std::make_unique<Being_Name>(x, y));

The current supported agent types are:

  • Herbivore
  • Carnivore

For example:

field.addAgent(std::make_unique<Herbivore>(5, 3));