simulate_round_robin: Simulate a gameplay sequence between 2 strategies.

View source: R/simulate_round_robin.R

simulate_round_robinR Documentation

Simulate a gameplay sequence between 2 strategies.

Description

Simulate a gameplay sequence between 2 strategies.

Usage

simulate_round_robin(
  players = c("ATFT", "TFT", "TFTA"),
  n_rounds = 40,
  n_games = NULL,
  matchups = NULL,
  xi = 0,
  error_rate = 0.05,
  arb_error_rate_type_1 = 0.1,
  arb_error_rate_type_2 = 0.1,
  mode = "pairwise"
)

Arguments

players

A vector of strategies to compete pairwise in a round-robin. Names must match legal function files: i.e., "ALLC", "TFT", "GTFT", "TFTA", etc.

n_rounds

The number of complete rounds to play.

n_games

The number of games to be played. These games will be from random pairings of players. This option is active only when 'mode' is 'random'.

matchups

A n_games by 2 matrix, used when 'mode' is 'specified'. The matix must be numeric values indicating which players are paired in each game.

error_rate

The rate at which the computer introduces errors of the form C to D.

arb_error_rate_type_1

The arbitrators rate of failing to detect a real error.

arb_error_rate_type_2

The arbitrators rate of claiming an error was a true defection.

mode

'mode' must be: 'pairwise', 'random', or 'specified'. 'pairwise' creates a true round robin, with each player playing each other player. 'random' creates n_games of random pairings. 'specified' lets the user pass in the exact pairings of players using the 'matchups' matrix.

Value

A list of information.

  • moves - A move data table.

  • games - A game data table.

  • players - A players data table.


ctross/PrisonR documentation built on July 1, 2024, 11:23 p.m.