simulate_sequence: Simulate a gameplay sequence between 2 strategies.

View source: R/simulate_sequence.R

simulate_sequenceR Documentation

Simulate a gameplay sequence between 2 strategies.

Description

Simulate a gameplay sequence between 2 strategies.

Usage

simulate_sequence(
  n_rounds = 40,
  strategies = c("ATFT", "ATFT"),
  error_rate = 0.05,
  arb_error_rate_type_1 = 0.1,
  arb_error_rate_type_2 = 0.1,
  xi = c(0, 0),
  pID = c(1, 2)
)

Arguments

n_rounds

The number of complete rounds to play.

strategies

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

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.

Value

A list of information.

  • g_round - The game round ID code.

  • actor_id - Player ID codes.

  • arb - Was the arbitrator called to start the round?

  • arb_err - Did the arbitrator declare an error occured?

  • coop - Did an observed cooperation occur?

  • coop_intent - Was cooperation intended?

  • coop_err - Was an error in cooperation introduced by the computer.

  • stand_1_Focal - End-round standing of focal.

  • stand_1_Alter - End-round standing of alter.

  • stand_mr_Focal - Mid-round standing of focal.

  • stand_mr_Alter - Mid-round standing of alter.


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