This project is designed to simulate interactions between various types of objects within a 2D environment. The simulation is implemented in Python and uses the PyGame library to visualize the interactions. The simulation's parameters and behavior can be customized through the configuration file.
To run this simulation, you need Python 3.x installed on your system. It is recommended to use a virtual environment to manage dependencies.
-
Clone the Repository:
git clone https://github.com/guloff/simulations.git cd simulations
-
Create a Virtual Environment:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
After installation, you can start the simulation by running the main.py
file.
python main.py
The simulation will open a new window where you can observe the interactions between objects. You can modify the behavior of the simulation by adjusting the parameters in the config.py
file.
The simulation's behavior can be customized via the config.py
file. This file includes settings such as screen dimensions, object properties, and energy levels.
# Screen dimensions
SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 900
# Object properties
OBJECT_RADIUS = 7
INITIAL_ENERGY = 100
# Simulation timing
TIME_INTERVAL = 100 # milliseconds
Adjust these values to experiment with different simulation scenarios.
main.py
: The main entry point of the simulation, handling initialization and the game loop.config.py
: Contains all configuration settings for the simulation.sim_object.py
: Defines theSimObject
class, representing the entities in the simulation.statistics.py
: Handles the collection and processing of simulation data.
Contributions are welcome! If you have ideas for improvements or new features, feel free to fork the repository and submit a pull request.
-
Fork the repository.
-
Create a new branch for your feature:
git checkout -b feature-branch
-
Make your changes and commit them:
git commit -m "Add new feature"
-
Push to your branch:
git push origin feature-branch
-
Open a pull request on GitHub.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.