© enn tyugu1 algorithms of artificial intelligence lecture 9: intelligent agents e. tyugu spring...
TRANSCRIPT
© Enn Tyugu 1
Algorithms of Artificial Intelligence
Lecture 9: Intelligent agents E. Tyugu
Spring 2003
© Enn Tyugu 2
Intelligent agents
Intelligent agents are software components. They possess some features of intelligent behavior:
• proactiveness• understanding of agent communication language (ACL)
• reactivity (ability to make some decisions and to act) and they may have properties like • planning ablity• mobility• reflection• perception of environment etc.In the software engineering community they are also called software agents
and are considered to be objects with proactiveness and ACL.(Compare agents and objects.)
© Enn Tyugu 3
Proactiveness
Proactiveness is the ability to act without external stimuli. It can be realized by means of a separate thread performing the following simple algorithm, and a knowledge base of proactive actions.
A9.1: while true do
wait(givenInterval);
lookAtClock;
consultKB;
act;
od
© Enn Tyugu 4
How to act in an open world?
• perceiving the world
• affecting the world
• having a (rational) model of behavior
• having motivations to be fulfilled by implementing corresponding goals
© Enn Tyugu 5
Basic concepts: Agents
• act on behalf of another entities
• autonomy
• proactiveness
• reactivity
• decentralized data and control
• negotiation, communication, coordination
© Enn Tyugu 6
More definitions
• Distributed Problem Solving (DPS) -considers how the task of solving a particular problem can be divided among a number of cooperating modules
• Multi-Agent Systems (MAS) - concerned with behavior of a collection of autonomous agents aiming in solving a given problem
© Enn Tyugu 7
Simple reactive agentreactiveAgent() {
while (true) dostate := perceive();rule :=selectRule(KB,state);rule.action();
}}
perceive
actselect
KBEnvironment
© Enn Tyugu 8
Agent with internal statereactiveAgent() {
while (true) doinput := perceive();rule := selectRule(KB,input,state);state := update(state,input);rule.action();
}}
perceive
actselectKB
Environmentstate
update
© Enn Tyugu 10
BDIBDI = Beliefs, Desires, Intentions
perceive
actselectKB1
Environmentstate
updategoal
planner KB2
BDI ACL communication
?intentions
© Enn Tyugu 11
Knowledge processing within an agent
Goal activation
Scheduling
Execution
Planning
GoalsSkills
Worldstate
Plans
Tasks
Resources
© Enn Tyugu 12
Generic Agent Interpreter - an agent shell(Y. Shoham)
Initialize mental
state and capabilities
Define rules for making new commitments
Update mental state
Execute commitments for current time
clock Representation of mental state and capability
Outgoing messages
Incoming messages
© Enn Tyugu 13
Agent finite state machine
ACTIVE
RECEIVING
WAITING
INACTIVE
SENDING
Reques
t tran
smit
Transm
ission
done
Time slice elapsed
Agent rescheduled
Decides to receivereceived
suspend
Wait condition satisfied
© Enn Tyugu 14
Agent machinery
EventType1 Handler1
EventType2 Handler2
… …
EventTypeN HandlerN
Event Event … EventEvent list
Event description list(including Event typesand references toEvent handlers)
Handler1 …. HandlerN
Event handlers
Agent engine
Agent interface
A CL port
Sensors/ affectors
Models
Data
Agent memory
© Enn Tyugu 15
Agent Shell Functional Structure
ACL Communication block
Low-level communication
Affection
Sensing
Goals analyser/synthesiser
Planner Declarative reflection manager
Procedural reflection manager
Models
Executor
Reactive block
© Enn Tyugu 16
Agent communication languages (ACL)
There are several ACL-s, the best known are:
– KQML
– FIPA.
The KQML language is based on the speech act theory:
– it gives a message format and message handling protocol
– it has primitives with fixed meaning, called performatives
– it is assumed that the environment for using KQML provides facilitators - special agents supporting the communication process, e.g. supporting a name service etc.
© Enn Tyugu 17
KQML statement (message)
A KQML message consists of • a performative• its arguments, if any• message content (not understood in KQML)• communication (transport and context( information.Example:(Ask-one - performative
:sender customer1 - communication :content (PRICE VCR ?price) - content
:reply-with VCR-price:langugae LPROLOG - parameters:ontology USD)
© Enn Tyugu 18
KQML performatives
KQML performatives have the role of commands.
Some KQML performatives are:– tell, deny, cancel, untell
– evaluate, reply, ask-if, ask-one, ask-about, ask-all
– achieve, advertise, subscribe, monitor, register, unregister
© Enn Tyugu 20
Declarative reflection schema 1
Oracle
(planner)self
Model of the self and of the environment
daemon
daemon
daemon
© Enn Tyugu 21
Declarative reflection schema 2
Oracle
(planner)self
Model of the self and of the environment
Reflection manager
Modeling languagedaemon
daemon
© Enn Tyugu 22
Concept specification language
• Superclass declarationsuper C; - C is a superclass
• Component declarationvar A : C; - A is a new component of class C
• Method declaration rel R : <axiom> <program>; - R is a new method (the name R may be
omitted.)• Equivalence declaration
rel A = B; - A and B are components with the same value
• Equation declarationrel e1 = e2; - e1, e2 are arithmetic expressions which
define a constraint on the variables occurring in them
© Enn Tyugu 23
Translation of specifications
We use a function Sem´ in an expression Sem´(D,w) denoting the set of formulas (axioms) representing the semantics of a declaration D with respect to the object w.
Sem(class C : D) = ( w. C(w) Sem´(D,w)) <structural axioms>
- semantics of the class is a set of axioms of the form C(w) F, where each F is included into axioms of one of its declarations, plus axioms representing the structure of the class.
© Enn Tyugu 24
Translation of specifications continued
• Sem´(super C, w) = C(w) – axioms of a superclass are taken without changes.
• Sem´(var A : C, w) = C(w.A) – a component A of an object w obtains the name w.A and keeps the properties of the class C given in its declaration.
• Sem´(rel <axiom> <program> , w) = <axiom instantiated by w> - semantics of a method is given by its axiom.
• Sem´(rel X = Y, w) = w.X = w.Y – equality of components is encoded in the proper way.
© Enn Tyugu 25
Exhibition/shopping center example
• class Visitor:super Person;
var affiliation : text;
• class Guide:super Agent;
var id : text;param : text;
• class Team:var visitor : Visitor;
guide : Guide;planOfVisit, parameters,
state : text; level, priority : num;
© Enn Tyugu 26
Exhibition/shopping center example
• class FirstMeet: varguide : any;visitor : any;team : Team; rel
intro: guide, visitor -> team.planOfVisit, team.level, team.param {…};team.guide = guide;team.visitor = visitor;
• class Guide:super Agent;var id, param : text;
• class Team:var visitor : Visitor;
guide : Guide;level, priority : num;planOfVisit , parameters ,state ,nextstate : text;
© Enn Tyugu 27
Exhibition/shopping center example
• class FirstMeet: varguide : any;visitor : any;team : Team; relintro: guide, visitor ->
team.planOfVisit, team.level, team.param {…};team.guide = guide;team.visitor = visitor;
• class Move: var team : Team;
exhibitionInfo : any;nextPlace : any;
rel next : exhibitionInfo, team.planOfVisit -> nextPlace {…};init exhibitionInfo := Expo2XXX();
© Enn Tyugu 28
Exhibition/shopping center example
• class AtBooth:super Agora;
var booth : any;time : num;
team : Team;ready,
bye : bool; aliasstate = (time, all.state);
nextstate = (time, all.nextstate); rel intro : team, booth -> state {…};
discourse : (state -> nextstate) -> ready {…}; farewell : ready -> bye {…};
© Enn Tyugu 29
Declarations for the PC example
Class DiscrepancyExist :var ListOfPCmemebers: any;
resolveConflict: bool;paper: Paper;rel
Conflict: ListOfPCmemebers, paper ->
resolveConflict {…};
© Enn Tyugu 30
Managing reflection (Exhibition/Shopping center)
Tommy9 : Guide type = Tommy;
MrSmith :Visitor name = ´John´;
act1 : FirstMeet guide = Tommy9, visitor = MrSmith;
team1024 = act1.team;
act2 : Move team = team1024 ;
act3 : AtBooth booth = act2.nextPlace;
act4 : Move team = team1024;
act6 : AtBooth booth = Nokia;
…
© Enn Tyugu 31
References• G. M. O’Hare, N. R. Jennings, eds. (1996) Foundations of Distributed
Artificial Intelligence. John Wiley & Sons.
• Norvig, Russell (2000) Artificial Intelligence: Modern Approach
• P. Maes. (1987). Concepts and Experiments in Computational Reflection. Proc. ACM Conf. On OOP, Systems, Languages and Applications, Orlando, p. 147 – 156.
• Y. Shoham. (1997). An Overview of Agent-Oriented Programming. In: J. M. Bradshaw, ed. Software Agents. AAAI Press/The MIT Press, p. 271 - 290.
• M. Addibpour, E. Tyugu. Declarative reflection tools for agent shells. Future Generation Computer Systems. July 1996, p. 1 - 12.