0% found this document useful (0 votes)
5 views

Lecture 03 - Problem Solving Agents

The document provides an introduction to artificial intelligence, focusing on agents, their functions, and types. It explains how agents perceive their environment through sensors and act upon it through actuators, emphasizing the importance of rationality and performance measures in evaluating agent behavior. Additionally, it discusses various applications of agents across different industries, including transportation, manufacturing, finance, customer service, and healthcare.

Uploaded by

Kavini Amandi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lecture 03 - Problem Solving Agents

The document provides an introduction to artificial intelligence, focusing on agents, their functions, and types. It explains how agents perceive their environment through sensors and act upon it through actuators, emphasizing the importance of rationality and performance measures in evaluating agent behavior. Additionally, it discusses various applications of agents across different industries, including transportation, manufacturing, finance, customer service, and healthcare.

Uploaded by

Kavini Amandi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

INTRODUCTION TO

ARTIFICIAL INTELLIGENCE

Mahesh Madhushan
B.Sc. in ICT (RUSL), B.Eng. (Hons) in Software Engineering (UK), M.Sc. in IT (UOP)
RECOMMENDED REFERENCE

Book Author(s) ISBN Publisher


Artificial Intelligence: A Stuart Russell 9780136042 Prentice Hall
Modern Approach and Peter 59
Norvig
INTRODUCTION TO
ARTIFICIAL INTELLIGENCE

Session 03 – Problem solving agents


SENSORS, EFFECTORS, AND
ACTUATORS
Sensor
 Sensor is a device which detects the change in the environment
and sends the information to other electronic devices. An agent
observes its environment through sensors.
Actuators
 Actuators are the component of machines that converts energy
into motion. The actuators are only responsible for moving and
controlling a system. An actuator can be an electric motor,
gears, rails, etc.
Effectors
 Effectors are the devices which affect the environment.
Effectors can be legs, wheels, arms, fingers, wings, fins, and
display screen.
AGENTS
What is an agent ?
⚫ An agent is anything that perceiving its environment
through sensors and acting upon that environment
through actuators

⚫ Example:
⚫Human is an agent
⚫A robot is also an agent with cameras and motors
⚫A thermostat detecting room temperature.
AN AGENT
An agent gets percepts one at a time and maps this percept sequence
to actions.

Human agent: eyes, ears, and other organs for sensors; hands, legs,
mouth, and other body parts for effectors (powered by muscles) ,
environment is physical world
Robotic agent: cameras and infrared range finders for sensors; various
wheels for effectors (powered by motors), environment is physical world
A software receives keystrokes, file contents, and network packets as
sensory it has encoded bit strings as its programs and actions,
environment is operating system
DIAGRAM OF AN AGENT

What AI should fill


INTELLIGENT AGENTS
SIMPLE TERMS
Percept
⚫ Agent’s the complete set of perceptual inputs at any given
instant
Percept sequence
⚫ Complete history of everything that the agent has ever
perceived.

• The current percept, or a sequence of percepts may influence the


actions of an agent
• It can change the environment through actuators
• An operation involving an actuator is called an action
• Actions can be grouped into action sequences
AGENT FUNCTION &
PROGRAM
Agent’s behavior is mathematically described by
⚫ Agent function
⚫ A function mapping any given percept sequence
to an action
Practically it is described by
⚫ An agent program
⚫ The real implementation
AGENTS AND ENVIRONMENTS

The agent function maps from percept histories to actions:


[f: P* → A]
The agent program runs on the physical architecture to produce f
agent = architecture + program
EXAMPLE OF AN AGENT
❑Let us consider a vacuum-cleaner agent that is
shown in the figure below.
❑The vacuum-cleaner world has just two locations:
squares A and B.
EXAMPLE OF AN AGENT
❑The vacuum agent perceives which square it is in
and whether there is dirt in the square.
❑It can choose to move left, move right, suck up the
dirt, or do nothing.
❑One very simple agent function is the following: if
the current square is dirty, then suck; otherwise,
move to the other square.
EXAMPLE OF AN AGENT
❑Environment: squares A and B
❑Percepts: [location, status], e.g. [A, Dirty]
❑Actions: left, right, suck, and no-op
EXAMPLE OF AN AGENT
EXAMPLE OF AN AGENT
PROGRAM

