R/ThesisFunctions.R

Defines functions get.benchmark get.conversion get.against.itself.benchmark get.antistrat

Documented in get.against.itself.benchmark get.antistrat get.benchmark get.conversion

#' Payoff of best answer against the strategy
#'
#' @export
get.benchmark <- function(){
  benchmark <- rep(NA,9)
  names(benchmark) <- c("Mind","nice.tit.for.tat","probably.nice.Base","Rainbow.Unicorns.one","seda.strat2","ta.daaa","tft.forgive.slow","the.undertaker.1","TikTak1")
  benchmark["Mind"] <- 1.321
  benchmark["nice.tit.for.tat"] <- 0.747
  benchmark["probably.nice.Base"] <- 1.156
  benchmark["Rainbow.Unicorns.one"] <- 1.317
  benchmark["seda.strat2"] <- 0.743
  benchmark["ta.daaa"] <- 1.503
  benchmark["tft.forgive.slow"] <- 1.328
  benchmark["the.undertaker.1"] <- 1.083
  benchmark["TikTak1"] <- 1.321
  return(benchmark)
}

#' Conversion factor
#'
#' @export
get.conversion <- function(delta,T){
  return((1/(1-delta)-delta^(T)/(1-delta)))
}

#' Payoff of strategy against itself
#'
#' @export
get.against.itself.benchmark <- function(){
  against.itself <- rep(NA,9)
  names(against.itself) <- c("Mind","nice.tit.for.tat","probably.nice.Base","Rainbow.Unicorns.one","seda.strat2","ta.daaa","tft.forgive.slow","the.undertaker.1","TikTak1")
  against.itself["Mind"] <- 0.920
  against.itself["nice.tit.for.tat"] <- 0.495
  against.itself["probably.nice.Base"] <- 0.979
  against.itself["Rainbow.Unicorns.one"] <- 0.98
  against.itself["seda.strat2"] <- 0.672
  against.itself["ta.daaa"] <- 0.833
  against.itself["tft.forgive.slow"] <- 0.971
  against.itself["the.undertaker.1"] <- 0.962
  against.itself["TikTak1"] <- 0.986
  return(against.itself)
}

#' Get vector of names of counter strategy
#'
#' @export
get.antistrat <- function(){
  counter.strat <- rep(NA,9)
  names(counter.strat) <- c("Mind","nice.tit.for.tat","Rainbow.Unicorns.one","seda.strat2","ta.daaa","tft.forgive.slow","the.undertaker.1","TikTak1","probably.nice.Base")
  counter.strat["TikTak1"] <- "Antitiktak1.improved"
  counter.strat["ta.daaa"] <- "tatada"
  counter.strat["the.undertaker.1"] <- "overtaker"
  counter.strat["Mind"] <- "Antimind"
  counter.strat["nice.tit.for.tat"] <- "always.coop"
  counter.strat["Rainbow.Unicorns.one"] <- "eat.mindfreaks.2"
  counter.strat["seda.strat2"] <- "strat2.killer"
  counter.strat["tft.forgive.slow"] <- "tft.forgive.slow.killer"
  counter.strat["probably.nice.Base"] <- "probably.not.that.nice"
  return(counter.strat)
}
MartinKies/USLR documentation built on Nov. 10, 2019, 5:24 a.m.