Skip to content

Introduction

Coopetition Gym is a research-grade Python library that provides OpenAI Gym-compatible environments for studying coopetitive dynamics in multi-agent systems.

Coopetition is the phenomenon where agents simultaneously cooperate and compete. This captures real-world scenarios better than pure cooperation or pure competition models:

  • Businesses compete for market share while cooperating on industry standards
  • Nations compete economically while cooperating on global challenges
  • Researchers compete for funding while collaborating on publications

All environments follow the OpenAI Gym interface, making them compatible with popular RL frameworks:

env = cg.make('PrisonersDilemma-v0')
obs = env.reset()
obs, rewards, done, info = env.step(actions)

Environments support configurable numbers of agents:

env = cg.make('PublicGoods-v0', n_agents=5)

Each environment is based on established game theory, with known theoretical equilibria for validation.

Coopetition Gym includes 10 environments across different categories:

CategoryEnvironments
Classic GamesPrisoner’s Dilemma, Chicken, Stag Hunt
EconomicPublic Goods, Oligopoly, Bargaining
NetworkNetwork Formation, Coalition
CustomTragedy of Commons, Resource Allocation

The library has been validated against theoretical predictions, achieving a 58/60 validation score across all environments. This ensures that agent behavior aligns with game-theoretic expectations.