chapter 15: agents

26
Chapter 15: Agents Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005

Upload: hallie

Post on 06-Jan-2016

26 views

Category:

Documents


1 download

DESCRIPTION

Chapter 15: Agents. Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005. Highlights of this Chapter. Agents Introduced Agent Descriptions Abstractions for Composition Describing Compositions Service Composition as Planning Rules. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 15: Agents

Chapter 15:Agents

Service-Oriented Computing: Semantics, Processes, Agents– Munindar P. Singh and Michael N. Huhns, Wiley, 2005

Page 2: Chapter 15: Agents

Chapter 15 2Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Highlights of this Chapter

Agents Introduced Agent Descriptions Abstractions for Composition Describing Compositions Service Composition as Planning Rules

Page 3: Chapter 15: Agents

Chapter 15 3Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

What is an Agent?

The term agent in computing covers a wide range of behavior and functionality

An agent is an active computational entity With a persistent identity Perceives, reasons about, and initiates

activities in its environment Communicates (with other agents) and

changes its behavior based on others Business partners => agents

Page 4: Chapter 15: Agents

Chapter 15 4Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Agents and MAS for SOC

Why agents for services? Autonomy, heterogeneity, dynamism

Unlike objects, agents Are proactive and autonomous Cooperate or compete Model users, themselves, others Dynamically use and reconcile

ontologies

Page 5: Chapter 15: Agents

Chapter 15 5Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Modeling Agents: AI

Traditionally, 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

Page 6: Chapter 15: Agents

Chapter 15 6Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Modeling Agents: MAS

Emphasize interaction Social: about collections of agents Organizational: about teams and

groups Legal: about contracts and

compliance Ethical: about right and wrong actions

Emphasize autonomy and communication

Page 7: Chapter 15: Agents

Chapter 15 7Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Mapping SOC to Agents

Agents as components of an open system Autonomy => ability to enter into and

enact contracts; compliance Heterogeneity => ontologies Loose coupling => communication Trustworthiness => contracts, ethics,

learning, incentives Dynamism => combination of the

above

Page 8: Chapter 15: Agents

Chapter 15 8Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

A Reactive Agent

PerceiveEnvironment

Select Action

Environment

Condition-Action Rules

Effectors

Sensors

percepts

action

worldmodel

outputs

inputs

ReactiveAgent

Environment e;RuleSet r;while (true) { state = senseEnvironment(e); a = chooseAction(state, r); e.applyAction(a);}

Page 9: Chapter 15: Agents

Chapter 15 9Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

A Rational Agent

Rationality depends on ... A performance measure, e.g., expected

utility What the agent has perceived so far What the agent knows ahead of time The actions the agent can performAn ideal rational agent: for each possible

percept sequence, it acts to maximize its expected utility, on the basis of its knowledge and the evidence from the percept sequence

Page 10: Chapter 15: Agents

Chapter 15 10Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Logic-Based Agents An agent is a knowledge-based system

Explicitly represents symbolic model of the world

Reasons symbolically via logical deduction Challenges:

Maintaining adequate descriptions of the world

Representing information about complex real-world entities in symbolic terms

Easier in information environments than in general

Page 11: Chapter 15: Agents

Chapter 15 11Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Cognitive Architecture for an Agent

Beliefs, Desires, Intentions

Reasoner

Effectors

Sensors

Perceptions

Actions

Agent Alice

Beliefs, Desires, Intentions

Reasoner

Effectors

Sensors

Perceptions

Actions

Agent Bob

CommunicationInfrastructure

CommunicationInterfaces

For SOC, sensors and effectors are services; communication is via messaging middleware

Page 12: Chapter 15: Agents

Chapter 15 12Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Action

output

brf

Generate options

filter

action

Sensor

input

beliefs

desires

intentions

Generic BDI Architecture

A BDI architecture addresses how beliefs, desires and intentions are represented, updated, and acted upon

Page 13: Chapter 15: Agents

Chapter 15 13Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Architecture of BDI-Based AgentExecution Cycle: the agent1. Receives new

information2. Updates beliefs and

goals3. Reasons about actions4. Intends an action5. Selects an intended

action 6. Activates selected

intention7. Performs an action8. Updates beliefs, goals,

intentions

+run()+currentIntentionIsOK() : boolean(idl)+stopCurrentIntention()+chooseIntention()+perceiveEnvironment()+takeAction()

-B : BeliefSet-D : DesireSet-P : IntentionSet-I : Intention-e : Environment-name: String-a : Action

Agent

