Question: You will implement 2 games, the Prisoner's Dilemma, The Stag Hunt and compare their results for your report. After you finish implementing everything else, you

You will implement 2 games, the Prisoner's Dilemma, The Stag Hunt and compare their results for your report. After you finish implementing everything else, you will only need to change one function to make it a prisoner's dilemma or a stag hunt game

1) main.cpp: This is the driver program that sets up the game and plays it. This is where you will call functions to print the statistics. The required statistics is percentage of players using strategy 1 (cooperate or hunt stag) after each round of game play.

2) player.h, player.cc: These files have the definition and implementation of the player class which is a node in the game board. Each player has 4 neighbors (left, right, top, bottom). You will need to implement the functions in the player class. Instructions are in the files. For example, you need to implement the function that the player uses to set his next strategy. You will need to calculate the reward in each round and then add up the reward with the lifetime total.

3) GameBoard.h and GameBoard.cc: This class uses the player class to set up the game board. The setBoard function sets up a rectangle while setBoardTorus creates a donut shaped game board. We will just use the rectangle for this analysis. Most of the functions in this class are done using arrays. You need to change it to linked list based implementation. I suggest you do so after you have finished the Player class and it is working to your satisfaction.

-Board size and shape. -- try various board sizes and shapes (rectangle, square, line are easy to do with the given code). Plot the percentage of players for each strategy with respect to the number of times the game is played

-Starting value/percentage of Cooperating players/Stag hunters. Vary the initial number of players that use the Cooperate/Stag hunt strategy and see how the number changes for consecutive games. plot the strategy vs game number.

You will implement 2 games, the Prisoner's Dilemma, The Stag Hunt andcompare their results for your report. After you finish implementing everything else,you will only need to change one function to make it aprisoner's dilemma or a stag hunt game 1) main.cpp: This is thedriver program that sets up the game and plays it. This iswhere you will call functions to print the statistics. The required statisticsis percentage of players using strategy 1 (cooperate or hunt stag) aftereach round of game play. 2) player.h, player.cc: These files have the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!