function REFLEX-VACUUM-AGENT ([location, status])


return an action
if status == Dirty then return Suck
else if location == A then return Right
else if location == B then return Left
WHO ARE THE "AGENTS" IN ARTIFICIAL
INTELLIGENCE?
An agent is an autonomous entity that perceives its environment and
acts upon it to achieve its goals.
Importance:
 Agents serve as the building blocks for creating intelligent systems
capable of interacting with their surroundings.
Agents are autonomous entities that:
 Perceive their environment through sensors (e.g., cameras, microphones).
 Process information and learn from experiences.
 Make decisions and take actions.
 Adapt to changing circumstances.

They're software programs, robots, or any system capable of


exhibiting these characteristics.
CONCEPT OF RATIONALITY
Rational agent
⚫ One that does the right thing
⚫ = every entry in the table for the agent function is
correct (rational).
What is correct?
⚫ The actions that cause the agent to be most successful
⚫ So we need ways to measure success.
PERFORMANCE MEASURE
Performance measure
⚫ An objective function that determines
⚫ How the agent does successfully
⚫ E.g., 90% or 30% ?

An agent, based on its percepts


⚫ → action sequence :
if desirable, it is said to be performing well.
⚫ No universal performance measure for all agents

A general rule:
⚫ Design performance measures according to
⚫ What one actually wants in the environment
⚫ Rather than how one thinks the agent should behave

E.g., in vacuum-cleaner example


⚫ We want the floor clean, no matter how the agent behave
⚫ We don’t restrict how the agent behaves
RATIONAL AGENT
A rational agent does the "right thing" - the action that leads to the most success based
on a performance measure.
It fills out its agent function table correctly, ensuring the right action is taken in any given
circumstance.

Performance Measures:
Performance measures define criteria for successful behavior in an environment.
An agent's performance is judged based on the sequence of actions it generates in
response to received percepts.
Success is achieved if the resulting sequence of states in the environment is desirable.
FACTORS AFFECTING RATIONALITY
Performance Measure: Criterion for success.
Agent's Prior Knowledge: Agent's understanding of the environment.
Available Actions: Set of actions the agent can perform.
Percept Sequence: Information received by the agent up to that point (perception
history).
Omniscience, Learning, and Autonomy:
Omniscience is impossible in practice; agents must act based on available
information .
Rationality involves gathering information (through actions) and learning from
percepts to improve future decisions. .
A rational agent should be autonomous - able to learn from its own experiences;
TASK ENVIRONMENTS
Task environments are the problems
⚫ While the rational agents are the solutions
Specifying the task environment
⚫ PEAS description as fully as possible
⚫Performance
⚫Environment
⚫Actuators
⚫Sensors
In designing an agent, the first step must always be to specify the task
environment as fully as possible.
Use automated taxi driver as an example
TASK ENVIRONMENTS
Performance measure
⚫ How can we judge the automated driver?
⚫ Which factors are considered?
⚫getting to the correct destination
⚫minimizing fuel consumption
⚫minimizing the trip time and/or cost
⚫minimizing the violations of traffic laws
⚫maximizing the safety and comfort, etc.

Environment
⚫ A taxi must deal with a variety of roads
⚫ Traffic lights, other vehicles, pedestrians, stray animals, road works,
police cars, etc.
⚫ Interact with the customer
Task environments
Actuators (for outputs)
⚫ Control over the accelerator, steering, gear shifting and
braking
⚫ A display to communicate with the customers

Sensors (for inputs)


⚫ Detect other vehicles, road situations
⚫ GPS (Global Positioning System) to know where the taxi is