+run()+applyAction(in a : Action)

-a : AgentSet

Environment

+add(in a : Agent)+remove(in a : Agent)

-elements: Vector

AgentSet

+includeObservation()

-elements: Vector

BeliefSet

+getApplicable(in B : BeliefSet) : DesireSet

-elements: Vector

DesireSet

+getApplicable(in D : DesireSet, in B : BeliefSet) : IntentionSet

-elements: Vector

IntentionSet

+satisfies(in d : Desire) : boolean(idl)+execute(in a : Agent) : boolean(idl)+context(in B : BeliefSet) : boolean(idl)+stopExecuting()

-id: String-priority: int-d: Desire-a : Agent

Intention

-id: String-value: String

Belief

+context(in B : BeliefSet) : boolean(idl)

-id: String-priority: int

Desire

Action

Page 14: Chapter 15: Agents

Chapter 15 14Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Web Ontology Language for Services (OWL-S)

An OWL-S service description provides Declarative ads for properties and

capabilities, used for discovery Declarative APIs, used for execution A declarative description of services

Based on their inputs, outputs, preconditions, and effects

Used for composition and interoperation

Page 15: Chapter 15: Agents

Chapter 15 15Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

OWL-S Service Ontology

Service

ServiceGrounding

Resource

ServiceModel

ServiceProfile

provides

supports presents

describedBy

Page 16: Chapter 15: Agents

Chapter 15 16Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

OWL-S Compared to UDDI

Page 17: Chapter 15: Agents

Chapter 15 17Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

OWL-S Service Model

Resource Service

ServiceProfile ServiceGrounding

ProfileProcess

AtomicProcess SimpleProcess CompositeProcess

ControlConstruct

ServiceModel

ProcessComponent

input

precondition

output

effect

provides

presents describedBy supports

hasProfile

realizes expand

components

computedInput

computedEffectinvocable

computedOutput

composedBy

computedPrecondition

Sequence Split RepeatUnit. . .

QualityRating

ServiceCategoryActor

ParameterDescription

ServiceParameter

Page 18: Chapter 15: Agents

Chapter 15 18Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

OWL-S Example: Processing Book Orders

CreateAccount

LoadAccount

ChooseBook

Add toOrder

SelectCredit Card

ChargeCredit Card

Book StoreSequence Process

Selection Process Iteration Process Choice Process

Choice Process

Page 19: Chapter 15: Agents

Chapter 15 19Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

OWL-S IOPEs for Bookstore Example

Page 20: Chapter 15: Agents

Chapter 15 20Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Composition as Planning

Service composition as planning: Represent current and goal states Represent each service as an action

(with inputs, outputs, preconditions, effects)

Represent a composed service as a plan that invokes the constituent services constraining the control and data flow to achieve the goal state

Page 21: Chapter 15: Agents

Chapter 15 21Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Rules: Logical Representations

Rules are desirable because they are Modular: easy to read and maintain Inspectable: easy to understand Executable: no further translation

needed Expressive: (commonly) Turing complete

and can capture knowledge that would otherwise not be captured declaratively

Compare with relational calculus (classical SQL) or description logics (OWL)

Declarative, although imperfectly so

Page 22: Chapter 15: Agents

Chapter 15 22Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Kinds of Rules

ECA or Reaction On event if condition then perform

action Derivation rules: special case of above

Integrity constraints: derive false if error Inference rules

If antecedent then consequent Support multiple computational strategies

Forward chaining; backward chaining

Page 23: Chapter 15: Agents

Chapter 15 23Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Applying ECA Rules

Capture protocols, policies, and heuristics as rules Examples?

Often, combine ECA 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

Page 24: Chapter 15: Agents

Chapter 15 24Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Applying Inference Rules

Inference rules capture general requirements well

Elaboration tolerance requires defeasibility Write general rules Override them as need to specialize them to

account for context Leads to logical nonmonotonicity

Easy enough operationally but difficult to characterize mathematically

Details get into logic programming with negation

Page 25: Chapter 15: Agents

Chapter 15 25Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Use of Variables

Need free variables to make the rules generic in how they apply For ECA rules: event and condition For inference rules: antecedent Should generally not have free

variables in consequent to ensure “safety”

Free variable in action indicates perform action for each binding

Free variable in consequent means assert it for each binding

Page 26: Chapter 15: Agents

Chapter 15 26Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Chapter 15 Summary

Agents are natural fit with open environments

Agent abstractions support expressing requirements in a natural manner

Agents go beyond objects and procedural programming

Self-study Jess