MPDL
Computing Research Methods Multi-Perspective Digital Library

Guests are welcome to view our materials. To subscribe, edit, view raw markup, etc., you'll need to register for an account. Accounts are free (and will always be free) - your involvement helps us directly and indirectly (by demonstrating that our work matters to our funders...) StartingPoints has more info.
MPDL » IntroAIFall08 » VacuumLabFall08 » Team-5

SO FAR ---It’s been good.

The previous experience with eclipse and python has been memorable and proved to be informative and exciting. I would like to thank all involved in including python as a part of this syllabus. Let me tell you a bit about what happened previously with installation and getting python and eclipse up and running. It was rough and bumpy initially, but a small amount of information in the form of a tutorial can change the scene drastically. The tutorial was very informative and helpful. As a result the eclipse IDE and python plug-in was all in action. The version of eclipse was to be corrected and then the plug-in for python had to searched and then the path for the interpreter to be set. All this said and done I was able to create a new python project and link the code given into a file with extension .py.

Next came the code. Python being a new language, I was a bit sluggish in reading the code but as time walked passed me without my sense I was able to open my eyes wide enough to assimilate the logic behind the code.. Before this a trouble in the form of a package called util.py surfaced itself .At this point I would like extend my gratitude to my team and Nate of course. They all helped me walk past the “I am not getting this “patch of the road. Oh boy! It was a great feeling after that. All pieces of the puzzle came to their respective spots and the picture was lucid. The util.py package was to be downloaded from the internet. The kick that you feel at this point of time is ecstatic.

I am now going to provide a few snapshots of the story I have narrated so far.

This screenshot gives a sneak preview of to link the interpreter.

Next the code was run and the whole team sat down to discuss few points like:-

1. From where is the invocation taking place? 2. Where is the object created that is starting the whole process?

We then were able to read that part of the code and the next snapshot shows that.

As can be seen we commented the unwanted, well after deciding that is not necessary and not just blindly, part of the code we narrowed our focus toward ModelBasedVacuumAgent? class. Then we found out that the function or procedure called program is not doing much so commented that part and the code ran just fine.

Things that we realized:- 1. Not all of the code is necessary for the output. 2. Where the object is created ( as this the starting point). 3. The agent is run five times(well I just made a change and ran it 3 times just experimenting). 4. The locations were hard coded as(0,0) and (1,0) 5. The init_self is present in all classes like a constructor.(but I am still not able to comprehend it clearly)

The Assignment Questions.

1. Identify simple reflex agent and the environment Did the task quite easily and peeked into what these code snippets were doing in the entire code. • Environment is an abstract class representing an Environment. • The Environment class keeps a tab of the number of objects and agents.

2. Configure the environment for all possible dirt configurations and locations. For this particular question a long discussion took place in some notable amount of time. This result of the discussion is this table below. The table gives out the 8 possible combinations of dirt and locations.

The next move of the team as guided by Shawn was to pay attention to the class SimpleReflexAgent? class and get it to do the what has been asked for in the assignment therefore we replaced ModelBasedVacuumAgent? with SimpleReflexAgent? but consequently encountered errors. A piece of code which Shawn found out online at http://homepages.ius.edu/RWISMAN/C463/html/Chapter2.htm helped us do some modification to the code. We were able to run it. The addition is as follows:-

This demanded a few editions:- • Changing the variable A in the RULE_ACTION line to loc_A and B to loc_B. • Changed action = rule.action to RULE_ACTION[ rule ]. • Remove the rule which stated clean for both loc_A and loc_B. • SimplexReflexAgent? ’s functions interpret_input(input) and rule_match(state, rules) : where changed to lower case. • The arguments to SimpleReflexAgent? class was changed to SimpleReflexAgent? (rules,interpret_input))).

3. Measure the average performance of the agent. Now this is what led me to do a bit more research. The concept of performance measure was unclear until I had a discussion with Dr.Holz and she persuaded me to come up with a graph. But then giving it a thought I assumed I will be able to generate a graph in Microsoft excel. The performance measure scale I am going to be using is the number of operations the agent needs to perform before it comes to same location and does a NoOP? . This means that the agent performs these many operations before it does a NoOP? . This also can be comprehended as after how many operations the agent would have cleaned the entire environment.

This is an output from the code for reference. perceives ((1, 0), 'Dirty') and does Suck perceives ((1, 0), 'Clean') and does Left perceives ((0, 0), 'Dirty') and does Suck perceives ((0, 0), 'Clean') and does NoOp? perceives ((0, 0), 'Clean') and does NoOp?

According To the environmnet

Loc_A Dirty Loc_B Clean Loc_A Clean Loc_B Dirty Loc_A Dirty Loc_B Dirty Loc_A Clean Loc_B Clean

Agent In Loc_A Sucks 1 op Left & Sucks 2 op Sucks&left &Sucks 3 op NoOp? 0 op Agent In Loc_B Right & Suck 2 ops Sucks 1 op

Sucks&right &Sucks 3 op NoOp? 0 op

So now the average would be the sum of the all the operations divided by the entire environment combination possibilities.

(1+2+3+0+2+1+3+0)/8=12/8=1.5 operations is necessary for the agent to clean the environment. Now many assumptions are made here but while designing an agent assumptions should be made.

This is the graph after conversion. But I was not able to come up with a mean. Stating this I would like to suggest a few points. It would be great if we involve a bit of mathematics into our study of AI. The reason being mathematics can clear a few doubts which a theoretical explanation may not be able to.

PROBLEM 2.9:-

INTRODUCTION The concept of a rational agent is that it increases its performance for every action selected from the percept sequence. The simple reflex agent selects the actions on the basis of the current percept and they ignore the percept history. The vacuum agent is also a simple reflex agent because it bases the action on the current location.

THE ACTUALL PROBLEM a) The confidence with which I can say that a simple reflex agent will be completely rational is rather not high. I can remember that SRA(simple reflex agent) are of limited intelligence and the environment should be fully observable. Assuming that the environment is fully observable then the SRA will behave irrationally when it penalised.

b) An agent with state is like the agent having memory. If it has the capacity to hold information its intelligence increases. The agent will have a memory chip hardware wise that will register the position of the agent. Therefore the agent may not have to move left or right when it reaches a clean place or already cleaned spot.The reason being the agent has the general purpose interpreter and the rule set from which it makes the connection from percept to the action. The change in the environment is recognised by the rule set and the interpreter picks this rule if it come along. This will really enhance the performance of the agent in terms of speed and efficiency.

c) An agent with percept that says clean or dirty for every square in the environment .ha? A simple reflex agent will have only two rules ;  Clean-NoOp  Dirty-suck for this kind of an arrangement. The SRA continues to be rational as the rules are simple and the interpreter will not have any hindrance in comprehending the change.

The agent that has been designed with memory will be rational too. It will hold the dirt and the clean spots in its memory and will not “re visit” the clean spots again and will move to the dirty spots resulting in a faster clean environment.

CONCLUSION I would like to say that the answers I have given pertains to the understanding I have about SRAs. The second part of the question that is designing the agent has many possibilities but I taken into account the memory.

*************************GOPIKRISHNA*************************

r1 - 13 Oct 2008 - 16:41:44 - GopikrishnaNagaraja
Guests are welcome to view our materials. To subscribe, edit, view raw markup, etc., you'll need to register for an account. Accounts are free (and will always be free) - your involvement helps us directly and indirectly (by demonstrating that our work matters to our funders...) StartingPoints has more info.
This site is powered by the TWiki collaboration platformCopyright 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Ahatwiki? Send feedback Syndicate this site RSSATOM