⚫ Many more devices are necessary


EXAMPLE…
PROPERTIES OF AGENTS
Autonomy:
 Agents can act without direct human intervention
 There are different levels of autonomy, ranging from fully autonomous agents to agents that
require human supervision

Reactivity:
 Agents can perceive their environment and respond to changes in that environment.
 The ability of an agent to react to its environment is essential for its survival.

Proactivity:
 Agents can take the initiative to achieve their goals.
 Ability of an agent to take the initiative to achieve its goals. Proactive agents are not content
to simply react to their environment; they actively seek out opportunities to achieve their
goals.
 Proactivity is an important characteristic for agents that are operating in complex and
dynamic environments.
PROPERTIES OF AGENTS
Goal-directedness:
 Agents pursue specific objectives or goals
 Agents have goals that they strive to achieve. Goals can be simple or complex, and they can be either
short-term or long-term.
 The ability of an agent to achieve its goals is essential for its success.

Agent learning
 Agents can learn from their experiences. This allows them to improve their performance over time.
 There are different types of learning, including:
 Supervised learning: In supervised learning, the agent is provided with examples of correct behavior.
 Unsupervised learning: In unsupervised learning, the agent is not provided with examples of correct
behavior.
 Reinforcement learning: In reinforcement learning, the agent is rewarded for good behavior and
punished for bad behavior.
PROPERTIES OF AGENTS
Agent adaptation:
 Agents can adapt to changes in their environment. This allows them to continue to achieve their goals even
when the environment changes.
 There are different ways for agents to adapt, including:
 Changing their behavior: The agent can change its behavior to better suit the new environment.
 Changing their goals: The agent can change its goals to make them more achievable in the new
environment.
 Changing their knowledge: The agent can change its knowledge about the environment to better
understand it.

Communication:
 Agents can communicate with each other using agent communication languages (ACLs). ACLs provide a
common vocabulary and syntax for agents to exchange information.
 Agent communication is essential for agents to cooperate and coordinate their activities.
Types of Agents

Software agents: These are agents that exist in software environments,


such as computer programs or web services.
Physical agents: These are agents that exist in the physical world, such as
robots or autonomous vehicles.
Types of Agents

The world of agents isn't one-size-fits-all. They come in various forms, each with
its strengths and limitations
•Reactive Agents
•Deliberative Agents
•Hybrid Agents
•Autonomous Agents
•Model-based reflex Agents:
•Goal-based Agents
Types of Agents
•Utility-based agents: Choose actions based on their expected
satisfaction (e.g., autonomous agents maximizing rewards).
Simple reflex Agents: Base actions on current percepts (e.g., vacuum
cleaner reacting to dirt).

Sensors

Environment
What the world is like now

Condition-action rules
What should I do now

Agent Actuators
AGENT TYPES: SIMPLE
REFLEX
❑ Select action on the basis of only
the current percept,
e.g. the vacuum-agent
❑ Large reduction in possible
percept/action situations
❑ Implemented through
condition-action rules
if dirty then suck
❑ Example:
– Agent: Mail sorting robot
– Environment: Conveyor belt of letters
– Rule: e.g.
city = Edin → put Scotland bag

33
AGENT TYPES: MODEL-
BASED
❑ To tackle partially observable
environments
❑ Maintain internal state that
depends on percept history
❑ Over time update state using
world knowledge
❑ How does the world change
independently
❑ How do actions affect the world
❑ Example:
– Agent: Robot vacuum cleaner
– Environment: Dirty room, furniture
– Model: Map of room, which areas
already cleaned
34
AGENT TYPES: GOAL-
BASED
❑ The agent needs a goal to know
which situations are desirable
❑ Difficulties arise when long
sequences of actions are required
to find the goal
❑ Typically investigated in search
and planning research
❑ Major difference: future is taken
into account
❑ Example:
– Agent: Robot maid
– Environment: House and people
– Goal: Clean clothes, tidy room, table
laid, etc
35
AGENT TYPES: UTILITY-
BASED
❑ Certain goals can be reached in
different ways
❑ Some are better: have a higher
utility
❑ Utility function maps a (sequence
of) state(s) onto a real number
❑ Improves on goals:
▪ Selecting between conflicting goals
▪ Selecting between several goals
based on likelihood of success and
importance of goals
❑ Example:
– Agent: Mars Lander
– Environment: The surface of mars
with obstacles
– Utility: Shortest and obstacle-free
path

