Introduction
CodeProject has loads of great new .NET code and other great stuff, but when it comes to AI topics, it could use some more, in my opinion. So, I thought I would share some concepts covered in Stuart Russell and Peter Norvig's Artificial Intelligence: A Modern Approach. My intention is to educate, not to plagiarize, so I will not be covering everything in the chapter and paraphrase as much as possible. Below, I will attempt to answer an exercise question in the back of chapter 2, Intelligent Agents, in hopes for me to remember these concepts and also to share these concepts with everyone. I am not sure how this article will be received, but hey it's only the scrapbook which is kind of fitting really, but I am willing to take constructive criticism or positive feedback as to whether I should share more articles like this one in the future. I think I am becoming more of an architectural programmer than any thing else lately. Of course, this is all basic stuff and maybe boring for some AI gurus, but I would have loved an article like this when I was first getting serious about AI programming and browsing CodeProject.
What is the difference between a performance measure and a utility function?
What is an Agent?
An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through effectors.1 Effectors for humans are our ears, eyes, legs etc. For robotic agents, these can be motors and cameras etc.
What is a Rational Agent?
A rational agent performs an action correctly, but doing the correct thing doesn't always mean it is the most successful action to take. In order to evaluate what would be the most successful action for the agent to make, one must decide how and when to evaluate the agent's success. The criteria that determines how successful an agent is, is termed a performance measure.2 Each performance measure is normally unique to the agent because there is not a fixed measure appropriate for all agents, of course. Measuring performance over a long amount of time or a lifetime is ideal for satisfying the when measurement.
A very interesting topic that I have found while studying AI is knowing the difference between rationality and omniscience. An omniscience agent knows the actual outcome of its actions, and can act accordingly; but omniscience is impossible in reality.3 Take for example a person that has just bought some beautiful land in the mountains and constructs a large home to retire in. After it is completed, a large meteor plummets directly onto the house. Was it irrational to build the house where it was built? Rationality is only concerned with expected success given what has been perceived. So, the agent's personal perceptions are only one of the four important dependencies of rationality (the other three are listed in Chapter 2 and not really relevant to answer the question) at any given time. Everything that an agent has perceived so far is called a percept sequence.4 These percept sequences can be mapped to actions one by one or by more abstract and more effective methods.
Autonomy is the last thing we need to cover when defining a rational agent. It's when an agent relies not only on "built-in knowledge" by the designer. I like to think of this as an agent's innate programming, but more on its own perceptual data gathered from its environment.
What are Utility-based Agents?
Utility-based agents try and maximize their own perceived success by preferring one state over another. If one state is preferred over another then it is said to have a higher utility for the agent. A utility is therefore a function that maps a state (or a sequence of states, if we are measuring the utility of an agent over the long run) onto a real number, which describes the associated degree of happiness [perceived success].5 There are many different types of agents. The most basic are Reflex-based agents which respond directly from percepts and Goal-based agents which act just to achieve their goal. Each of these two agents are normally not as efficient as a utility-based agent.
Summary
A Performance Measure are how and when decisive factors that are needed to be known for an agent to make successful decisions. For example, if you wanted a plausible performance measure for a juggling robot, you would perhaps monitor how many bowling pins it is juggling successfully and for a certain time span. Juggling 2 bowling pins would certainly be different than juggling 3 and thus different performance measures would be created on each separate action.
While, a Utility Function is a performance measure method which analyzes an agent's own perceived performance measurements so to better choose a successful action. For example, if our juggling robot is tasked to juggle successfully for us, but we leave the decision on how many bowling pins it should juggle up to the robot (in this example, 2 or 3), while in its utility function, it will realize it doesn't perform well when juggling 3 bowling pins as it does when it juggles 2 bowling pins, unless of course, it does juggle 3 bowling pins better than juggling 2. However, from my own personal experience with juggling, I certainly juggle 2 bowling pins better than 3. :-D
Footnotes
- 1 Stuart Russell, Peter Norvig (1995) Artificial Intelligence: A Modern Approach. Intelligent Agents (p. 31)
- 2 Stuart Russell, Peter Norvig (1995) Artificial Intelligence: A Modern Approach. Intelligent Agents (p. 32)
- 3 Stuart Russell, Peter Norvig (1995) Artificial Intelligence: A Modern Approach. Intelligent Agents (p. 32)
- 4 Stuart Russell, Peter Norvig (1995) Artificial Intelligence: A Modern Approach. Intelligent Agents (p. 33)
- 5 Stuart Russell, Peter Norvig (1995) Artificial Intelligence: A Modern Approach. Intelligent Agents (p. 44)