Search for question
Question

/n WM3E2 Machine Intelligence: Post Module Assignment - Project Autumn, 2023 This assignment will test your understanding of intelligent agents and search algorithms, the ability to implement them under various scenarios, and handle uncertainty. The assignment consists of written and programming components, therefore you will sub- mit a yourStudentID.pdf file which consists of answers to the written questions and a yourStudent ID.py or your Student ID.ipynb file which contains the Python implementa- tion of the tasks in this project. You should also submit a searchable pdf version of the code file named yourStudentID_code.pdf (instructions are provided in the important notes and hints section.) Please refer to the assignment Guidance and Front Sheet, and mark rubric documents for important instructions pertaining to total word limit, mark distribution and submission. Supporting code for this assignment is same as that used throughout the module during the labs. All implementations can make use of any code utilities present therein. Detailed instructions for this assignment is as follows: 1 The vacuum agent - Stochastic vacuum environment We explored the simple vacuum world and the corresponding task environment during the lectures and lab sessions (depicted in Figure 1). Implement a modified vacuum environment where the agent (i) can move up, down, as well as left and right, (ii) is penalized one point for each movement, (iii) the agent's percepts give it the clean/dirty status of every square in the environment, (iv) at each time step, each clean square has a 10% chance of becoming dirty. A B Figure 1: Illustration of simple vacuum world After implementing this stochastic environment: 1. Can you come up with a rational agent design for this case? 2. Discuss and implement a possible agent program for this stochastic version. 1 WM3E2: Autumn 2023 Machine Intelligence: Project 3. Which search algorithm/s discussed in the lectures, if any, would be appropriate for this problem? Should the algorithm use tree search or graph search? 4. A version of many search algorithms is already implemented in the code supplied with this assignment. Implement another version your chosen algorithm/s to compute an optimal sequence of actions for a 3X3 world whose initial state has dirt in the three top squares and the agent in the centre. If your chosen algorithm has an already implemented version, compare the performance of both implementations. If your chosen algorithm is not implemented already, implement it and analyse its performance. 2 Multi-agent system In this section you will implement a variation of Thomas Schelling's Model of Segregation [1], which is a simple model of racial segregation. In Schelling model the world is a 2D-grid where each cell represents a house. Houses are occupied in roughly equal numbers by two kinds of agents, labelled red and blue, with 10% of the houses being empty [2]. The agents in this world have two states - happy and unhappy. Agents are happy if their neighbourhood has least two neighbours like themselves, they are unhappy otherwise. The neighbourhood consists of eight houses surrounding the agent. In the standard Schelling's model, starting from a random initial allocation of agents, the evolution of this world is simulated by choosing an agent at random and checking to see whether it is happy or not. If happy, nothing happens; if unhappy, the agent chooses one of the unoccupied cells at random and moves. Though very simple, this simulation leads to interesting results. In this section you will implement a variation of this simulation, where agents, irrespective of their reason to move, choose a house in a neighbourhood with people like themselves. Starting from a random initial allocation of agents in a 2D, 10 × 10 world, you will simulate the evolution of this world. A way to perform this simulation at given time step is to select an agent at random, then consider k randomly-chosen empty locations and choose the one with the highest fraction of similar neighbours [2]. After implementing this simulation you should, through both code and discussion in the report, explore the following: 1. The effect of k, the number of randomly chosen empty locations. 2. The time duration for which the simulation is run. 3. The Size of world, i.e. the grid size. 4. How this modified version is similar or dissimilar to the standard Schelling's model. A useful metric to compare different simulations is the degree of segregation, which is defined as the average, across all agents, of the fraction of neighbours who are the same colour as the agent. Please note this implementation must be made using the environment, agent, and other classes and functions predefined within the support files provided. If needed additional functions and classes can be defined/implemented to complement the predefined ones. These must be present in the submitted code files. Page 2 WM3E2: Autumn 2023 Machine Intelligence: Project 3 Decision Tree During the lectures we discussed in detail regarding entropy as a test for choosing attributes, discuss two other criteria that can be used for choosing the attributes. Choose datasets available in sklearn.datasets to analyse the effect of varying these parameters. Present code and corresponding results to support your discussion. Important notes and hints: 1. For questions in Sections 1 and 2 make rational assumptions for any missing information. The assumptions must be clearly stated and justified. 2. All code you implement must be in the yourStudent ID.py or your StudentID.ipynb file submitted and you must not modify any other code files supplied. 3. Various utility functions already implemented in the code files supplied can also be used for this project. 4. If you intend to use any additional packages (i.e., package other than those speci- fied/installed during the environment setup for this module) please request prior approval from the module leader before using them, content using any packages that are not pre-approved will not be marked. 5. Pseudocode to help you implement search algorithms can be found in [3]. 6. The submitted code must be clearly formatted and commented to show your understanding; this carries a weight of 5% of marks allocated to the assignment. Python's PEP8 and PEP257 detail best practices and conventions and can be useful. 7. When referring to code in the in the report please use line numbers when using a .py file and section numbers when using a .ipynb file. 8. A searchable version of the code can be created by copying the code from the .py to a word file and then converting it to .pdf. If you are submitting a .pynb file, this could be first converted to a .py file from the File-->Download As menu option and then converting it to .pdf. 9. University rules regarding plagiarism can be found here, please ensure you follow good academic practice in your submissions (code + report), any Poor Academic Practice or Academic Misconduct identified will be strictly dealt with according to university regulations. 10. All submissions (report+code) will be checked for plagiarism and any evidence of misconduct if found will be dealt with according to university policy. References [1] Schelling, T.C., 1969. Models of segregation. The American economic review, 59(2), pp.488- 493. [2] Downey, A., 2016. Think Complexity: Complexity Science and Computational Model- ing. Green Tea Press, Massachusetts. [3] Russell, S.J., and Norvig P. 2016. Artificial intelligence a modern approach. Pearson Educa- tion, Inc.. Page 3/n