Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why do living creatures die? Can it be proved that they are reborn?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago