Skip to main content

AGT Lab Server for Game Theory Competitions - A tournament server for game theory lab competitions

Project description

AGT Server

A comprehensive tournament server for game theory lab competitions, supporting multiple game types including Rock Paper Scissors, Battle of the Sexes, Chicken, Prisoner's Dilemma, Lemonade Stand, Auctions, and more.

Features

  • Multiple Game Types: Support for 9+ different game theory scenarios
  • Real-time Dashboard: Web-based monitoring and control interface
  • Tournament Management: Automated player matching and scoring
  • Extensible Architecture: Easy to add new games and agents
  • Command Line Tools: Simple CLI for server and dashboard management
  • Python Package: Easy to import and integrate into your projects

Supported Games

  • RPS: Rock Paper Scissors (2 players, 100 rounds)
  • BOS: Battle of the Sexes (2 players, 100 rounds)
  • BOSII: Battle of the Sexes II (2 players, 100 rounds)
  • Chicken: Chicken Game (2 players, 100 rounds)
  • PD: Prisoner's Dilemma (2 players, 100 rounds)
  • Lemonade: Lemonade Stand (2 players, 100 rounds)
  • Auction: Auction Game (2+ players, 100 rounds)
  • ADX2D: Ad Exchange Two Day (2+ players, 100 rounds)
  • ADX1D: Ad Exchange One Day (2+ players, 100 rounds)

Quick Start

Installation

From Source

git clone https://github.com/yourusername/agt-server.git
cd agt-server
pip install -e .

From PyPI (when published)

pip install agt-server

Basic Usage

Command Line Interface

Start the server:

agt-server --game rps --port 8080

Start the dashboard:

agt-dashboard --port 8081 --server-port 8080

Start both together:

python -m agt_server.cli both --game rps

Python API

import asyncio
from agt_server import AGTServer

# Create and configure server
config = {
    "game_type": "rps",
    "num_rounds": 100,
    "num_players": 2
}

server = AGTServer(config, host="0.0.0.0", port=8080)

# Run the server
asyncio.run(server.run())

Web Dashboard

Once running, access the dashboard at:

Detailed Usage

Server Configuration

The server accepts various configuration options:

config = {
    "game_type": "rps",           # Game to run
    "num_rounds": 100,            # Rounds per game
    "num_players": 2,             # Players per game
    "allowed_games": ["rps"],     # Restrict to specific games
    "verbose": False              # Enable debug output
}

Command Line Options

agt-server

agt-server [OPTIONS]

Options:
  --host TEXT           Host to bind to [default: 0.0.0.0]
  --port INTEGER       Port to bind to [default: 8080]
  --game TEXT          Game type [default: rps]
  --num-rounds INTEGER Number of rounds [default: 100]
  --num-players INTEGER Number of players [default: 2]
  --verbose            Enable verbose logging
  --config PATH        Custom configuration file
  --help              Show this message and exit

agt-dashboard

agt-dashboard [OPTIONS]

Options:
  --port INTEGER       Dashboard port [default: 8081]
  --server-port INTEGER Server port [default: 8080]
  --host TEXT          Dashboard host [default: localhost]
  --server-host TEXT   Server host [default: localhost]
  --help              Show this message and exit

Custom Configuration Files

Create a JSON configuration file:

{
    "game_type": "lemonade",
    "num_rounds": 200,
    "num_players": 4,
    "verbose": true,
    "allowed_games": ["lemonade", "auction"]
}

Use it with:

agt-server --config my_config.json

Development

Project Structure

agt_server/
├── core/           # Game engine and core logic
├── server/         # Tournament server
├── dashboard/      # Web dashboard
├── cli.py         # Command line interface
├── __init__.py    # Package initialization
└── requirements.txt

Running Tests

# Install development dependencies
pip install -e .[dev]

# Run tests
pytest tests/

Building the Package

# Build source distribution
python setup.py sdist

# Build wheel
python setup.py bdist_wheel

# Install build tools
pip install build
python -m build

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments

  • Game theory research community
  • Educational institutions using AGT for teaching
  • Contributors and maintainers

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

agt_lab_server-0.1.2.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agt_lab_server-0.1.2-py3-none-any.whl (3.7 MB view details)

Uploaded Python 3

File details

Details for the file agt_lab_server-0.1.2.tar.gz.

File metadata

  • Download URL: agt_lab_server-0.1.2.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for agt_lab_server-0.1.2.tar.gz
Algorithm Hash digest
SHA256 98fc4f33870d69ad4654716a0f28d22f46bca29ece14ecc2df3524246e3efccb
MD5 ed18f8864bc21764a780fa3772ca7437
BLAKE2b-256 528efa004ab5e942c5115c7c0ae9fa1322333cc6d42ddcab5542a0851ff8192d

See more details on using hashes here.

File details

Details for the file agt_lab_server-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: agt_lab_server-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for agt_lab_server-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0a05a97a21b83f0ea2c5701f6117bc34304a5dcc5d97db7201a3d08d1ed740a4
MD5 8358e2daf84b2bc2440e3372d999947b
BLAKE2b-256 e0be42fe2c21bab5d57b4aab98dd4c03d03d0718b37038cc877d248079741024

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page