This function assesses the fitness of each strategy through the use of a sequential game between each focal strategy and a fixed number of random opponents.
get_fitness(history, agents, payoffs, num_opponents, rounds, useC)
A table of all possible prior moves of agents in sequence
A list of agents whose fitness will be assessed
A vector of the payoffs for CC (payoffs[1]), CD (payoffs[2]), DC (payoffs[3]) and DD (payoffs[4]) combinations of play choices from the focal player and the opponent
The number of random opponents to match the focal agent against
The number of rounds that will be played
A TRUE or FALSE value that determines whether or not c will be called to calculate agent fitnesses
fitness A vector in which elements correspond to the accumlated fitness (payoffs) of each agent