Assignment 1



Outputs



Codes

Program A Program B Program C

Part D

  1. The simple reflex agent in part A of the problem will behave perfectly rationaly when the environment is already known to it . If the environment is not known then it is bound to take random disicions and hence , it's outcome will not be predefined.

  2. No , my robot in part B of the problem is not completely deterministic as whenever it encounters two adjacent squares with same amount of dirt (which is also maximum among all the four adjacent squares) it will move randomly according to the random function .

  3. Yes, in some cases the randomized agent might also perform poorly .For example :

    0 0 0 0 0 0 0.9

    0 0 0 0 0 0 0.9

    0 0 0.9 [0] 0.9 0.9 0.9

    0 0 0 0 0 0 0.9

    0 0 0 0 0 0 0.9

    if in this situation the start position is given as 4,3 and the robot makes the choice of going left instead of going right (by random function) then in the next move it will select the squares with 0 dirt and perhaps from there again some 0 dirt level square and as a result the performance will decrease

  4. In rational agent Part B: If the observations are inaccurate by 20% then also , the algorithm will remain the same but , the result might change . For example : There are 2 squares with observed dirt level: sqA : 0.7 ; sqB :0.8 According to the algorithm the bot will go to sqB . But actually ,the values might be sqA: 0.84 ; sqB : 0.64 So , the performance will decrease . In rational agent Part C: It will be similar to Part B. The algorithm will remain same but , the performance will decrease.

  5. The rational agent in Part B will not change it's behaviour . It will continue to work the same way because it has no way of remembering which square it has visited . But the rational agent in part C will change it's behaviour . It will remember the squares it has visited and will also keep a count of 'how many moves have occured after the square has been visited' .When the probability becomes greater than a threshhold limit then the bot will change the status of that square from 'visited ' to 'not visited ' .



Part E

  1. One of the assumptions we need to make is that there will be some discontinuity between the colors of the wall and the floor . We can use canny edge detection method to detect the edge of the floor and the wall . Then we need to assume that in the image wall would be on the 'upper side' and the floor would be on the 'lower portion' of the image'. 

  2. No , the value between 0 and 1 would not be enough to map “the dirt “ in each grid . First of all , it is difficult to analyze what should be classified as “dirt “ . Suppose, we classify area occupied as the amount of dirt . But in this case , the ' flipkart packing ' would be assigned value 1 . And with it's respect the leaves and the groundnut shells would be given very less value of dirt . That is not reasonable . So , a value between 0 and 1 is not the best way to map the “dirt”.

  3. If we want to map the position of the dirt to the grid then first of all we need to know where is the floor as by dirt we want to only estimate the dirt on the floor . Once we know where is the floor , we can then use canny edge detection method for finding the different colored region that contrast with the floor . We can classify them as dirt . We can also use, texture differentiation method if there is less contrast between floor and 'dirt ' . The positions where we find edges , or change in texture can be saved w.r.t the image height and width . Then it can be mapped to the grid of the image .

  4. In order to determine it's own position in the grid parallax can be used .The bot takes two images with very small time interval difference . Then it can map two points on both the images and take the differnce . Then the distance of the bot from that point can be given as : (d x/d u ) *f.