36
REACTIVE AGENTS
Respond to stimuli without internal state or goals
Reactive agents operate based on a set of predefined rules or
reflexes without maintaining an internal model of the environment.
Characteristics: Fast response time, suitable for real-time applications.
Example: Simple reflex agents in robotics for obstacle avoidance.
DELIBERATIVE AGENTS
Deliberative agents maintain an internal model of the environment and
plan their actions based on this model to achieve long-term goals.
Characteristics: Capable of reasoning and planning, suitable for
complex decision-making tasks.
Example: Chess-playing agents that simulate future moves to decide
the best course of action.
HYBRID AGENTS
Hybrid agents combine features of both reactive and
deliberative approaches to adapt to dynamic
environments while also planning for long-term objectives.
Characteristics: Flexibility to switch between reactive and
deliberative modes based on the context.
Example: Autonomous vehicles that use reactive navigation
for immediate safety and deliberative planning for long-
distance routing.
LEARNING AGENTS
Learning agents improve their performance over time by acquiring
knowledge from the environment through interaction and experience.
Types of Learning:
 Supervised Learning
 Unsupervised Learning
 Reinforcement Learning

Example: Personalized recommendation systems that learn user


preferences from past interactions.
AUTONOMOUS AGENTS
Autonomous agents are capable of making decisions and taking
actions independently without direct human intervention.
Characteristics: Self-sufficiency in accomplishing tasks, adaptability to
changing environments.
Example: Autonomous drones used for surveillance or delivery tasks.
ARCHITECTURE OF AN AGENT
Building Blocks of Intelligence
The architecture of an agent typically consists of the following
components:
ARCHITECTURE OF AN AGENT
Sensors: Sensors allow the agent to perceive its environment. (e.g.,
camera data, sensor readings).
Actuators / Effectors: Influence the environment by allowing the agent
to act on its environment. (e.g., robot movement, speech output).
Memory: Memory allows the agent to store information about its
environment, knowledge and its goals.
Reasoning: Processes information, draws conclusions and allows the
agent to make decisions about how to achieve its goals.
Goals: Define the objectives the agent aims to achieve.
APPLICATIONS OF AGENTS

• Agents are not just future concepts, they're already


having a real impact on various industries and
shaping our daily lives in exciting ways

Transportation:
 Self-driving cars: Revolutionizing transportation with autonomous navigation and
improved safety.
 Traffic optimization systems: Reducing congestion and optimizing traffic flow in
real-time.
 Personalized route planning apps: Recommending the most efficient routes based
on individual preferences and real-time traffic conditions.
APPLICATIONS OF AGENTS
•Manufacturing:
• Robot-assisted assembly lines: Increasing efficiency and accuracy in
production processes.
• Quality control checks: Identifying defects with high precision and minimizing
human error.
• Predictive maintenance: Preventing equipment failures through data analysis
and proactive intervention.
APPLICATIONS OF AGENTS
•Finance:
• Fraud detection: Analyzing transactions to identify and prevent fraudulent
activities.
• Algorithmic trading platforms: Executing trades at high speed and optimizing
investment strategies.
• Automated financial advisors: Providing personalized financial advice
based on individual goals and risk tolerance.

