link to source code part-A

link to source code part-B

link to output part-A

link to sample input



E.

a. The whole grid is the floor and the walls are the edges of this picture which can be found by edge detection algorithms


  1. Yes in this case the value between 0 and 1 will be good enough because there are only pieces of papers and can be mapped according there sizes and when the suck function will be implemented it will clean the papers





D.

a. A simple reflex agent depends only on the current percept ,its action does not depend on the previous

percept . It will behave rationally in an environment for example like a medical robot in which it prescribes medicine only considering the current state of the patient not considering its past records.


b. If there is tie for the maximum amount of dust present in the neighboring cells then it will follow a random approach in selecting the cell to clean then it behaves in a non-deterministic manner. But if there is no tie for the maximum amount of dirt present then it will behave in the same way hence in a deterministic way.


  1. A randomized agent will perform poorly in an environment in which there are very less number of paths which are favorable ,hence it is highly unlikely that it follows that path,therefore in cases execpt for these paths it will perform poorly.

  1. we can use some statistical error prediction algorithm to predict error corresponding to each grid and use the corrected value as input





A.




robot A start position :(3,5) minimum score 1.6 maximum score 4.8

start position :(7,1) minimum score 0.0 maximum score 2.5