Lecture 03 - Problem Solving Agents
Lecture 03 - Problem Solving Agents
ARTIFICIAL INTELLIGENCE
Mahesh Madhushan
B.Sc. in ICT (RUSL), B.Eng. (Hons) in Software Engineering (UK), M.Sc. in IT (UOP)
RECOMMENDED REFERENCE
⚫ 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
A general rule:
⚫ Design performance measures according to
⚫ What one actually wants in the environment
⚫ Rather than how one thinks the agent should behave
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
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
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
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:
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.)
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:
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
Thank You