A Minimum Price Markov Game modular environment
Project description
Minimum Price Markov Game (MPMG) Environment
Overview
mpmg is a modular environment designed for studying the Minimum Price Markov Game (MPMG), a concept in game theory and algorithmic game theory. It provides an easy-to-use framework for conducting experiments with multiple agents using collusion and cooperation dynamics. This environment is useful for researchers and developers interested in game theory, reinforcement learning, and multi-agent systems.
Features
- Customizable Multi-Agent Environment: Supports different numbers of agents and heterogeneous vs. homogeneous settings.
- Test Framework: Visualize action frequencies and average rewards over time for custom MPMG configurations.
Project Structure
mpmg/
├── mpmg/ # Main package directory
│ ├── __init__.py # Package initialization
│ └── mpmg_env.py # Environment implementation
├── tests/ # Unit and integration tests
│ ├── __init__.py # Package initialization for tests (optional)
│ └── test_mpmg_logic.py # Tests and scenario validation
├── .gitignore # Ignored files for git
├── README.md # Project description and usage guide
├── requirements.txt # Project dependencies
├── setup.py # Installation script
└── LICENSE # License information
Installation
To install the package locally, run the following command from the root directory:
pip install -e .
This installs the package in "editable" mode, meaning any changes made in the source code will immediately reflect in the installed package.
Requirements
- Python 3.6+
- NumPy
Dependencies can be installed from requirements.txt:
pip install -r requirements.txt
Usage
To use the mpmg package, import the MPMGEnv class and create an instance of the environment:
from mpmg import MPMGEnv
# Create an instance of the environment
env = MPMGEnv(n_agents=2, sigma_beta=0.0)
# Reset the environment
state = env.reset(seed=42)
# Take a step in the environment
actions = [1, 0] # Example actions for each agent
rewards, next_state, done = env.step(actions)
The MPMGEnv class provides methods for resetting the environment, taking steps, and observing the state, rewards, and dynamics of multi-agent interactions.
Running Tests
Unit tests are available in the tests/ directory. You can run the tests using pytest:
pytest tests/
Tests
The test scenarios provided in test_mpmg_logic.py also generate logs of action frequencies and average rewards for each agent.
Scenarios
The environment supports the following scenarios for testing and analysis:
- Equiprobable Actions: Agents choose actions with equal probability.
- Full Defection: All agents choose to defect.
- Full Cooperation: All agents cooperate.
These scenarios can be run using the test script provided in tests/test_mpmg_logic.py.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request for improvements, bug fixes, or new features.
Author
Igor Sadoune - igor.sadoune@polymtl.ca
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpmg-0.1.0.tar.gz.
File metadata
- Download URL: mpmg-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4811a0c99e3f447e48ddeb10c3e106bccc392ab37c1527814e33a4b01d55862e
|
|
| MD5 |
9c23e943a40a7756388b223068177c04
|
|
| BLAKE2b-256 |
29e6d9aafd418b48ad4d902081945e129b0bbb69c40ce7d9f7bde9fc8ef3a3d1
|
File details
Details for the file mpmg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mpmg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29e2dd7b0f1710aaa13c3d22793fd78ae597809233cfcc0a1742531888f37e04
|
|
| MD5 |
103642bd3ac8c6fdf7c41a6810219833
|
|
| BLAKE2b-256 |
2bf83c7aaf41396355acc1678ea39a4bf872659b316e460af3bca0a2db7951c8
|