Archive for the ‘artificial intelligence’ Category


       The Structure of Agents

An intelligent agent is a combination of Agent Program and Architecture.
Intelligent Agent = Agent Program + Architecture
Agent Program is a function that implements the agent mapping from percepts to actions. There exists a variety of basic agent program designs, reflecting the kind of information made explicit and used in the decision process. The designs vary in efficiency, compactness, and flexibility. The appropriate design of the agent program depends on the nature of the environment.

Architecture is a computing device used to run the agent program.

To perform the mapping task four types of agent programs are there. They are:

                     
1. Simple reflex agents
2. Model-based reflex agents
3. Goal-based agents
4. Utility-based agents
We then explain in general terms how to convert all these into learning agents.

1.Simple reflex agents

The simplest kind of agent is the simple reflex agent. It responds directly to percepts i.e. these agent select actions on the basis of the current percept, ignoring the rest of the percept history.

An agent describes about how the condition  action rules allow the agent to make the connection from percept to action.

   Condition  action rule: if condition then action

   Rectangle  to denote the current internal state of the agents decision process.
Oval  to represent the background information in the process.

The agent program, which is also very simple, is shown in the following figure.
function SIMPLE-REFLEX-AGENT (percept) returns an action
static: rules, a set of condition-action rules
state ← INTERPRET – INPUT(percept)
rule ← RULE – MATCH(state, rules)
action ← RULE – ACTION[rule]
return action

INTERRUPT-INPUT – function generates an abstracted description of the current state from the percept.

RULE-MATCH – function returns the first rule in the set of rules that matches the given state description.

RULE-ACTION – the selected rule is executed as action of the given percept.

The agent in figure will work only ―if the correct decision can be made on the basis of only the current percept – that is, only if the environment is fully observable‖.

Example: Medical diagnosis system

            if the patient has reddish brown spots then start the treatment for measles.

2.Model-based reflex agents (Agents that keep track of the world)
The most effective way to handle partial observability is for the agent ―to keep track of the part of the world it cant see now. That is, the agent which combines the current percept with the old internal state to generate updated description of the current state.

The current percept is combined with the old internal state and it derives a new current state is updated in the state description is also. This updation requires two kinds of knowledge in the agent program. First, we need some information about how the world evolves independently of the agent. Second, we need some information about how the agents own actions affect the world.

The above two knowledge implemented in simple Boolean circuits or in complete scientific theories  is called a model of the world. An agent that uses such a model is called a model- based agent.

The above figure shows the structure of the reflex agent with internal state, showing how the current percept id combined with the old internal state to generate the updated description of the current state.

function REFLEX-AGENT-WITH-STATE (percept) returns an action
static: state, a description of the current world state
rules, a set of condition-action rules
action, the most recent action, initially none
state ← UPDATE-STATE(state, action, percept)
rule ← RULE-MATCH(state, rules)
action ← RULE-ACTION[rule]
return action

A model-based reflex agent. It keeps track of the current state of the world using an internal model. It then chooses an action in the same way as the reflex agent.

UPDATE-STATE – This is responsible for creating the new internal state description by combining percept and current state description.

3.Goal-based agents
An agent knows the description of current state and also needs some sort of goal information that describes situations that are desirable. The action matches with the current state is selected depends on the goal state.

The goal based agent is more flexible for more than one destination also. After identifying one destination, the new destination is specified, goal based agent is activated to come up with a new behavior. Search and Planning are the subfields of AI devoted to finding action sequences that achieve the agents goals.

The goal-based agent appears less efficient, it is more flexible because the knowledge that supports its decisions is represented explicitly and can be modified. The goal-based agent‘s behavior can easily be changed to go to a different location.

4. Utility-based agents (Utility – refers to ― the quality of being useful‖)

An agent generates a goal state with high – quality behavior (utility) that is, if more than one sequence exists to reach the goal state then the sequence with more reliable, safer, quicker and cheaper than others to be selected.

A utility function maps a state (or sequence of states) onto a real number, which describes the associated degree of happiness. The utility function can be used for two different cases: First, when there are conflicting goals, only some of which can be achieved (for e.g., speed and safety), the utility function specifies the appropriate tradeoff. Second, when the agent aims for several goals, none of which can be achieved with certainty, then the success can be weighted up against the importance of the goals.

Learning agents

The learning task allows the agent to operate in initially unknown environments and to become more competent than its initial knowledge.
A learning agent can be divided into four conceptual components, .

Learning element – This is responsible for making improvements. It uses the feedback from the critic on how the agent is doing and determines how the performance element should be modified to do better in the future.

Performance element – which is responsible for selecting external actions and it is equivalent to agent: it takes in percepts and decides on actions.

Critic – It tells the learning element how well the agent is doing with respect to a fixed performance standard.

