https://github.com/boblyx/mparena
multiprocessing experiment
https://github.com/boblyx/mparena
Last synced: 3 months ago
JSON representation
multiprocessing experiment
- Host: GitHub
- URL: https://github.com/boblyx/mparena
- Owner: boblyx
- Created: 2024-09-08T10:04:53.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T10:07:21.000Z (9 months ago)
- Last Synced: 2025-01-23T20:17:09.507Z (4 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mparena
`mparena` is a example of using the `multiprocessing` library to simulate thousands of agents (the `Player` class) simultaneously by making full use of all CPU cores.The advantage of multiprocessing can be seen when simulating more than 1000 agents.
## `unshared.py`
This method is the faster implementation, but the drawback is that it is incapable of ensuring all agents work with every other agent, as agents are split into chunks which can only interact with agents of each chunk.## `shared.py`
This method is the much slower implementation, but has the advantage of allowing all agents to work with any other agent within the same `Arena`.## Usage
```bash
python unshared.py
# OR
python shared.py
```