•Customer service:
• Chatbots: Offering 24/7 support, answering questions, and resolving customer
issues efficiently.
• Personalized product recommendations: Suggesting products based on past
purchases and browsing behavior.
• Virtual assistants: Managing schedules, booking appointments, and
automating routine tasks.
APPLICATIONS OF AGENTS
•Healthcare:
• Surgical robots: Assisting surgeons with complex procedures and improving
patient outcomes.
• Personalized medicine recommendations: Tailoring treatment plans based
on individual patient data and risk factors.
• AI-powered diagnostic tools: Assisting doctors in analyzing medical images
and identifying diseases.

Entertainment:
 Video game AI
 Personalized recommendations
 Virtual assistants.
BEYOND THE BASICS

Dive deeper into the exciting world of agents as they evolve beyond simple
reflexes and delve into the realm of learning:

Planning agents: Think ahead like chess-playing robots, analyzing potential


moves and choosing the best path to victory.
Social agents: Interact with others like collaborative robots, working
together on tasks or even engaging in natural conversation.
Adaptive agents: Adjust to dynamic environments like self-driving cars
navigating changing traffic patterns or robots exploring unknown terrains.
ETHICAL CONSIDERATIONS
Agents offer immense potential, but responsible
development is crucial. Here are some key ethical
considerations across various fields:

Bias and fairness: Ensuring algorithms are unbiased and treat everyone equally.
 Healthcare: Algorithms biased against certain demographics could lead to unequal
access to care. (Example: AI healthcare tool prioritizing younger patients for treatment
due to higher predicted lifespan.)
 Finance: Algorithmic bias in loan approvals could discriminate against specific groups.
(Example: AI-powered credit scoring systems unfairly penalizing individuals based on
zip code.)
ETHICAL CONSIDERATIONS
Transparency and explainability: Understanding how agents reach decisions, especially in
critical areas.
 Transportation: How do self-driving cars make decisions, and can passengers understand their
reasoning? (Example: Lack of transparency in self-driving car accidents raising concerns about
accountability.)
 Justice: Algorithmic sentencing in courts should be transparent and explainable to ensure fairness.
(Example: Concerns about black box algorithms disproportionately affecting marginalized
communities.)

Security and privacy: Protecting sensitive data and preventing malicious use of agents.
 Customer service: Chatbots collecting personal data raise privacy concerns, requiring robust security
measures. (Example: Data breaches exposing customer information collected by chatbots.)
 Manufacturing: Securing robot-controlled systems is crucial to prevent cyberattacks and potential
harm. (Example: Hackers gaining control of industrial robots, causing physical damage or disrupting
production.)
ETHICAL CONSIDERATIONS
 Human-agent interaction: Building trust, collaboration, and avoiding job
displacement.
 Job displacement: Automation through agents can lead to job losses in various
sectors. (Example: Self-driving cars potentially displacing truck drivers.)
 Trust and collaboration: Fostering trust between humans and agents is essential
for effective collaboration. (Example: Robots in healthcare needing to build trust
with patients and medical professionals.)

 Accountability: Establishing mechanisms to hold agents accountable for their


actions, especially in critical domains such as healthcare or finance.
DEMYSTIFYING THE BLACK BOX: EXPLAINABLE AI
FOR TRUSTWORTHY AGENTS
•Transparency and explainability are crucial for building trust in agents:
• Explainable AI (XAI) techniques: Unraveling the decision-making processes of complex agents.
• Human-in-the-loop approaches: Combining human oversight with agent capabilities.
• Collaborative development and evaluation: Engaging diverse stakeholders in the process.
• Importance of transparency: Building trust between humans and agents through clear and explainable
actions.
• Ethical considerations: Ensuring accountability and responsible development of intelligent systems.
AGENT COMMUNICATION LANGUAGES
Agent communication languages (ACLs) are used to allow
agents to communicate with each other.
ACLs typically include primitives for:
Sending messages
Receiving messages
Proposing and accepting proposals
Requesting and providing information
MULTI-AGENT SYSTEMS (MAS)
Multi-agent systems consist of multiple autonomous agents interacting with
each other to achieve individual or collective goals.
Characteristics: Decentralized control, emergent behavior, coordination
among agents.
MASs are used in a wide variety of applications, including:
 Distributed problem solving
 Cooperative problem solving
 Negotiation
 Auctions
 Swarm robotics, where multiple robots collaborate to accomplish tasks