Problem generator – It is responsible for suggesting actions that will lead to new and informative experiences.

  In summary, agents have a variety of components, and those components can be represented in many ways within the agent program, so there appears to be great variety among learning methods. Learning in intelligent agents can be summarized as a process of modification of each component of the agent to bring the components into closer agreement with the available feedback information, thereby improving the overall performance of the agent (All agents can improve their performance through learning).


Good Behavior: The Concept of            Rationality

An agent should act as a Rational Agent. A rational agent is one that does the right thing that is the right actions will cause the agent to be most successful in the environment.

Performance measures

A performance measures embodies the criterion for success of an agent‘s behavior. As a general rule, it is better to design performance measures according to what one actually wants in the environment, rather than according to how one thinks the agent should behave.

Rationality

What is rational at any given time depends on four things:

The performance measure that defines the criterion of success.
The agent‘s prior knowledge of the environment.
The actions that the agent can perform.
The agent‘s percept sequence to date.

This leads to a definition of a rational agent (ideal rational agent)

“For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge the agent has, that is the task of rational agent is to improve the performance measure depends on percept sequence”

Omniscience, learning, and autonomy

An omniscient agent knows the actual outcome of its actions and can act accordingly; but omniscience is impossible in reality.

A rational agent not only to gather information, but also to learn as much as possible from what it
perceives. The agent‘s initial configuration could reflect some prior knowledge of the environment, but as the agent gains experience this may be modified and augmented.

Successful agents split the task of computing the agent function into three different periods: when the agent is being designed, some of the computation is done by its designers; when it is deliberating on its next action, the agent does more computation; and as it learns from experience, it does even more computation to decide how to modify its behavior.

A rational agent should be autonomous – it should learn what it can to compensate for partial or incorrect prior knowledge. Concrete implementation, running on the agent architecture.


    The Nature of Environments

Specifying the task environment

A task environment specification includes the performance measure, the external environment, the actuators, and the sensors. In designing an agent, the first step must always be to specify the task environment as fully as possible. Task environments are specified as a PAGE (Percept, Action, Goal, Environment) (or) PEAS (Performance, Environment, Actuators, Sensors) description, both means the same.

The following table describes some of the agent types and the basic PEAS description.

Agent Type Performance Measure
Environment Actuators Sensors Taxi Driver Safe, fast, legal, comfortable trip, maximize profits Roads and other traffic, pedestrians, customers Steering, accelerator, brake, signal horn, display Cameras, sonar, speedometer, GPS, odometer, accelerometer, engine sensors, keyboard Medical diagnosis system Healthy patient, minimize costs, lawsuits Patient, hospital, staff Display questions, tests, diagnoses, treatments, referrals Keyboard entry of symptoms, findings, patient‘s answers Satellite image analysis system Correct image categorization Downlink from orbiting satellite Display categorization of scene Color pixel arrays Part-picking robot Percentage of parts in correct bins Conveyor belt with parts; bins Jointed arm and hand Camera, joint angle sensors Refinery controller Maximize purity, yield, safety Refinery, operators Valves, pumps, heaters, displays Temperature, pressure, chemical sensors Interactive Maximize student‘s score Set of students, Display exercises, Keyboard entry
English tutor on test testing agency suggestions, corrections
                Table: Examples of agent types and their PEAS descriptions

Some Software Agents (or) Software Robots (or) Soft bots exist in rich, unlimited domains. So,

Actions are done in real time.
Action is performed in the complex environment.
It is designed to scan online news sources and shows the actions with natural language processing.

Properties of task environments

Accessible vs. inaccessible (or) fully observable vs. partially observable

If an agent‘s sensors give it access to the complete state of the environment at each point in time, then we say that the task environment is fully observable. Fully observable environments are convenient because the agent need not maintain any internal state to keep track of the world.

An environment might be partially observable because of noisy and inaccurate sensors or because parts of the state are simply missing from the sensor data.

Deterministic vs. non-deterministic (or) stochastic

    If the next state of the environment is completely determined by the current state and the action executed by the agent, then the environment is deterministic; otherwise, it is stochastic. In principle, an agent need not worry about uncertainty in a fully observable, deterministic environment. If the environment is partially observable, however, then it could appear to be stochastic.

Episodic vs. non-episodic (or) sequential

   In an episodic environment, the agent‘s experience is divided into atomic episodes. Each episode consists of its own percepts and actions and it does not depend on the previous episode.

In sequential environments, the current decision could affect all future of decisions. Eg. Chess and taxi driving.

Episodic environments are much simpler than sequential environments because the agent does not need to think ahead.

Static vs. dynamic

If the environment is changing for agent‘s action then the environment is dynamic for that agent otherwise it is static.
If the environment does not change for some time, then it changes due to agent‘s performance is called semi dynamic environment.
        E.g.
               Taxi driving is dynamic.
                 Chess is semi dynamic.
          Crossword puzzles are static.

Discrete vs. continuous

If the environment has limited number of distinct, clearly defined percepts and actions then the environment is discrete. E.g. Chess
If the environment changes continuously with range of value the environment is continuous. E.g.      Taxi driving.