AI代写 – 人工智能作业代写 – 对抗性游戏的进化算法代写 – COMP329

COMP329 ARTIFICIAL INTELLIGENCE

Assignment 2 Finalised (Weight: 20%)

Evolutionary Algorithms for Adversarial Game Playing

 

 

 

AI代写 The goal of this assignment is to appreciate the efficacy of Evolutionary Algorithms,specif- ically Genetic Algorithm (GA), in the context of Game ···

 

The goal of this assignment is to appreciate the efficacy of Evolutionary Algorithms,specif- ically Genetic Algorithm (GA), in the context of Game Theory, in particular, Iterated Pris- oners Dilemma (IPD) and the Iterated Game of Chicken (IGC).

You will be using the DEAP package for Genetic Algorithm in order to evolve strategies for playing IPD and IGC. We have come across the Prisoners Dilemma and the Game of Chicken from the lecture slides (Week 10). Use the matrix provided in Table 1 and Table 2 for PD and GC respectively.

Table 1: Payoff matrix to be used for Prisoner’s Dilemma. D: defect; C: cooperate AI代写

 

Table 2: Payoff matrix to be used for the Game of Chicken. D: straight, C: swerve

The main issue is the representation of a strategy for playing a game like PD or Chicken as a bit string. A paper is provided in the Assignment folder that will help you with this.

Note: This assignment was discussed at the start of the lecture in Week 11 (Tuesday). Students may find it helpful to consult the video (Echo360).

AI代写
AI代写

 Task Specification  AI代写

  1. BACKGROUNDKNOWLEDGE ASSESSMENT [5 marks]
    • Considerthe Cuban missile crisis of the cold war era (see this wiki page). Sup- pose we want to model it as a two person adversarial game. Which of the two, Prisoners Dilemma and the Game of Chicken, is a more appropriate model of this situation? Answer this question in no more than 50
    • Suppose we want to represent strategies for playing IPD of memory depth 3 inthe context of GA. How many bits shall we need to represent the individuals, and why? Answer in no more than 50
    • Supposewe want to represent strategies for playing IGC of memory depth 3 in the context of GA. Considering the similarities in the payoff structures of the two games, what representational modifications, if any, will be required for this purpose?
    • Consider a strategy (individual/chromosome) of memory-depth 2 for playingIPD represented by the template: CDDC . Describe its behaviour in
    • Consider a strategy (individual/chromosome) of memory-depth 2 for playingIPD represented by the template: CCDC. Describe its behaviour in English
  2. IMPLEMENTATION[12 marks]  AI代写

    • Implementin Python the function:

payoff_to_ind1(individual1, individual2, game): returns payoff

Note: individual2 is the adversary, and payoff is determined by latest moves obtained from respective appropriate memory locations and the payoff matrix for the relevant game (PD or GC). Assume memory-depth of 2.

  • Implementin Python the function:

move_by_ind1(individual1, individual2, round): returns individual1’s move

Note: individual1’s next move is based on both the individuals’ earlier moves and individual1’s strategy (encoded in individual1’s chromo- some). The move to be returned can be C/D or 0/1 depending on your rep- resentation. Note that in early rounds some default moves are made. Assume memory-depth of 2.

  • Implementin Python the function:  AI代写

process_move(individual, move, memory_depth): returns success / failure

Note: individual’s relevant memory bits are appropriately updated based on its latest move move and memory depth.

  • Implementin Python, using the DEAP package, genetic evolution of strategies for playing  Assume a memory depth of 2.
  • Modifythe code you wrote as part of Task 2d so as to genetically evolve strate- gies for playing  Assume a memory depth of 2.
  • Whatis the best IPD-individual you generated via GA? What parameters (fit- ness function, type of crossover, mutation rate, ) did you use, and why?
  • Whatis the best IGC-individual you generated via GA? What parameters (fit- ness function, type of crossover, mutation rate, ) did you use, and why?
  1. ANALYSIS[3 marks]
    • Describe in English the behaviour of the IPD-strategy you obtained via task 2f Exploit any pattern you notice in it for this purpose.
    • Describein English the behaviour of the IGC-strategy you obtained via task 2g  Exploit any pattern you notice in it for this purpose.
    • Compare the two strategies above in terms of traits such as being nice, beingforgiving and being provocable. Make an attempt to explain any major differ- ence in these two strategies in terms of their payoff

What to Submit, and When  AI代写

You will submit two files:

  1. <yourLastnameyourFirstname> py
  2. <yourLastnameyourFirstname> pdf.

Your code file should include all the Python codes you wrote for this assignment.

Your report file should include all the answers (including the Python codes copied-and- pasted). It must be submitted in the pdf format. It must have as cover page the one that has been supplied (as part of the document template), duly filled and signed. Also, if relevant, note in the last section anything relevant that is worth noting.

AND  AI代写

You will submit the files in two stages. In the first stage you must submit two draft files (that you will be able to update) by 6:00pm, Wednesday Week 12:

  • of the program file <yourLastname yourFirstname> code.py including atleast the implementation of functions specified in Tasks 2a and
  • of your report file <yourLastname yourFirstname> report.pdf with an-swers to Tasks 1a-1e. You can modify these files while preparing your final ver-  However, failure to submit the two draft files by the required date will attract a penalty of 4 marks. The final version of these three files must be submitted by 6:00pm, Wednesday Week 13.

 

更多代写:美国CS代写 生物学代考 ANTH代写 2000字essay代写  paper代写 英国留学生essay代写

合作平台:天才代写 幽灵代  写手招聘  paper代写

发表回复