Coopetition Gym
A research-grade Python library for studying cooperative-competitive dynamics in multi-agent reinforcement learning environments.
What is Coopetition Gym?
Coopetition Gym provides OpenAI Gym-compatible environments for studying multi-agent systems where agents must simultaneously cooperate and compete — a phenomenon known as coopetition.
10 Environments
Classic and novel game-theoretic scenarios including Prisoner's Dilemma, Public Goods, and Oligopoly.
Research-Grade
Validated against theoretical predictions. 58/60 validation score across environments.
Gym Compatible
Standard OpenAI Gym interface for easy integration with existing RL frameworks.
Extensible
Modular design for adding new environments and agent types.
Quick Example
import coopetition_gym as cg
# Create an environment
env = cg.make('PrisonersDilemma-v0', n_agents=2)
# Reset and step
obs = env.reset()
for _ in range(100):
actions = [agent.act(obs[i]) for i, agent in enumerate(agents)]
obs, rewards, done, info = env.step(actions) Why Coopetition?
In the real world, entities rarely operate in pure competition or pure cooperation:
Businesses
Compete for customers while cooperating on industry standards
Nations
Compete economically while cooperating on climate policy
Researchers
Compete for funding while collaborating on papers
Research Background
This library was developed as part of research on strategic coopetition at PwC and University of Toronto.
View Publications →