1 / 37

Princess Nora University Artificial Intelligence

Princess Nora University Artificial Intelligence. CS 461 Level 8. Chapter 2: Intelligent Agents . Out Line : Agents and environments Rationality PEAS Environment types Agent typ es. Agent (1).

sanne
Télécharger la présentation

Princess Nora University Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Princess Nora UniversityArtificial Intelligence CS 461 Level 8

  2. Chapter 2: Intelligent Agents Out Line : • Agents and environments • Rationality • PEAS • Environment types • Agent types

  3. Agent (1) • An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators or effectors. • Human agent: eyes, ears, and other organs for sensors; hands, • legs, mouth, and other body parts for actuators • Robotic agent: cameras and infrared range finders for sensors; • various motors for actuators

  4. Agents and environments • The agent function maps percept sequence to actions : [ f: P *  A] • The agent function will internally be represented by the agent program. • The agent program runs on the physical architecture to produce f

  5. The vacuum-cleaner world (1) • Environment: square A and B • Percepts: [location and content] e.g. [A, Dirty] • Actions: left, right, suck, and no-op • Agent’s function  look-up table

  6. The vacuum-cleaner world (2)

  7. The vacuum-cleaner world (3) 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

  8. Rational Agents • A rational agent is one that does the right thing. • The right action is the one that will cause the agent to be most successful. • how and when to evaluate the agent's success. • 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.

  9. The concept of rationality • A rational agent is one that does the right thing. • Every entry in the table is filled out correctly. • What is the right thing? • Approximation: the most successful agent. • Measure of success? • Performance measure should be objective • E.g. the amount of dirt cleaned within a certain time. • E.g. how clean the floor is. • Performance measure according to what is wanted in the environment instead of how the agents should behave.

  10. Rationality • What is rational at a given time depends on four things: 1. The performance measure that defines the criterion of success. 2. The agent’s prior knowledge of the environment 3. The actions that the agent can perform 4. The agent’s percept sequence to date • Def: A rational agent chooses whichever action maximizes the expected value of the performance measure given the percept sequence to date and prior environment knowledge.

  11. Rationality • The proposed definition requires: • Information gathering/exploration • To maximize future rewards • Learn from percepts • Extending prior knowledge • Agent autonomy An agent is autonomous if its behavior is determined by its own experience (with ability to learn and adapt)

  12. Environments • To design a rational agent we must specify its task environment. • PEAS description of the environment: • Performance • Environment • Actuators • Sensors

  13. PEAS • Agent :Medical diagnosis system • Performance measure: Healthy patient, minimize costs, lawsuits • Environment:Patient, hospital, staff • Actuators:Screen display (questions, tests, diagnoses, treatments, referrals) • Sensors: Keyboard (entry of symptoms, findings, patient's answers)

  14. PEAS • E.g. Fully automated taxi: • PEAS description of the environment: • Performance • Safety, destination, profits, legality, comfort • Environment • Streets/freeways, other traffic, pedestrians, weather,, … • Actuators • Steering, accelerating, brake, horn, speaker/display,… • Sensors • Video, sonar, speedometer, engine sensors, keyboard, GPS, …

  15. Environment types • Fully observable vs. partially observable • Deterministic vs. stochastic • Episodic vs. sequential • Static vs. dynamic • Discrete vs. continuous • Single agent vs. multi agent

  16. Fully observable vs. partially observable: • An environment is fully observable if an agent's sensors give it access to the complete state of the environment at each point in time. • 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 • Examples: vacuum cleaner with local dirt sensor.

  17. Deterministic vs. stochastic: • The environment is deterministic if the next state of the environment is completely determined by the current state and the action executed by the agent. • In principle, an agent need not worry about uncertainty in a fully observable, deterministic environment • If the environment is partially observable then it could appear to be stochastic • Examples: Vacuum world is deterministic while taxi driver is not • If the environment is deterministic except for the actions of other agents, then the environment is strategic

  18. Episodic vs. sequential: • In episodic environments, the agent's experience is divided into atomic "episodes" (each episode consists of the agent perceiving and then performing a single action), and the choice of action in each episode depends only on the episode itself. • Examples: classification tasks • In sequential environments, the current decision could affect all future decisions Examples: chess and taxi driver

  19. Static vs. dynamic: The environment is unchanged while an agent is deliberating. • Static environments are easy to deal with because the agent need not keep looking at the world while it is deciding on the action or need it worry about the passage of time • Dynamic environments continuously ask the agent what it wants to do • The environment is semi-dynamic if the environment itself does not change with the passage of time but the agent's performance score does • Examples: taxi driving is dynamic, chess when played with a clock is semi-dynamic, crossword puzzles are static

  20. Discrete vs. continuous: • A limited number of distinct, clearly defined states, percepts and • actions. • Examples: Chess has finite number of discrete states, and has • discrete set of percepts and actions. Taxi driving has continuous states, and actions

  21. Single agent vs. multiagent: • An agent operating by itself in an environment is single agent • Examples: Crossword is a single agent while chess is two-agents • Question: Does an agent A have to treat an object B as an agent or can it be treated as a stochastically behaving object • Whether B's behaviour is best described by as maximizing a performance measure whose value depends on agent's A behaviour • Examples: chess is a competitive multiagent environment while taxi driving is a partially cooperative multiagent environment

  22. Environment types • The simplest environment is • Fully observable, deterministic, episodic, static, discrete and single-agent. • Most real situations are: • Partially observable, stochastic, sequential, dynamic, continuous and multi-agent.

  23. Agent types • How does the inside of the agent work? • Agent = architecture + program • All agents have the same skeleton: • Input = current percepts • Output = action • Program= manipulates input to produce output • Note difference with agent function.

  24. Agent functions and programs • Agent program: – Takes the current percept as input from the sensors – Return an action to the actuators – While agent function takes the whole percept history, agent program takes just the current percept as input which the only available input from the environment – The agent need to remember the whole percept sequence, if it needs it.

  25. Table-lookup agent A trivial agent program: keeps track of the percept sequence and then uses it to index into a table of actions to decide what to do • The designers must construct the table that contains the appropriate action for every possible percept sequence function TABLE-DRIVEN-AGENT(percept) returns an action Static : percepts, a sequence, initially empty table, a table of actions, indexed by percept sequences, initially fully specified append percept to the end of percepts action <--LOOKUP(percepts, table) return action

  26. Table-lookup agent Drawbacks: – Huge table (P^T , P: set of possible percepts, T: lifetime) •Space to store the table •Take a long time to build the table •No autonomy •Need a long time to learn the table entries

  27. Agent types • Rather than a table how we can produce rational behavior from a small amount of code Four basic types in order of increasing generality: – Simple reflex agents – Model-based reflex agents – Goal-based agents – Utility-based agents

  28. 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(next page). • Implemented through condition-action rules • If dirty then suck

  29. The vacuum-cleaner world • function REFLEX-VACUUM-AGENT ([location, status]) • if status == Dirty then return Suck • else if location == A then return Right • else if location == B then return Left • return an action entries

  30. Agent types : Simple reflex function SIMPLE-REFLEX-AGENT(percept) returns an action static: rules, a set of condition-action rules state INTERPRET-INPUT(percept) rule RULE-MATCH(state, rule) action RULE-ACTION[rule] return action Will only work if the environment is fully observable otherwise infinite loops may occur.

  31. Agent types: Reflex and state • To tackle partially observable environments. • Maintain internal state • Over time update state using world knowledge • How does the world change. • How do actions affect world.  Model of World

  32. Agent types: Reflex and state function REFLEX-AGENT-WITH-STATE(percept) returns an action static: rules, a set of condition-action rules state, a description of the current world state action, the most recent action. state UPDATE-STATE(state, action, percept) rule RULE-MATCH(state, rule) action RULE-ACTION[rule] return action

  33. Agent types: Goal-based • The agent needs a goal to know which situations are desirable. • Things become difficult 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 • Is more flexible since knowledge is represented explicitly and can be manipulated.

  34. 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 • Select appropriately between several goals based on likelihood of success.

  35. Agent types: Learning • All previous agent-programs describe methods for selecting actions. • Yet it does not explain the origin of these programs. • Learning mechanisms can be used to perform this task. • Teach them instead of instructing them. • Advantage is the robustness of the program toward initially unknown environments.

  36. Agent types: Learning • Learning element: introduce improvements in performance element. • Critic provides feedback on agents performance based on fixed performance standard. • Performance element: selecting actions based on percepts. • Corresponds to the previous agent programs • Problem generator: suggests actions that will lead to new and informative experiences. Exploration vs. exploitation

  37. Main ref • http://stpk.cs.rtu.lv/sites/all/files/stpk/materiali/MI/Artificial%20Intelligence%20A%20Modern%20Approach.pdf

More Related