What is an Agent? Wide range of behavior and functionality in - - PowerPoint PPT Presentation

what is an agent
SMART_READER_LITE
LIVE PREVIEW

What is an Agent? Wide range of behavior and functionality in - - PowerPoint PPT Presentation

Agents What is an Agent? Wide range of behavior and functionality in computing Active computational entity With a persistent identity Able to carry out a long-lived conversation Perceives, reasons about, and initiates activities in


slide-1
SLIDE 1

Agents

What is an Agent?

Wide range of behavior and functionality in computing

◮ Active computational entity

◮ With a persistent identity ◮ Able to carry out a long-lived conversation

◮ Perceives, reasons about, and initiates activities in its environment

◮ Deals with services

◮ Communicates (with other agents)

◮ Loosely coupled

◮ Adaptive

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 113

slide-2
SLIDE 2

Agents

Agents and Multiagent Systems for Services

Business partners are supported by agents

◮ Unlike objects, agents

◮ Are proactive and autonomous ◮ Support loose coupling

◮ In addition, agents may

◮ Cooperate or compete ◮ Model users, themselves, and others ◮ Dynamically use and reconcile ontologies Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 114

slide-3
SLIDE 3

Agents

Modeling Agents: Artificial Intelligence

Emphasize mental concepts

◮ Beliefs: agent’s representation of the world ◮ Knowledge: (usually) true beliefs ◮ Desires: preferred states of the world ◮ Goals: consistent desires ◮ Intentions: goals adopted for action

◮ Resources allocated ◮ Sometimes incorporate persistence Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 115

slide-4
SLIDE 4

Agents

Modeling Agents: Multiagent Systems

Emphasize interaction and autonomy and, hence, communication)

◮ Social: about collections of agents ◮ Organizational: about teams and groups ◮ Legal: about contracts and compliance ◮ Ethical: about right and wrong actions

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 116

slide-5
SLIDE 5

Agents

Mapping Service-Oriented Computing to Agents

Agents capture the constraints of an open system

◮ Autonomy ⇒ ability to enter into and enact contracts

◮ Counterbalanced by establishing compliance ◮ How can we check or enforce compliance?

◮ Heterogeneity ⇒ ontologies ◮ Loose coupling ⇒ communication ◮ Trustworthiness ⇒ contracts, ethics, learning, incentives ◮ Dynamism ⇒ combination of the above

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 117

slide-6
SLIDE 6

Agents

Two Main Ways to Apply Agents

Agent-Oriented Software Engineering (AOSE)

◮ As modeling constructs

◮ Standing in for stakeholders ◮ To help in capturing their requirements as goals

◮ As runtime constructs, each

◮ Representing a stakeholder ◮ Acting on its behalf, reflecting its autonomous decision making to

  • thers

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 118

slide-7
SLIDE 7

Agents

Economic Rationality

◮ Three elements: an agent’s

◮ Performance measure, e.g., expected utility ◮ Prior knowledge and perceptions ◮ Available actions

◮ Ideally, for each possible percept sequence, a rational agent

◮ Acts to maximize its expected utility ◮ On the basis of its knowledge and evidence from the percept sequence Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 119

slide-8
SLIDE 8

Agents

Logic-Based Agents

Logical reasoning being a form of rationality

◮ An agent is a knowledge-based system

◮ Represents a symbolic model of the world ◮ Declarative, hence, inspectable ◮ Reasons symbolically via logical deduction

◮ Challenges:

◮ Representing information symbolically ◮ Easier in information environments than in general ◮ Maintaining an adequate model of the world Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 120

slide-9
SLIDE 9

Agents

Cognitive Architecture for an Agent

◮ Sensors and effectors map to services

Communication infrastructure is messaging middleware

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 121

slide-10
SLIDE 10

Agents

Exercise

Create an instance of the preceding diagram where the two agents are Amazon and a manufacturer

◮ When is it beneficial to employ agents in this setting? ◮ What is an illustration of loose coupling in this setting?

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 122

slide-11
SLIDE 11

Agents

A Reactive Agent

The Sense-Decide-Act Loop

Environment e ; RuleSet r ; w h i l e ( t r u e ) { s t a t e = senseEnvironment ( e ) ; a = chooseAction ( state , r ) ; e . applyAction ( a ) ; }

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 123

slide-12
SLIDE 12

Agents

Generic BDI (Belief-Desire-Intention) Architecture

Addresses how beliefs, desires and intentions are represented, updated, acted upon Also variant with just beliefs and goals

