game theory project

Upload: vivek

Post on 06-Mar-2016

221 views

Category:

Documents


0 download

DESCRIPTION

presentation on project battle of minds

TRANSCRIPT

Battle of MindsMAJOR PROJECTBackground Game TheoryFormal study of decision-making where several players must make choices that potentially affect the interests of the other players.Analyzing the decision making process when there are more than one decision-makers where each agents payoff possibly depends on the actions taken by the other agents. Contd. MiniMax AlgorithmTheory behind minimax is that the algorithms opponent will be trying to minimize whatever value the algorithm is trying to maximize (hence minimax).Thus the computer should make the move which leaves its opponent capable of doing the least damage.

Related worksIn 1928, John von Neumann proved the MiniMax Theorem in his article Zur Theorie der Gesellschaftsspiele.In 1956, McCarthy introduced the concept of pruning(Alpha-Beta) of irrelevant subtrees which will never be part of the MiniMax strategy. Negascout Algorithm further performs a faster pruning than the Alpha Beta Pruning

MotivationTo study aspects of artificial intelligence which is predominantly used in the game of Chess.

Blotto Games2 player game.Each of them endowed with certain number of resources, called troops.

Contd.Distribute the troops across a set of battlefields (without knowing how the opponent allocates its troops).Player wins a battlefield if they have more troops there than their opponent. Player winning in more battlefields wins the game.

Changes introducedStep-By-Step deployment of troops

Introduction of Artificial Intelligence Need for the changesModification forces each player to strategically analyse each current and previous moves of the opposition player and make the move for the next game. To study Artificial Intelligence (Combinatorial Game Theory)About the projectRules2 player game : human v/s cpu human v/s human

Initially number of Battle Fields and number of troops for each player are decided.

(contd.)Game starts with both players deploying certain no. of troops for 1st battle fieldPlayer with higher no. of troops deployed in a given battle field is winner in that battle field. After each battle field, the result is shown along with the no. of troops being deployed for that battle field. Player winning in more battlefields wins the game.

Minimax algorithmCost function which assigns a number to a game position representing how likely that position is to lead to a win. This score can be calculated for each playable position.The cost function can be used again to evaluate how the opponent is likely to play.The goal is to find a move which will maximise the value of our move and will minimise the value of the opponents moves.Minimax algorithm(CONTD.)The scoring function is unlikely to be perfect. It is therefore advisable to explore the possible moves .

The depth of the search is known as the ply of the search (so a 4-ply search examines the tree to a depth of 4). MINIMAX ALGORITHMfunction MINIMAX(N) isbeginif N is deep enough then Return the estimated score of this leafelse Let N1, N2, .., Nm be the successors of N; if N is a Min node then return min{MINIMAX(N1), .., MINIMAX(Nm)} else return max{MINIMAX(N1), .., MINIMAX(Nm)}end MINIMAX;Alpha-beta pruningReduces the number of nodes explored in Minimax strategy.

Reduces the time required for the search and it must be restricted so that no time is to be wasted searching moves that are obviously bad for the current player.Alpha beta pruning(CONTD.)ALPHA-BETA PRUNING ALGORITHMfunction MINIMAX-AB(N, A, B) is if N is deep enough then return the estimated score of this leaf else alpha = a; beta = b; If N is a Min node then For each successor Ni of N beta = min{beta, MINIMAX-AB(Ni, alpha, beta)} If alpha >= beta then return alpha end for return beta else For each successor Ni of N alpha = max{alpha, MINIMAX-AB(Ni, alpha, beta)} If alpha >= beta then return beta end for return alpha end if end ifend function

SCOPECurrently, a desktop application. We can extend it to a LAN application.

We can also make it a multiplayer(more than 2 player) game in human vs human option.Game treemaxminminmaxmaxmaxmaxmaxminminminmaxmaxminmaxmaxmaxmaxmaxBattle field 1Computers bidHumans bidEvaluation function works hereEvALUATION FUNCTION Function= win+draw-lose-val

val=temp+(bid_computer/(batfield+1))+ (batfield/(bid_computer+1))ARCHITECTURE OF projectMain()

Restart()Minimax algo()Gui_panel()Error display()Action performed()Gui_frame()

Minimax_algo()

Restart()

Data()Battle_field_display()Result_display()Minimax classGUI Frame classFinal_Result_display()ReferencesColonel Blotto Game by A.A. Grometstein and D. Shoham, 1989. The Minimax Algorithm and Alpha-Beta Algorithm by Glenn Strong, 2011.

Thank you