Semantics Processes Agents Munindar P Singh and Michael N Huhns Wiley 2005 Chapter 15 2 ServiceOriented Computing Semantics Processes Agents Munindar Singh and Michael Huhns Highlights of this Chapter ID: 727443
Download Presentation The PPT/PDF document "Chapter 15: Agents Service-Oriented Comp..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Chapter 15:Agents
Service-Oriented Computing:
Semantics, Processes, Agents
– Munindar P. Singh and Michael N. Huhns, Wiley, 2005Slide2
Chapter 152
Service-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
RulesSlide3
Chapter 153
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
What is an Agent?
Wide range of behavior and functionality in computing
An agent is an
active
computational entity
With a
persistent
identity
Can carry out a long-lived conversation
Perceives
,
reasons
about, and
initiates
activities in its environment
Deals with services
Communicates
(with other agents) and changes its behavior based on others
Loosely coupled
Business partners map to agentsSlide4
Chapter 154
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Agents and Multiagent Systems for SOC
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 Slide5
Chapter 155
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Modeling Agents: AI
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 persistenceSlide6
Chapter 156
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Modeling Agents: MAS
Emphasize
interaction (autonomy and
communication)
Social:
about collections of agents
Organizational:
about teams and groups
Legal:
about contracts and compliance
Ethical:
about right and wrong actionsSlide7
Chapter 157
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Mapping SOC to Agents
Agents apply well in an open system
Autonomy
ability to enter into and enact contracts; compliance
How can we check or enforce compliance?
Heterogeneity
ontologies
Loose coupling
communication
Trustworthiness
contracts, ethics, learning, incentives
Dynamism
combination of the aboveSlide8
Two Ways to Apply AgentsAs modeling constructsStanding in for stakeholders
To help capturing their requirements
Especially their goals
As run time constructs
Representing stakeholders
Acting on their behalves
Reflecting a stakeholder’s autonomous decision making to other parties
Chapter 15
8
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael HuhnsSlide9
Goal Modeling ConceptsActors: stakeholder or software “system”
Goals
“Hard” by
default: required functionality
Soft goals: support partial fulfillment
Decomposition: AND or
OR
Beliefs; Plans; Resources
Dependencies between actors
In terms of their
goals, plans, or resources
Contributions of any
goal or plan
to a soft goal
Makes (++); Helps (+); Hurts (-); Breaks (--)
Chapter 15
9
Service-Oriented Computing: Semantics, Processes, Agents
-
Munindar
Singh and Michael
HuhnsSlide10
Simplified Goal ModelingIdentify actors:
stakeholders
plus one
or more “
system” actors—both “as is” and “to be” (placeholders
)
Elicit goals of each stakeholder actor
Decompose such goals based on
domain knowledge
Available services
for traditional SOC
Applicable context abstractions
(beliefs) for context-aware apps
Beliefs about context abstractions affect choice of goal at run time
Identify
contribution links to soft goals
Identify dependencies between actors
Incrementally, assign some goals of system actors
When all stakeholders goals are supported by system actors’ goals, design and implement system actors
Chapter 15
10
Service-Oriented Computing: Semantics, Processes, Agents
-
Munindar
Singh and Michael
HuhnsSlide11
Chapter 1511
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
A Reactive Agent
The Sense-Decide-Act Loop
Environment e;
RuleSet r;
while (true) {
state = senseEnvironment(e);
a = chooseAction(state, r);
e.applyAction(a);
}Slide12
Chapter 1512
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Economic Rationality
Three elements
A performance measure, e.g., expected utility
An agent’s prior knowledge and perceptions
The available actions
Ideal: for each possible percept sequence,
Acts to maximize its expected utility
On the basis of its knowledge and evidence from the percept sequenceSlide13
Chapter 1513
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Logic-Based Agents
(Another 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 adequate model of the world Slide14
Chapter 1514
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Cognitive Architecture for an Agent
For SOC, sensors and effectors map to services;
the communication infrastructure is messaging
middlewareSlide15
ExerciseCreate an instance of the preceding diagram where the two agents are Amazon and a manufacturerWhen is it beneficial to employ agents in this setting?What is an illustration of loose coupling in this setting?
Chapter 15
15
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael HuhnsSlide16
Chapter 1516
Service-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
Addresses how beliefs, desires and intentions are represented, updated, and acted
upon
Somewhat richer than sense-decide-act: decisions directly affect future decisions
Consider goal-oriented requirements engineeringSlide17
Chapter 1517
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Architecture of BDI-Based Agent
Execution Cycle: the agent
Receive new information
Update beliefs and goals
Reason about actions
Intend an action
Select an intended action
Activate selected intention
Perform an action
Update beliefs, goals, intentionsSlide18
Chapter 1518
Service-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 via inputs, outputs, preconditions, effects (IOPE)
Used for composition and interoperation
Extended to IOPR: a result combines an output and associated effectsSlide19
Chapter 1519
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
OWL-S Service OntologySlide20
Chapter 1520
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
OWL-S Mapped to
UDDISlide21
Chapter 1521
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
OWL-S Service ModelSlide22
Chapter 1522
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
OWL-S Example: Processing Book OrdersSlide23
Chapter 1523
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
OWL-S IOPEs for Bookstore ExampleSlide24
Chapter 1524
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Composition as Planning
Represent current and goal states
Represent each service as an action
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 stateSlide25
Chapter 1525
Service-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 soSlide26
Chapter 1526
Service-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 chainingSlide27
Chapter 1527
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Applying ECA Rules
Capture protocols, policies, and heuristics as ECA 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 layersSlide28
Example: ECAIF request (?x ?y ?z) eventAND like (?x ?y)
condition
THEN do(fulfill(?x ?z))
action
Watch out for relevant events
If one occurs, check condition
If condition holds, perform action
Chapter 15
28
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael HuhnsSlide29
Example: InferenceTypical syntax indicating forward chainingIF 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)
Chapter 15
29
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael HuhnsSlide30
Example: CommunicationIF incoming-message(?x ?y ?z)AND policy(?x ?y ?w)AND policy(?x ?z ?v)
THEN send message(?x ?v ?w)
AND assert internal-fact(?x ?v ?w)
Here the policy stands for any internal decision making, usually defined as INFER policy(?x ?y ?w) FROM …
Chapter 15
30
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael HuhnsSlide31
ExerciseState the customer’s rules to capture how it might interact with a merchant in a purchase protocolRFQ: request for quotes(Price) quote
Accept or Reject
Goods
Payment
Receipt
Chapter 15
31
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael HuhnsSlide32
Chapter 1532
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
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 negationSlide33
Chapter 1533
Service-Oriented Computing: Semantics, Processes, Agents
- Munindar Singh and Michael Huhns
Free and Bound Variables
General rules involve
free
variables
For ECA rules: in event and condition
Free variable in action indicates perform action for
each
binding
For inference rules: in antecedent
Free variable in consequent means assert it for
each
binding
Therefore, to ensure
safety
, use only
bound
variables in action or consequentSlide34
Chapter 1534
Service-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