Agent : : run () { P e r c e p t i o n p ; p . run () ; // s t a r t p e r c e p t i o n i n

  • wn

thread w h i l e ( t r u e ) { i n t e n t i o n = getBestPlan () ; i f ( i n t e n t i o n . execute ( ) ) // i f achieved d e s i r e s . remove ( i n t e n t i o n ) ; } P e r c e p t i o n : : run () { w h i l e ( t r u e ) { a . b e l i e f s . incorporateNewObservations ( g e t I n p u t (w) ) ; i f ( ! a . c u r r e n t P l a n I s A p p l i c a b l e ( ) ) a . stopCurrentPlan ( ) ; s l e e p ( someShortTime ) ; } ◮ Richer than sense-decide-act: decisions directly affect future decisions

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 124

slide-13
SLIDE 13

Agents

Representing Services for Planning

IOPE (sometimes IOPR)

◮ Inputs: information the service requires ◮ Outputs: information the service produces ◮ Preconditions: constraints on the input ◮ Effects: effects on the environment ◮ Results (variant of effects): properties of the output

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 125

slide-14
SLIDE 14

Agents

Composition as Planning

◮ Represent initial and goal states ◮ Represent each service as an action

◮ Based on its IOPE specification

◮ A composed service: a plan that invokes constituent services

◮ Inputs: outputs of previous services ◮ Preconditions: true in initial state or made true by effects (results) of

previous services

◮ Effects not undone by subsequent services yield the goal state Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 126

slide-15
SLIDE 15

Agents

Rules: Logical Representations

Marry declarative representation with computing

◮ Modular: easy to read and maintain ◮ Inspectable: easy to understand ◮ Executable: no further translation needed ◮ Expressive: (commonly) Turing complete

◮ Capture knowledge that would otherwise not be captured declaratively ◮ Compare with relational calculus (classical SQL) or description logics

(OWL)

◮ Declarative, although imperfectly so

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 127

slide-16
SLIDE 16

Agents

Kinds of Rules

◮ ECA (Event-Condition-Action) or Reaction

  • n

event i f c o n d i t i o n then perform a c t i o n ◮ Derivation rules: special case of above, e.g., integrity constraints: d e r i v e f a l s e i f e r r o r ◮ Inference rules i f antecedent then consequent

◮ Support multiple computational strategies ◮ Forward chaining; backward chaining Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 128

slide-17
SLIDE 17

Agents

Applying ECA Rules

◮ Capture protocols, policies, and heuristics as ECA rules

◮ Examples?

◮ Combine with inference rules (to check if a condition holds) ◮ Modeling challenge

◮ What is an event? ◮ How to capture composite events by pushing event detection to lower

layers

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 129

slide-18
SLIDE 18

Agents

Example: ECA Rule

IF r e q u e s t (? x ?y ? z ) // event AND l i k e (? x ?y ) // c o n d i t i o n THEN do ( f u l f i l l (? x ? z ) ) // a c t i o n ◮ Watch out for relevant events ◮ If one occurs, check condition ◮ If condition holds, perform action

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 130

slide-19
SLIDE 19

Agents

Example: Inference Rule

◮ Typical syntax indicating forward chaining IF parent (? x ?y ) AND parent (? y ? z ) // Antecedent THEN grandparent (? x ? z ) // Consequent ◮ Typical syntax indicating backward chaining INFER grandparent (? x ? z ) // Consequent FROM parent (? x ?y ) // Antecedent AND parent (? y ? z )

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 131

slide-20
SLIDE 20

Agents

Example: Communication

Combining backward chaining and ECA

IF incoming−message (? x ?y ? z ) AND p o l i c y (? x ?y ?w) AND p o l i c y (? x ? z ?v ) THEN send message (? x ?v ?w) AND a s s e r t i n t e r n a l −f a c t (? x ?v ?w) ◮ The policy stands for any internal decision making, usually defined as INFER p o l i c y (? x ?y ?w) FROM . . .

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 132

slide-21
SLIDE 21

Agents

Exercise: Communication

State the customer’s rules to capture how it might interact with a merchant in a purchase protocol

◮ RFQ: request for quotes ◮ (Price) quote ◮ Accept or Reject ◮ Goods ◮ Payment ◮ Receipt

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 133

slide-22
SLIDE 22

Agents

Applying Inference Rules

◮ Capture general requirements ◮ Elaboration tolerance requires defeasibility

◮ Conclusions are not firm in the face of new information ◮ Formulate general rules ◮ Override rules to specialize them as needed

◮ Leads to logical nonmonotonicity

◮ Easy enough operationally but difficult to characterize mathematically ◮ Details get into logic programming with negation Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 134

slide-23
SLIDE 23

Agents

Negation and Nonmonotonicity

◮ Strong negation, indicating falsity (i.e., nontruth)

◮ Traditional, two-valued logic ◮ Law of the excluded middle

◮ Weak negation, indicating absence of knowledge or absence of proof

(depending upon the setting)

◮ Goes beyond traditional, two-valued logic ◮ A proposition and its strong negation may both be unknown

◮ Nonmonotonicity

◮ Conclusions are retracted in light of additional information ◮ Common in real-life reasoning ◮ Not supported by traditional logic ◮ Weak negation is an early approach to achieve nonmonotonicity Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 135

slide-24
SLIDE 24

Agents

Conflicts and Priorities

◮ Rules can, and frequently do, conflict

◮ An outcome of modular knowledge acquisition ◮ Inadvertently enable two rules with contradictory conclusions

◮ Solution: expand rules to contain all applicable exception conditions

◮ Unwieldy rules ◮ Must redo each time new rules are stated ◮ Can be impossible for users to understand ⇒ a major motivation for

rules in the first place

◮ Solution: assert which rule overrides another rule

◮ Specificity based on predicates used: only generic basis for prioritizing

  • ne rule over another

◮ Doesn’t always apply ◮ Rely on order in the rules program ◮ Such an order may not exist ◮ Nontrivial to maintain ◮ Assert numeric (or categorical) weights on rules ◮ Nontrivial to maintain ◮ Assert rankings between rules ◮ Nontrivial to maintain Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 136

slide-25
SLIDE 25

Agents

Variables in Rules

For safety, do not introduce variables in action or consequent

◮ ECA rules introduce variables in event and condition

◮ Free variable in action indicates perform action for each binding

◮ Inference rules introduce variables in antecedent

◮ Free variable in consequent means assert it for each binding Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 137

slide-26
SLIDE 26

Agents

Agents Summary

◮ Agents match requirements of open environments ◮ Agents go beyond objects and procedural programming ◮ Agent abstractions help express requirements in a natural manner ◮ Cognitive constructs for agents can be powerful ◮ Rules provide a simple means to construct information agents

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 138