2 Intelligent Agents

Artificial Intelligence · Unit 2 · 4 hrs

Intelligent Agents

Exam-focused notes for Intelligent Agents (Artificial Intelligence, CSC266): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.

Intelligent Agents in short

This unit formalises the idea of an agent: what an agent is made of, how it is judged, how its task environment is specified, the main agent designs, and the properties of environments that determine which design is appropriate.

Intelligent Agents: notes

Introduction of agents

An agent is anything that perceives its environment through sensors and acts upon that environment through actuators (a device that causes a machine to operate, such as a motor or a display). A percept is the agent's perceptual input at a single instant, and the percept sequence is the complete history of everything the agent has ever perceived. An agent's behaviour is described by its agent function, a mapping from every possible percept sequence to an action; a software agent takes keystrokes, files and network packets as percepts and produces files and packets as actions, a human agent uses eyes, ears and other organs as sensors and hands, legs and the mouth as actuators, and a robotic agent uses cameras and range finders as sensors and motors as actuators.

Structure of Intelligent agent

An agent is described by the equation Agent = Architecture + Program. The architecture is the physical device the agent runs on, that is, the sensors and actuators together with whatever computing hardware drives them (a robotic car, a camera-equipped PC, and so on). The agent program is the actual implementation of the agent function, the piece of software that reads the current percept (and, in general, remembers the percept history) and returns an action. The same architecture can run different agent programs, so the interesting design problem in AI is writing the program, not building the hardware.

Properties of Intelligent Agents

An intelligent agent is usually expected to show a mix of internal and external characteristics. Internally: learning, the ability to improve behaviour from past experience; reactivity, the ability to respond appropriately to changes it perceives; autonomy, control over its own actions and internal state without needing constant instruction; and being goal-oriented, having well-defined goals that it works towards. Externally: communication, the ability to interact with humans or other agents to complete its tasks; cooperation, since several agents working together often solve complex tasks faster than one agent alone; mobility, the ability to move across an electronic network; and character, the ability to present external, human-like behaviour where that is useful.

A rational agent is one that, for every possible percept sequence, is expected to maximise its performance measure given the evidence the percept sequence provides and whatever knowledge the agent was built with. In short, a rational agent does the right thing, where the right thing is whatever action leads to the most successful outcome. What counts as rational at any moment depends on four things: the performance measure defining success, the agent's prior knowledge of the environment, the actions available to it, and its percept sequence so far. Rationality is not the same as omniscience: an omniscient agent already knows the actual outcome of its actions and can act accordingly, which is impossible in the real world, whereas a rational agent only maximises expected performance given what it currently knows, and can therefore still act reasonably even when a rare or unforeseeable event later makes the outcome bad.

What this unit covers

  • Introduction of agents
  • Structure of Intelligent agent
  • Properties of Intelligent Agents
  • Configuration of Agents
  • PEAS description of Agents
  • Types of Agents: Simple Reflexive, Model Based, Goal Based, Utility Based
  • Environment Types: Deterministic, Stochastic, Static, Dynamic, Observable, Semi-observable, Single Agent, Multi Agent

Environment Types

2081 · 5 marks

Justify which type of environments resembles following agents. a. Mission Game with fixed 6 states having two players. b. Tesla Driverless Robovan where road conditions are changing. c. Game Result Predicting Agent where current prediction state is independent of previous state. [5]

Show solved answer

Environment Types for Given Agents

Background

Environments are classified along several dimensions:

  • Deterministic vs Stochastic
  • Dynamic vs Static
  • Observable vs Semi-Observable

a. Mission Game with Fixed 6 States Having Two Players

This is a game-playing scenario with two players competing against each other.

PropertyJustification
Fully ObservableThe game has only 6 fixed states, meaning both players can see and access the complete state of the environment at each point in time (like a chess board).
DeterministicWith a fixed number of states (6), the next state is completely determined by the current state and the action taken. There is no randomness involved.
StaticThe environment (game state) does not change on its own while a player is deciding their move. It only changes when a player takes an action.
Multi-agent / Competitive, "Both players try to win the game" -- this is a competitive multi-agent environment.

Conclusion: This environment is Fully Observable, Deterministic, Static, and Multi-agent (Competitive).


b. Tesla Driverless Robovan Where Road Conditions Are Changing

This is a self-driving vehicle operating in a real-world road environment.

PropertyJustification
Semi-ObservableAs stated in the notes, "Driving the environment is semi-observable because what's around the corner is not known." The sensors cannot capture the complete state at all times.
StochasticAs stated in the notes, "Self Driving Cars -- the actions are not unique, it varies time to time." Road conditions keep changing unpredictably, so the next state cannot be completely determined.
DynamicThe road conditions are constantly changing (traffic, pedestrians, weather, obstacles) even while the agent is processing its next action. The notes state: "An environment that keeps constantly changing itself when the agent is up with some action is said to be dynamic."

Conclusion: This environment is Semi-Observable, Stochastic, and Dynamic -- the most complex type of environment for an agent to operate in.


c. Game Result Predicting Agent Where Current Prediction State Is Independent of Previous State

This agent predicts game results, and each prediction is made independently without considering past states.

PropertyJustification
StochasticGame results are inherently uncertain and random in nature. The outcome cannot be uniquely determined from the current state alone.
StaticThe historical data or input given to the agent does not change while the agent is computing its prediction.
Partially ObservableThe agent may not have access to all factors (player fitness, weather, morale) that affect the game result.
Memoryless (Independent States)The key characteristic here is that the current prediction state is independent of the previous state -- this resembles a Markov Property environment, where only the current state matters for decision-making, not the history.

