3. Task Environments and the PEAS Framework

Source: AIMA 4th Ed, Chapter 2 (Section 2.3.1), physical PDF pp. 107–111


Introduction

Before building a rational agent, you must fully specify the problem the agent is meant to solve. Russell and Norvig call this the task environment — the formal setting in which the agent operates. The PEAS framework is the structured method for doing this specification.

The core idea: task environments are the “problems” to which rational agents are the “solutions.”


The PEAS Framework

PEAS stands for:

Letter Component What it specifies
P Performance measure How is agent success evaluated?
E Environment What does the agent interact with?
A Actuators How can the agent act?
S Sensors What can the agent perceive?

Design principle: In designing an agent, the first step must always be to specify the task environment as fully as possible using PEAS. Rushing to the algorithm before specifying PEAS is a common source of poorly designed AI systems.


Worked Example: Automated Taxi Driver (Figure 2.4)

This is AIMA’s primary extended PEAS example. It illustrates how a deceptively simple-sounding task resolves into a rich, multi-dimensional environment.

Performance Measure

The taxi should: - Get to the correct destination - Minimize fuel consumption and wear and tear - Minimize trip time or cost - Minimize traffic law violations and disturbances to other drivers - Maximize safety and passenger comfort - Maximize profits

Note that some of these goals conflict (speed vs. safety, profit vs. comfort), so the performance measure must encode tradeoffs. This is already non-trivial to specify correctly — the King Midas problem applies.

Environment

The taxi operates in: - Roads of all types: rural lanes, urban alleys, 12-lane freeways - Other traffic: cars, trucks, motorcycles, cyclists - Pedestrians and stray animals - Road works, police cars, puddles, potholes - Passengers (potential and actual) - Possibly different countries (drive on left vs. right)

The more restricted the environment is defined to be, the easier the design problem becomes.

Actuators

Sensors

Complete PEAS table (Figure 2.4):

Agent Type Performance Measure Environment Actuators Sensors
Taxi driver Safe, fast, legal, comfortable trip; maximize profits; minimize impact on others Roads, other traffic, police, pedestrians, customers, weather Steering, accelerator, brake, signal, horn, display, speech Cameras, radar, speedometer, GPS, engine sensors, accelerometer, microphones, touchscreen

Additional PEAS Examples (Figure 2.5)

Agent Type Performance Measure Environment Actuators Sensors
Medical diagnosis system Healthy patient, reduced costs Patient, hospital, staff Display of questions, tests, diagnoses, treatments Touchscreen/voice entry of symptoms and findings
Satellite image analysis Correct categorization of objects, terrain Orbiting satellite, downlink, weather Display of scene categorization High-resolution digital camera
Part-picking robot Percentage of parts in correct bins Conveyor belt with parts; bins Jointed arm and hand Camera, tactile and joint angle sensors
Refinery controller Purity, yield, safety Refinery, raw materials, operators Valves, pumps, heaters, stirrers, displays Temperature, pressure, flow, chemical sensors
Interactive English tutor Student’s score on test Set of students, testing agency Display of exercises, feedback, speech Keyboard entry, voice

Software Agents (Softbots)

Virtual task environments can be just as complex as physical ones. A software agent (also called a softbot) operating on auction or reselling websites deals with: - Millions of users - Billions of objects (many with real images) - Dynamic pricing, competing agents, adversarial users

The PEAS description of a softbot is no less rich than that of a robot.


The Environment Class Concept

A single environment instance is rarely sufficient for evaluating agent performance. Experiments are typically run over an environment class — a distribution of environments sharing the same PEAS structure but varying in specific values (e.g., different traffic patterns, different weather, different passenger destinations for the taxi).


Why PEAS Matters

  1. Prevents premature optimization. Without knowing the performance measure, you cannot even define what “better” means.
  2. Exposes hidden complexity. The taxi example shows that what sounds like a simple driving task involves dozens of sensors, conflicting objectives, and an adversarial multi-agent world.
  3. Informs algorithm choice. The PEAS description directly determines which agent architecture and algorithm family is appropriate (this is the subject of Section 2.3.2 — environment properties).
  4. Enables evaluation. The performance measure component of PEAS is what you use to compare agent variants in experiments.

Common Exam Questions on PEAS


Cross-References