This project simulates particles moving and interacting within a bounded space. The simulation handles particle collisions and wall bounces using SFML for visualization and Boost for unit testing.
Project Structure
├── ParticlesSim
├── CMakeLists.txt
├── particle.cpp
├── particle.h
├── event.cpp
├── event.h
├── simulation.cpp
├── simulation.h
├── main.cpp
├── settings.h
└── tests
├── CMakeLists.txt
└── tests.cpp
├── build
└── .keep
└── README.md
Ensure you have the following installed:
CMake (version 3.10 or later)
SFML (version 2.5 or later)
Boost (version 1.65.1 or later)
cd build
cmake ../ParticlesSim
make
After building the project, you can run the simulation using:
./ParticleSimulation 100 0.2 0.5
./tests/Tests
Defines the Particle class, representing a particle in the simulation. This class includes methods for movement, collision detection, and response.
Defines the Event class, representing collision events between particles or with walls. This class includes methods for event handling and validation.
Defines the Simulation class, which manages the overall simulation, including initializing particles, predicting collisions, and running the simulation loop.
Contains the main function that sets up and starts the simulation.
Contains configuration settings for the simulation, such as window dimensions.
CMake configuration for building and running the unit tests using Boost.
Unit tests for the Particle and Event classes using the Boost Test framework.