SOC-chapter15

Chapter 15:
Agents
Service-Oriented Computing: Semantics, Processes, Agents
– Munindar P. Singh and Michael N. Huhns, Wiley, 2005
Highlights of this Chapter






Chapter 15
Agents Introduced
Agent Descriptions
Abstractions for Composition
Describing Compositions
Service Composition as Planning
Rules
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
2
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 map to agents
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
3
Agents and MAS for SOC

Unlike objects, agents



In addition, agents may



Chapter 15
Are proactive and autonomous
Support loose coupling
Cooperate or compete
Model users, themselves, and others
Dynamically use and reconcile ontologies
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
4
Modeling Agents: AI

Emphasize mental concepts





Chapter 15
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
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
5
Modeling Agents: MAS

Emphasize interaction





Chapter 15
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
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
6
Mapping SOC to Agents
Agents apply well in an open system





Chapter 15
Autonomy  ability to enter into and enact
contracts; compliance
Heterogeneity  ontologies
Loose coupling  communication
Trustworthiness  contracts, ethics,
learning, incentives
Dynamism  combination of the above
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
7
A Reactive Agent
Reactive
Agent
Sensors
inputs
percepts
ConditionAction Rules
Environment e;
RuleSet r;
while (true) {
state = senseEnvironment(e);
a = chooseAction(state, r);
e.applyAction(a);
}
Perceive
Environment
world
model
Environment
Select Action
action
outputs
Effectors
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
8
Rationality
A performance measure, e.g., expected utility
 An agent’s prior knowledge and perceptions
 The available actions
An 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
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
9
Logic-Based Agents

An agent is a knowledge-based system



Represents a symbolic model of the world
Reasons symbolically via logical deduction
Challenges:

Representing information symbolically


Chapter 15
Easier in information environments than in
general
Maintaining adequate model of the world
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
10
Cognitive Architecture for an Agent
Agent Alice
Beliefs, Desires, Intentions
Sensors
Agent Bob
Communication
Infrastructure
Beliefs, Desires, Intentions
Sensors
Perceptions
Perceptions
Communication
Interfaces
Reasoner
Effectors
Reasoner
Effectors
Actions
Actions
For SOC, sensors and effectors map to services;
communication is via messaging middleware
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
11
Generic BDI Architecture
Sensor
input
Addresses how beliefs,
desires and intentions
are represented,
updated, and acted
upon
brf
beliefs
Generate options
desires
filter
intentions
action
Action
output
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
12
Architecture of BDI-Based Agent
Environment
AgentSet
Action
-a : AgentSet
-elements: Vector
+run()
+applyAction(in a : Action)
+add(in a : Agent)
+remove(in a : Agent)
Agent
BeliefSet
-elements: Vector
+includeObservation()
Belief
-id: String
-value: String
-B : BeliefSet
-D : DesireSet
-P : IntentionSet
-I : Intention
-e : Environment
-name: String
-a : Action
+run()
+currentIntentionIsOK() : boolean(idl)
+stopCurrentIntention()
+chooseIntention()
+perceiveEnvironment()
+takeAction()
IntentionSet
-elements: Vector
+getApplicable(in D : DesireSet, in B : BeliefSet) : IntentionSet
Execution Cycle: the agent
1. Receive new information
2. Update beliefs and goals
3. Reason about actions
4. Intend an action
5. Select an intended action
6. Activate selected intention
7. Perform an action
8. Update beliefs, goals,
intentions
DesireSet
-elements: Vector
Intention
+getApplicable(in B : BeliefSet) : DesireSet
Desire
-id: String
-priority: int
+context(in B : BeliefSet) : boolean(idl)
Chapter 15
-id: String
-priority: int
-d: Desire
-a : Agent
+satisfies(in d : Desire) : boolean(idl)
+execute(in a : Agent) : boolean(idl)
+context(in B : BeliefSet) : boolean(idl)
+stopExecuting()
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
13
Web Ontology Language for Services (OWL-S)
An OWL-S service description provides
 Declarative ads for properties and
capabilities


Declarative APIs


Used for execution
A declarative description via inputs,
outputs, preconditions, effects (IOPE)

Chapter 15
Used for discovery
Used for composition and interoperation
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
14
OWL-S Service Ontology
Resource
provides
Service
supports
presents
describedBy
ServiceGrounding
ServiceProfile
ServiceModel
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
15
OWL-S Compared to UDDI
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
16
provides
Resource
Service
presents
describedBy
ServiceProfile
OWL-S
Service
Model
supports
ServiceModel
ServiceGrounding
input
QualityRating
precondition
Process
hasProfile
ParameterDescription
Profile
effect
Actor
ServiceCategory
computedInput
computedOutput
AtomicProcess
realizes
SimpleProcess
expand
CompositeProcess
ProcessComponent
Sequence
components
computedPrecondition
computedEffect
invocable
composedBy
Chapter 15
ServiceParameter
output
ControlConstruct
Split
...
RepeatUnit
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
17
OWL-S Example: Processing Book Orders
Book Store
Sequence Process
Selection Process
Create
Account
Load
Account
Iteration Process
Choice Process
Add to
Order
Choice Process
Charge
Credit Card
Select
Credit Card
Choose
Book
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
18
OWL-S IOPEs for Bookstore Example
Chapter 15
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
19
Composition as Planning


Represent current and goal states
Represent each service as an action


Chapter 15
Based on its IOPE
Represent a composed service as a plan
that invokes the constituent services
constraining the control and data flow
to achieve the goal state
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
20
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


Chapter 15
Compare with relational calculus (classical SQL)
or description logics (OWL)
Declarative, although imperfectly so
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
21
Kinds of Rules

ECA or Reaction


Derivation rules: special case of above


On event if condition then perform
action
Integrity constraints: derive false if error
Inference rules


If antecedent then consequent
Support multiple computational strategies

Chapter 15
Forward chaining; backward chaining
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
22
Applying ECA Rules

Capture protocols, policies, and
heuristics as ECA rules



Often, combine ECA with inference
rules (to check if a condition holds)
Modeling challenge


Chapter 15
Examples?
What is an event?
How to capture composite events by
pushing event detection to lower layers
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
23
Applying Inference Rules


Capture general requirements
Elaboration tolerance requires defeasibility



Leads to logical nonmonotonicity


Chapter 15
Formulate general rules
Override rules to specialize them as needed
Easy enough operationally but difficult to
characterize mathematically
Details get into logic programming with negation
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
24
Free and Bound Variables

General rules involve free variables

For ECA rules: in event and condition


For inference rules: in antecedent


Chapter 15
Free variable in action indicates perform action
for each binding
Free variable in consequent means assert it for
each binding
Therefore, to ensure safety, use only
bound variables in action or consequent
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
25
Chapter 15 Summary



Chapter 15
Agents are natural fit with open
environments
Agent abstractions support expressing
requirements in a natural manner
Agents go beyond objects and
procedural programming
Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns
26