Skip to content

Comments

Param social dilemma cleanup#1458

Open
sriramsowmithri9807 wants to merge 5 commits intogoogle-deepmind:masterfrom
sriramsowmithri9807:param-social-dilemma-cleanup
Open

Param social dilemma cleanup#1458
sriramsowmithri9807 wants to merge 5 commits intogoogle-deepmind:masterfrom
sriramsowmithri9807:param-social-dilemma-cleanup

Conversation

@sriramsowmithri9807
Copy link

No description provided.

…payoffs, and Axelrod-style bots

- Implemented flexible N-player simultaneous-move game (N >= 2)
- Added dynamic payoff matrices with configurable change probability
- Implemented stochastic rewards with Gaussian noise
- Created 7 Axelrod-style bots (TitForTat, GrimTrigger, Pavlov, etc.)
- Added comprehensive unit tests (21 test cases total)
- Included example scripts for MARL usage and bot tournaments
- Added documentation (README and implementation summaries)

Features:
- Variable number of agents (default: 3)
- Dynamic and non-stationary payoff structures
- Optional reward noise for robustness studies
- Full Python API exposure for all parameters
- Compatible with OpenSpiel's simultaneous-move game API

Files added:
- Core game implementation and tests
- Axelrod-style bots and bot tests
- Usage examples and tournament demonstrations
- Documentation files
- Remove PR_SUMMARY.md and IMPLEMENTATION_SUMMARY.md
- Move implementation summary to bottom of param_social_dilemma_README.md
- Add param_social_dilemma_test.py and param_social_dilemma_bots_test.py to CMakeLists.txt
@lanctot
Copy link
Collaborator

lanctot commented Jan 24, 2026

Note: replacing #1457

@lanctot
Copy link
Collaborator

lanctot commented Jan 24, 2026

Some tests are failing: https://github.com/google-deepmind/open_spiel/actions/runs/21314790594/job/61359092220?pr=1458

Please take a look at the developer guide for adding games: https://github.com/google-deepmind/open_spiel/blob/master/docs/developer_guide.md#adding-a-game. There's a few steps missing (you need to add the game to pyspiel_test.py and add a playthrough)

Also lists can't be parameters to games. If you want to include a payoff matrix as a param you will need to pass it as a string and parse it into a matrix in the game constructor.

…st.py, add playthrough

- Change payoff_matrix parameter from list to string (lists not supported as  game parameters)
- Add _parse_payoff_matrix method to parse string representation using ast.literal_eval
- Add python_param_social_dilemma to EXPECTED_MANDATORY_GAMES in pyspiel_test.py
- Create playthrough file for integration tests
- Fixes issue with game parameters and adds required test infrastructure
- Update test_custom_payoff_matrix to use str(custom_payoff.tolist())
- Update param_social_dilemma_example.py to use string format
- Ensures compatibility with OpenSpiel's parameter system
@alexunderch
Copy link
Contributor

@sriramsowmithri9807 how is it going? Do you need any help or anything?

@sriramsowmithri9807
Copy link
Author

@alexunderch No sir, I’m working on it. Thanks for asking!

- Replaced assertions and generic RuntimeErrors with custom exception classes (IllegalActionError, InvalidStateError, InvalidParameterError)
- Added validation for 'discount' parameter in Environment constructor
- Added explicit parameter checks for Mean Field Games
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants