Agent System

  • Upload
    ghazwan

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

  • 8/14/2019 Agent System

    1/65

    Artificial

    IntelligenceByNoman Hasany

    Assistant Professor

    Computer Engineering Department

    SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY, KARACHI

  • 8/14/2019 Agent System

    2/65

    Course Outline

    Theory

    AI (Intro)

    Searching

    Intelligent Agents Logic and Inference

    Knowledge-based

    Systems

    Natural LanguageProcessing

    Neural Nets

    Application

    Prolog

    Natural Language Tool

    kit (NLTK) + Python

  • 8/14/2019 Agent System

    3/65

    AI

  • 8/14/2019 Agent System

    4/65

    Heuristic

    Heuristic is a rule or piece of information thatis used to make a problem-solving method moreeffective (to achieve the goal) ormore efficient(fast and/or have less space) .

    Example: a person who is looking for a suitablegift would go to straight to the shop that heconsidered to be most likely to have a suitablegift, then to the next most likely and so on.

    Humans use such heuristics all the time tosolve all kinds of problemsComputers canalso use.

  • 8/14/2019 Agent System

    5/65

    Why study AI?

    Search engines

    Labor

    Science

    Medicine/Diagnosis

    Appliances What else?

  • 8/14/2019 Agent System

    6/65

    AI State of the art

    Deep Blue defeated the reigning world chess championGarryKasparov in 1997

    Automated Reasoning methods proved a mathematicalconjecture (Robbins conjecture) unsolved for decades

    No hands across America (driving autonomously 98% ofthe time from Pittsburgh to San Diego) Military still the strongest factor for AI research: During

    the 1991 Gulf War, US forces deployed an AI logisticsplanning and scheduling program that involved up to50,000 vehicles, cargo, and people

    NASA's on-board autonomous planning programcontrolled the scheduling of operations for a spacecraft

    Proverb solves crossword puzzles better than mosthumans

  • 8/14/2019 Agent System

    7/65

    AI State of the art

    Have the following been achieved by AI? World-class chess playing

    Playing table tennis

    Cross-country driving Solving mathematical problems

    Engage in a meaningful conversation

    Handwriting recognition Observe and understand human emotions

    Express emotions

  • 8/14/2019 Agent System

    8/65

    AI (John McCarthy)

    It is the science and engineering of

    making intelligent machines, especially

    intelligent computer programs. It is related

    to the similar task of using computers to

    understand human intelligence, but AI

    does not have to confine itself to methods

    that are biologically observable.

  • 8/14/2019 Agent System

    9/65

    AI (Marvin Minsky)

    Artificial Intelligence is the science of

    making machines do things that require

    intelligence if done by men."

  • 8/14/2019 Agent System

    10/65

    AI

    Views of AI fall into four categories: Rationally means logically

  • 8/14/2019 Agent System

    11/65

    What is AI?

    The exciting new effort tomake computers thinks machine with minds, in thefull and literal sense(Haugeland 1985)

    The art of creatingmachines that performfunctions that requireintelligence when

    performed by people(Kurzweil, 1990)

    The study of mental facultiesthrough the use ofcomputational models(Charniak et al. 1985)

    A field of study that seeks toexplain and emulateintelligent behavior in termsof computational processes

    (Schalkol, 1990)Systems that think likehumans

    Systems that thinkrationally

    Systems that act likehumans

    Systems that act rationally

    [Above are Emulation]

    (Imitate)

    [Above are Simulation]

    (Replicate)

  • 8/14/2019 Agent System

    12/65

    Acting humanly: Turing Test

    Turing (1950) "Computing machinery and

    intelligence":

    operational test for intelligent behavior: the

    Imitation Game

    components needed for passing the test:

    natural language processing, knowledge

    representation, automated reasoning,machine learning

  • 8/14/2019 Agent System

    13/65

    Acting humanly: Turing Test

  • 8/14/2019 Agent System

    14/65

    Thinking humanly: cognitive

    modeling

    not only the results, but also the reasoning steps

    made for solving a problem must be similar

    requires scientific theories of internal activities of

    the brain: introspection (the observation of thingsinternal to one's self)and psychologicalexperiments

    cognitive science: computer models from AI andexperimental techniques from psychology

    -theories of the workings of the human mind

  • 8/14/2019 Agent System

    15/65

    Thinking rationally:

    "laws of thought"

    Aristotle: what are correct arguments/thoughtprocesses? syllogisms: patterns for argument structures that always

    yielded correct conclusions when given correct premises

    several Greek schools developed various forms oflogic: notation and rules of derivation for thoughts;

    direct line through mathematics and philosophy tomodern AI

    problems: 1.difficulties in translating everyday knowledge into a

    logical formalism (the presence of uncertainty)

    2.scalability (degree/range) of logic-based reasoning

    systems

  • 8/14/2019 Agent System

    16/65

    Acting rationally: rational agent

    Rational behavior: doing the right thing

    The right thing: that which is expected to maximize goalachievement, given the available information

    doesn't necessarily involve thinking

    but thinking should be in the service of rationalaction (thought is involve in design phase)

    more amenable to scientific development than human-like behavior or thought approaches

  • 8/14/2019 Agent System

    17/65

    Rational agents

    An agent is an entity that perceives and acts Abstractly, an agent is a function from percept

    histories to actions:

    For any given class of environments and tasks,we seek the agent (or class of agents) with thebest performance

    Caveat (limitation): computational limitationsmake perfect rationality unachievable design best program for given machine resources

  • 8/14/2019 Agent System

    18/65

    Intelligence

    Intelligence is the computational part ofthe ability to achieve goals in the world.

    Varying kinds and degrees of intelligence

    occur in people, many animals and somemachines.

    Ultimate intelligence is the spiritual part of

    the ability to achieve goals in this worldand for the world hereafter. (rabbana atinafidduniya hasana wafil akhirate hasana)

  • 8/14/2019 Agent System

    19/65

    Types of AI (MSN Encarta) Symbolic AI: Symbolic AI is based in logic. It uses sequences of

    rules to tell the computer what to do next. Expert systems consistof many so-called IF-THEN rules: IF this is the case, THEN do that.Since both sides of the rule can be defined in complex ways, rule-based programs can be very powerful.

    Connectionist AI: Connectionism is inspired by the brain. It is

    closely related to computational neuroscience, which modelsactual brain cells and neural circuits. Connectionist AI usesartificial neural networks made of many units working in parallel.Each unit is connected to its neighbors by links that can raise orlower the likelihood that the neighbor unit will fire (excitatory andinhibitory connections respectively). Neural networks that are able

    to learn do so by changing the strengths of these links, dependingon past experience. These simple units are much less complexthan real neurons. Each can do only one thing: for instance, reporta tiny vertical line at a particular place in an image. What matters isnot what any individual unit is doing, but the overall activity-patternof the whole network.

  • 8/14/2019 Agent System

    20/65

    Types of AI (MSN Encarta)

    Evolutionary AI: Evolutionary AI draws onbiology. Its programs make random changes intheir own rules, and select the best daughterprograms to breed the next generation. This

    method develops problem-solving programs,and can evolve the brains and eyes of robots.It is often used in modeling artificial life (A-Life).A-Life studies self-organization: how order arisesfrom something that is ordered to a lesser

    degree. Biological examples include theflocking patterns of birds and the developmentof embryos.

  • 8/14/2019 Agent System

    21/65

    Branches of AI (John McCarthy)

    Logical AI: What a program knows about the world ingeneral the facts of the specific situation in which it mustact, and its goals are all represented by sentences ofsome mathematical logical language. The program

    decides what to do by inferring that certain actions areappropriate for achieving its goals.

    Search: AI programs often examine large numbers ofpossibilities, e.g. moves in a chess game or inferencesby a theorem proving program. Discoveries are

    continually made about how to do this more efficiently invarious domains.

  • 8/14/2019 Agent System

    22/65

    Branches of AI (John McCarthy)

    Pattern recognition: When a program

    makes observations of some kind, it is

    often programmed to compare what it

    sees with a pattern. For example, a visionprogram may try to match a pattern of

    eyes and a nose in a scene in order to find

    a face, for finding word sense, tag sensein a natural language text, for playing next

    move in a chess game

  • 8/14/2019 Agent System

    23/65

    Representation: Facts about the world have to berepresented in some way. Usually languages ofmathematical logic are used.

    Inference: From some facts, others can be inferred.Mathematical logical deduction is adequate for some

    purposes Common sense knowledge and reasoning: This is thearea in which AI is farthest from human-level, in spite of thefact that it has been an active research area since the1950s. While there has been considerable progress, e.g. in

    developing systems of non-monotonic reasoning andtheories of action, yet more new ideas are needed. The Cycsystem contains a large but spotty collection of commonsense facts.

    Branches of AI (John McCarthy)

  • 8/14/2019 Agent System

    24/65

    Learning from experience: The approaches to AIbased on connectionism and neural nets specialize inthat. There is also learning of laws expressed in logic.Programs can only learn what facts or behaviors theirformalisms can represent, and unfortunately learning

    systems are almost all based on very limited abilities torepresent information.

    Planning: Planning programs start with general factsabout the world, facts about the particular situation and astatement of a goal. From these, they generate a

    strategy for achieving the goal. In the most commoncases, the strategy is just a sequence of actions. Epistemology: This is a study of the kinds of knowledge

    that are required for solving problems in the world.

    Branches of AI (John McCarthy)

  • 8/14/2019 Agent System

    25/65

    Ontology: Ontology is the study of the kinds of things thatexist. In AI, the programs and sentences deal with variouskinds of objects, and we study what these kinds are andwhat their basic properties are. Emphasis on ontologybegins in the 1990s.

    Heuristics: A heuristic is a way of trying to discoversomething or an idea embedded in a program. Heuristicfunctions are used in some approaches to search tomeasure how far a node in a search tree seems to be froma goal. Heuristic predicates that compare two nodes in asearch tree to see if one is better than the other, i.e.constitutes an advance toward the goal,

    Genetic programming: Genetic programming is atechnique for getting programs to solve a task by mating(friendly) random Lisp programs and selecting fittest inmillions of generations.

    Branches of AI (John McCarthy)

  • 8/14/2019 Agent System

    26/65

    Foundations of AI

    Philosophy

    Mathematics

    Economics

    Neuroscience

    Psychology

    Computer engineering

    Control theory

    Linguistics

  • 8/14/2019 Agent System

    27/65

    Engineering Intelligent Entities

    The science of understanding intelligent

    entities by developing theories that attempt to

    explain and predict the nature of such entities.

    The engineering of intelligent entities.

  • 8/14/2019 Agent System

    28/65

    Engineering Intelligent Entities

    The engineering of such intelligent entities means thatwe want to build machines to perform tasks for us.

    However, these machines must act in an intelligent way.

    Intelligence can be considered to be manifest in anumber of different but interconnected forms ofbehaviour, such as: reasoning about beliefs,

    reasoning about actions, the ability to communicate, the ability to learn, both from mistakes and also through gaining

    new knowledge, social awareness.

  • 8/14/2019 Agent System

    29/65

    Agents

    The key notion here is that we want to equip such intelligentsystems, known as agents, with the ability to think and actautonomously.

    There is actually no universal agreed upon definition of an agent buta popular definition has been given by Wooldridge and Jennings(1995)

    An agentis a computer system that is situatedin someenvironment, and that is capable ofautonomous actionin this environment in order to meet its designobjectives.

    In addition to this, a collection of such agents situated together in anenvironment and capable of interacting in with one another is knownas a multi-agent system.

  • 8/14/2019 Agent System

    30/65

    What is an (Intelligent) Agent?

    An over-used, over-loaded, and

    misused term.

    Anything that can be viewedas

    perceiving its environment through

    sensors and acting upon thatenvironment through its effectors to

    maximize progress towards its goals.

  • 8/14/2019 Agent System

    31/65

    What is an (Intelligent) Agent?

    PAGE (Percepts, Actions, Goals,Environment)

    Task-specific & specialized: well-defined

    goals and environment The notion of an agent is meant to be a

    tool for analyzing systems,

    It is not a different hardware or newprogramming languages

  • 8/14/2019 Agent System

    32/65

    Example: Human mind as network of thousands or millionsof agents working in parallel. To produce real artificial

    intelligence, this school holds, we should build computer

    systems that also contain many agents and systems for

    arbitrating among the agents' competing results.

    Distributed decision-making

    and control

    Challenges:

    Action selection: What next action

    to choose

    Conflict resolution

    Intelligent Agents and Artificial

    Intelligence

    sen

    sors

    effectors

    Agency

  • 8/14/2019 Agent System

    33/65

    AgentsHuman agent: eyes, ears, and other organs for

    sensors;

    hands, legs, mouth, and other body parts foractuators

    Robotic agent: cameras and infrared range

    finders for sensors;

    various motors for actuators

  • 8/14/2019 Agent System

    34/65

    Intelligent Agents

    In order for these entities to be deemed as intelligent, there are anumber of capabilities that we would expect such agents topossess, again taken from a list defined by Wooldridge andJennings (1995)

    Reactivity: Intelligent agents are able to perceive their environment,and respond in a timely fashion to changes that occur in it in orderto satisfy their design objectives.

    Proactiveness: Intelligent agents are able to exhibit goal-directedbehaviour by taking the initiative in order to satisfy their designobjectives.

    Social ability: Intelligent agents are capable of interacting with otheragents (and possibly humans) in order to satisfy their designobjectives.

  • 8/14/2019 Agent System

    35/65

    Intelligent Agents

    Environment

    Sensor inputAction output

  • 8/14/2019 Agent System

    36/65

    A Windshield Wiper Agent

    How do we design a agent that can wipe the windshields

    when needed?

    Goals? Percepts?

    Sensors?

    Effectors?

    Actions?

    Environment?

  • 8/14/2019 Agent System

    37/65

    A Windshield Wiper Agent

    Goals: Keep windshields clean &maintain visibility

    Percepts: Raining, Dirty

    Sensors: Camera (moist sensor)

    Effectors: Wipers (left, right, back)

    Actions: Off, Slow, Medium, Fast

    Environment: Inner city, freeways,

    highways, weather

  • 8/14/2019 Agent System

    38/65

    Interacting Agents

    Collision Avoidance Agent (CAA)

    Goals: Avoid running into obstacles

    Percepts ? Sensors?

    Effectors ?

    Actions ? Environment: Freeway

  • 8/14/2019 Agent System

    39/65

    Interacting Agents

    Lane Keeping Agent (LKA)

    Goals: Stay in current lane

    Percepts ? Sensors?

    Effectors ?

    Actions ? Environment: Freeway

  • 8/14/2019 Agent System

    40/65

    Interacting Agents

    Collision Avoidance Agent (CAA)

    Goals: Avoid running into obstacles

    Percepts: Obstacle distance, velocity, trajectory

    (route) Sensors: Vision, proximity (closeness)sensing

    Effectors: Steering Wheel, Accelerator,

    Brakes, Horn, Headlights Actions: Steer, speed up, brake, blow horn,

    signal (headlights)

    Environment: Freeway

  • 8/14/2019 Agent System

    41/65

    Interacting Agents

    Lane Keeping Agent (LKA)

    Goals: Stay in current lane

    Percepts: Lane center, laneboundaries

    Sensors: Vision

    Effectors: Steering Wheel,

    Accelerator, Brakes Actions: Steer, speed up, brake

    Environment: Freeway

  • 8/14/2019 Agent System

    42/65

    Structure of Intelligent Agents

    Agent = architecture + program

    Agent program: the implementation off: P* A, theagents perception-action mapping

    function Skeleton-Agent(Percept) returnsAction

    memory UpdateMemory(memory, Percept)

    Action ChooseBestAction(memory)

    memory UpdateMemory(memory, Action)

    returnAction

    Architecture: a device that can execute the agent

    program (e.g., general-purpose computer, specialized

    device, beobot, etc.)

  • 8/14/2019 Agent System

    43/65

    Beobot

    What is a Beobot?

    It is an autonomous robot that uses off-the-

    shelf PC hardware and software to perform its

    computation

    It is designed to run in actual outdoor

    unconstrainedenvironments, which is a

    far cry from the insulated test labs thatrobots are mainly tested in.

    U i l k t bl t d

  • 8/14/2019 Agent System

    44/65

    Using a look-up-table to encode

    f: P* A Example: Collision Avoidance

    Sensors: 3 proximity sensors

    Effectors:Steering Wheel, Brakes

    How to generate?

    How large?

    How to select action?

    agent

    obstacle

    sensors

    U i l k t bl t d

  • 8/14/2019 Agent System

    45/65

    Using a look-up-table to encode

    f: P* A

    Example: Collision Avoidance

    Sensors: 3 proximity sensors

    Effectors:Steering Wheel, Brakes

    How to generate: for each p Pl Pm Prgenerate an appropriate action, a S B

    How large: size of table = #possible percepts times # possibleactions = |Pl | |Pm| |Pr| |S| |B|

    E.g., P = {close, medium, far}3

    A = {left, straight, right} {on, off}then size of table = 27*3*2 = 162

    How to select action? Search.

    agent

    obstaclesensors

  • 8/14/2019 Agent System

    46/65

    Information agents Manage the explosive growth of information.

    Manipulate or collate information from many distributed sources. Information agents can be mobile or static.

    Examples:

    BargainFindercomparison shops among Internet stores for CDs

    FIDO the Shopping Doggie (out of service)

    Internet Softbot infers which internet facilities (finger, ftp, gopher)

    to use and when from high-level search requests.

    Challenge: ontologies for annotating Web pages (eg, SHOE).

    http://www.bargainvillage.com/bargainFinder/software.htmhttp://www.shopfido.com/http://www.cs.washington.edu/research/projects/softbots/www/internet-softbot.htmlhttp://www.cs.washington.edu/research/projects/softbots/www/internet-softbot.htmlhttp://www.shopfido.com/http://www.bargainvillage.com/bargainFinder/software.htm
  • 8/14/2019 Agent System

    47/65

    Intelligent Agents

    Agents observe the environment in which they aresituated and perform actions based on their knowledgeof their environment.

    However, observing an environment is no easy task for anumber of reasons: the agent needs be equipped with some suitable representation

    of the environment which it inhabits the agent needs to be able to reason about the state of the

    environment

    the agent needs to be able to update its beliefs when theenvironment changes the agent needs to know how its action will affect the

    environment it inhabits.

  • 8/14/2019 Agent System

    48/65

    Environments Russell and Norvig (1995) have given a

    classification of the different types of environmentthat an agent can inhabit:

    Accessible vs inaccessible

    Deterministic vs non-deterministic Episodic vs non-episodic Static vs dynamic Discrete vs continuous

    We will look at a brief description of each

  • 8/14/2019 Agent System

    49/65

    Accessible vs. Inaccessible

    An accessible environment is one in which theagent can obtain complete, accurate, up-to-dateinformation about the environments state.

    Most moderately complex environments(including, for example, the everyday physicalworld and the Internet) are inaccessible.

    The more accessible an environment is, thesimpler it is to build agents to operate in it.

    D t i i ti N

  • 8/14/2019 Agent System

    50/65

    Deterministic vs. Non-

    Deterministic

    Output problem A deterministic environment is one in which any

    action has a single guaranteed effect there isno uncertainty about the state that will result

    from performing an action.

    The physical world can to all intents andpurposes be regarded as non-deterministic.

    Non-deterministic environments present greaterproblems for the agent designer.

  • 8/14/2019 Agent System

    51/65

    Episodic vs. Non-Episodic

    Input Problem In an episodic environment, the performance of an agent is

    dependent on a number of discrete episodes, with no link betweenthe performance of an agent in different scenarios.

    Episodic environments are simpler from the agent developersperspective because the agent can decide what action to performbased only on the current episode it need not reason about theinteractions between this and future episodes.

    An example of an episodic environment is a mail sorting system.

  • 8/14/2019 Agent System

    52/65

    Static vs. Dynamic

    A static environment is one that can be assumedto remain unchanged except by the performanceof actions by the agent.

    A dynamic environment is one that has otherprocesses operating on it, and which hencechanges in ways beyond the agents control.

    The physical world is a highly dynamicenvironment.

  • 8/14/2019 Agent System

    53/65

    Discrete vs. Continuous

    An environment is discrete if there are a fixed,finite number of actions and percepts in it.

    A chess game is an example of a discreteenvironment, and taxi driving is an example of acontinuous one.

    This is not really an intrinsic property of theenvironment, but more a property of how wechoose to model the environment. So, you canthink of your perceptions of the world or youractions as being discrete or continuous.

  • 8/14/2019 Agent System

    54/65

    Environments

    So, the type of environment that an agentinhabits effects its design and behaviour.

    In order for an agent to think rationally itneeds to be aware of the environment itinhabits, which requires knowledge

    representation, and it needs to be able toreason about this knowledge in order toact rationally and fulfil its tasks.

  • 8/14/2019 Agent System

    55/65

    Multi-Agent Systems

    However, the situation becomes even more complicatedwhen there are other such agents operating within thesame environment.

    Now, the agent must be able to not only reason about itsown beliefs but also about the beliefs of other agents

    and

    it also needs to reason about the way the environmentcan be changed by these other agents.

    All this requires rational reasoning.

  • 8/14/2019 Agent System

    56/65

    Reasoning about Beliefs

    In order to represent agents environments in a mannerthat they can understand we use logic.

    We encode information about the environment in the

    form of logic and this information forms the agentsknowledge base and thus its beliefs about the world.

    In order to enable an agent to reason with thisknowledge, the agent needs to have a set of rules thattell it how this environment can change.

  • 8/14/2019 Agent System

    57/65

    Reasoning about Action

    The agents knowledge about the environment shouldalso tell it how the environment will change when itperforms actions.

    So the ability to act rationally is intrinsically (built-in)linked with the ability to think rationally.

    The agent will have specific goals that it is trying toachieve and these goals are represented as particularstates of the environment.

    In order to act rationally the agent must choose an actionto execute that will achieve this particular goal.

  • 8/14/2019 Agent System

    58/65

    DomainApplications

    Agents spheres of knowledge will differ

    depending upon the particular domain

    they are constructed for use in.

    For example

  • 8/14/2019 Agent System

    59/65

    Example Domains

    The following domains are examples of

    where agent technology is being

    deployed:

    The internet: e.g. softbots (software robots)

    which visit websites and gather information

    from them. e.g. for comparison shopping, or for harvesting

    information.

  • 8/14/2019 Agent System

    60/65

    Example Domains

    Medicine: multi-agent systems can be used

    for simulation, decision making,

    communication and risk assessment

    purposes one such group working on the application of multi-agent systems to medicine is the Advanced

    Computation Lab at Cancer Research UK

  • 8/14/2019 Agent System

    61/65

    Example Domains

    Air traffic control: agents are deployed insystems to assist in the control of air trafficand the provision of information. example: the OASIS system tested at Sydney

    airport.

    Spacecraft: agents are currently being testedfor use in spacecraft computers e.g. for autonomous navigation and detection of

    errors/malfunctions.

    e.g. NASAs Deep Space 1 mission.

  • 8/14/2019 Agent System

    62/65

    Example Domains

    Telecommunications systems: e.g. for managing

    dynamic information concerning the routing of

    network traffic.

    Law: to support decision making and information

    management involved in legal reasoning.

    These are just a few domains that are currently

    making use of agent technology and KR&R methods.

    There are many more application domains.

  • 8/14/2019 Agent System

    63/65

    Agents and KR&R

    All the previous application domains for agent systemseach have their own aims with respect to the problemsthat they address.

    So, the knowledge and reasoning embodied will differdepending upon the domain.

    But, what is common to all the application areas thatmake use of AI and agent technology is that they needsystems that possess the relevant knowledge of thedomain and environment and they also need to be ableto reason effectively with this information in order to fulfiltheir specific tasks.

  • 8/14/2019 Agent System

    64/65

    Agents and KR&R

    Expressive logics, such as modal and descriptionlogics, are being used as an efficient and effectiveway of dealing with KR&R (Knowledgerepresentation and reasoning) in intelligentsystems, as we will come to see during the course.

    Further detailed information about agent technologyand applications can be found in:

    M. J. WooldridgeAn Introduction to Multi-Agent Systems

    John Wiley and Sons Publishers

  • 8/14/2019 Agent System

    65/65

    Summary

    Overview of:

    AI

    Intelligent agents

    Environments

    Reasoning about beliefs and actions

    Domain applications