collectively.
AGENT-BASED MODELING AND SIMULATION
Agent-based modeling and simulation (ABMS) is a technique for modeling
and simulating of individual agents and their interactions within a complex
system.
ABMS is used in a wide variety of applications, including:
 Social science
 Economics
 Biology
 Ecology
 Modeling traffic flow
 Studying the spread of diseases
 Simulating ecosystems.
AGENTS AND THE FUTURE
The future of agents promises exciting possibilities for human-machine collaboration:

Amplify human capabilities: Serving as tools, assistants, and collaborators in various tasks.
•Enhance decision-making: Providing insights, predictions, and recommendations based on vast data
analysis.
•Automate routine tasks: Freeing up human time and resources for more creative and strategic endeavors.
•Foster human-agent collaboration: Enabling humans and agents to work together seamlessly in teams.
•Promote accessibility and inclusion: Providing assistive technologies and personalized experiences for all.
•Collective intelligence: Combining human and agent strengths for complex tasks.
•Responsible co-creation: Shaping the future of agents together.
AGENTS AND THE FUTURE
Building a better future with agents requires:

•Human-centered design: Ensuring agents are developed with human needs


and values in mind.
•Ethical considerations: Addressing potential risks and ensuring responsible
development and use.
•Collaboration and education: Involving diverse stakeholders in shaping the
future of agents.
•Continuous learning and adaptation: Keeping pace with technological
advancements and societal needs.
By working together, we can harness the power of agents to create a
brighter future for all.
BEYOND BOUNDARIES: HUMANS AND
AGENTS, UNITED IN PURPOSE
The future doesn't belong solely to humans or agents; it belongs to the
powerful partnership they forge.

Imagine a world where:

 Surgeons collaborate with robotic assistants for highly precise and minimally
invasive procedures.
 Teachers personalize learning experiences with the help of AI tutors, catering to
individual student needs.
 Scientists leverage AI assistants to analyze vast datasets, accelerating research and
breakthroughs.
 Engineers co-design with AI tools, pushing the boundaries of innovation and
sustainability.
 Artists express themselves through new mediums with the aid of AI-powered creative
tools.
BEYOND BOUNDARIES: HUMANS AND AGENTS,
UNITED IN PURPOSE
This collaborative future demands:
•Mutual trust and understanding: Fostering trust in agents' capabilities while
acknowledging human expertise and oversight.
•Shared goals and values: Aligning human and agent objectives to ensure
technology serves humanity's greater good.
•Continuous learning and adaptation: Equipping both humans and agents with
the skills to thrive in a dynamic and evolving world.
Remember, the human touch remains irreplaceable. Creativity, empathy, critical
thinking, and ethical judgment are uniquely human strengths that will guide this
collaboration.
The potential is limitless. Are you ready to join the journey?
CASE STUDIES
Autonomous Vehicles

Overview of Autonomous Vehicle Technology:


 Perception: Sensors for environment sensing.
 Decision Making: Algorithms for navigation and control.
 Action: Actuators for vehicle control.
Challenges and Opportunities in Autonomous Vehicle Development.
CASE STUDIES
Smart Home Assistants

Role of Agents in Smart Home Systems:


 Voice-controlled assistants for home automation.
 Learning user preferences and adapting to individual needs.
 Interacting with other smart devices in the home ecosystem.
CASE STUDIES
Healthcare Monitoring Agents

Application of Agents in Healthcare:


 Monitoring patients' health status in real-time.
 Providing timely alerts and interventions.
 Assisting healthcare professionals in decision-making.
QUESTIONS?

Thank You

You might also like