Conclusion: This environment is Stochastic, Static, and Memoryless (Markov-type), where each prediction is made independently based only on the current state.


Summary Table

AgentObservableDeterministic/StochasticDynamic/StaticSpecial Property
Mission Game (6 states, 2 players)Fully ObservableDeterministicStaticMulti-agent, Competitive
Tesla Driverless RobovanSemi-ObservableStochasticDynamicReal-world complexity
Game Result Predicting AgentPartially ObservableStochasticStaticMemoryless / Markov
Open this answer on its own page →

2076 · 5 marks

Discuss the types of environment where an agent can work on. [5]

In Artificial Intelligence, the environment is the external context in which an agent operates. Different agents work in different types of environments. The properties of the environment directly affect the design of the agent. The main types of environments are described below: --- - An agent c...

Open this answer on its own page →

Properties of Intelligent Agents

2080 · 5 marks

What are the properties of intelligent agent? How simple reflex agents work? Give an example of simple reflex agent. [5]

Intelligent agents possess the following properties, classified into internal and external characteristics: Property Description ------ Learning An agent has the ability to learn from previous experience and successively adapt its own behaviour to the environment. Reactivity An agent must be capa...

Open this answer on its own page →

PEAS description of Agents

2080 · 5 marks

Using your own assumptions, design PEAS framework for following intelligent agents. a. Covid-19 prediction system b. Vaccine recommender system. [5]

PEAS stands for Performance Measure, Environment, Actuators, and Sensors. To design a rational agent, we must specify its task environment using the PEAS description. (Reference: "To design a rational agent we must specify its task environment. Task environment means: PEAS description of the envi...

Open this answer on its own page →

2078 · 5 marks

How agent can be configured used PEAS framework? Illustrate with example. [5]

PEAS is a framework used to describe and configure an intelligent agent by specifying four key components: Letter Stands For Description -------------------------------- P Performance Measure Criteria to evaluate agent's success E Environment The surroundings in which the agent operates A Actuato...

Open this answer on its own page →

2080.1 · 5 marks

Using your own assumptions, design PEAS framework for following intelligent agents. a. Medicine delivery drone b. Covid medicine prescriber. [5]

To design a rational agent, we must specify its task environment using the PEAS framework: - P - Performance Measure - E - Environment - A - Actuators - S - Sensors --- Assumptions: The drone operates in an urban area, picks up medicines from a pharmacy/hospital, and delivers them to patients at ...

Open this answer on its own page →

Types of Agents

2079 · 5 marks

What do you mean by Rational Agent? What are differences between Utility based agent and model based agent? [5]

--- A rational agent is an agent that acts so as to achieve the best expected outcome given its knowledge, percepts, and available actions. In other words, a rational agent selects an action that maximizes its performance measure based on: - The evidence provided by its percept sequence (history ...

Open this answer on its own page →

2080.1 · 5 marks

What is an agent? How utility agent works? Give an example of utility agent. [5]

Show solved answer

What is an Agent? Utility Agent and Example


What is an Agent? (1 mark)

An agent is anything that can perceive its environment through sensors and act upon that environment through actuators. An agent operates in a continuous cycle:

Environment --> Sensors --> Agent --> Actuators --> Environment

An agent takes a percept sequence as input and produces an action as output. The goal of an agent is to act rationally, meaning it selects actions that maximize its expected performance measure based on available knowledge.


How a Utility-Based Agent Works (2 marks)

A utility-based agent is an advanced type of agent that goes beyond simply achieving goals. It uses a utility function to measure how desirable a particular state is, allowing the agent to choose the best possible action among many alternatives.

Working Mechanism:

Percepts --> [State Representation] --> [Utility Function] --> Best Action

Step-by-step working:

  1. Perceive the current state of the environment through sensors.
  2. Maintain an internal model of the world (current state).
  3. Evaluate possible next states using a utility function, which assigns a numerical value (happiness/desirability score) to each state.
  4. Select the action that leads to the state with the maximum expected utility.
  5. Execute the chosen action through actuators.

Key Features:

  • It handles situations where multiple goals conflict with each other.
  • It handles uncertainty by computing expected utility (probability-weighted utility).
  • It does not just ask "Did I achieve the goal?" but rather "How well did I achieve it?"

Formula:

Best Action = argmax [ Σ P(outcome | action) × Utility(outcome) ]

Example of a Utility-Based Agent (2 marks)

Example: Self-Driving Taxi (Automated Taxi)

Consider an automated taxi agent navigating from point A to point B.

Possible ActionUtility Score
Take shortest route (heavy traffic)60
Take longer route (no traffic)75
Take toll route (fast, costs money)70

How it works:

  • The taxi perceives road conditions, traffic, distance, and fuel level.
  • It evaluates each possible route using a utility function that considers:
    • Travel time (less time = higher utility)
    • Passenger comfort (smooth road = higher utility)
    • Fuel cost (less cost = higher utility)
    • Safety (safer route = higher utility)
  • It selects the route with the maximum utility score (longer route with no traffic = 75).
  • This is better than a simple goal-based agent that would just pick the shortest route without considering comfort or traffic.

Why Utility Agent is Better:

  • A goal-based agent only checks: "Did I reach destination? Yes/No"
  • A utility-based agent checks: "Which path gives the best overall experience?"

This makes utility-based agents ideal for stochastic and partially observable environments (like driving) where uncertainty must be handled rationally through probability and utility calculations.

Open this answer on its own page →