Lecture 5 - Agent communication

70
LECTURE 5: Agent Communication Artificial Intelligence II – Multi-Agent Systems Introduction to Multi-Agent Systems URV, Winter-Spring 2010

description

Multiagent systems course at URV. Lecture 5, on agent communication. Material from several sources.

Transcript of Lecture 5 - Agent communication

Page 1: Lecture 5 - Agent communication

LECTURE 5: Agent Communication

Artificial Intelligence II – Multi-Agent Systems

Introduction to Multi-Agent Systems

URV, Winter-Spring 2010

Page 2: Lecture 5 - Agent communication

Multi-agent systems course (I)

First part of the course: agentsIntroduction to agent technologyAgent architectures

Reactive / Deliberative / HybridAgent properties

Autonomy / Communication / Learning / Reactivity / Mobility / Reasoning / Proactivity / ...

Agent typesCooperative / Interface / Information / Mobile / Reactive / Hybrid / Heterogeneous systems

Page 3: Lecture 5 - Agent communication

Multi-agent systems course (II)

Second part of the course: Multi-Agent Systems

Agent communicationCoordinationNegotiationDistributed planningCoalition formationApplication domains

Page 4: Lecture 5 - Agent communication

Overview of today’s lecture

Collaborative agentsDistributed problem solvingAgent communication

Blackboard systemsMessage passingFIPA standardsBasic communication protocols

Page 5: Lecture 5 - Agent communication

Collaborative Agents (I)

A multi-agent system (MAS) may be seen as a collection of collaborative agentsThey can communicate and cooperate with other agents, while keeping their autonomyThey usually negotiate with their peers to reach mutually acceptable agreements during cooperative problem solving

Page 6: Lecture 5 - Agent communication

Collaborative Agents (II)

They normally have limited learningcapabilitiesCollaborative agents are usually deliberative agents (e.g. BDI model), with some reasoning capabilities

Reactive agents can hardly communicate and collaborate (only through actions that modify the common environment)

They are usually static, complex agents

Page 7: Lecture 5 - Agent communication

Collaborative Agents: Motivations (I)

To solve problems that are too large for a single centralised agent

Huge amount of knowledge to be consideredMany computational resources needed to solve the problemRisk of having a centralised system

Page 8: Lecture 5 - Agent communication

Collaborative Agents: Motivations (II)

To create a system that functions beyond the capabilities of any of its members

Added value of a MAS

To allow for the interconnection and inter-operation of existing legacy systems[ Recall agentification mechanisms seen on the

previous lecture: translators, wrappers]DBs, expert systems, electronic equipment, sensors

Example: organ transplant coordination

Page 9: Lecture 5 - Agent communication

Finding a transplant receiver

0-Emergency Patients in all SpainDonor’s hospital

Other hospitals in the same cityOther cities of the same regionOther regions of the same zone

Rest of Spain

Spanish Model

Process defined by the Spanish Transplant Organisation (ONT)

Page 10: Lecture 5 - Agent communication

National Level

Regional Level

Zonal Level

Hospital Level

NationalCoordinator

ZI ZIVZIIIZII ZV ZVI

CataloniaBalearicIslands

Aragon

HnH1 H2 ...

Barcelona

Urgency AgentEmergency Level

Architecture of the MAS

Page 11: Lecture 5 - Agent communication

Collaborative Agents: ApplicationsProvide solutions to physically distributed problems

Disaster in a city (police, firemen, ambulances)Provide solutions to problems with distributed data sources

Sensor network monitoring a given areaProvide solutions that need distributed expertise

Health care provision (family doctors, nurses, specialists, laboratory analysis, …)

Page 12: Lecture 5 - Agent communication

Benefits of Multi-Agent Systems (I)Modularity

Each agent is specialised in the solution of a particular kind of problems (leading also to reusability)The complexity of the construction of agents is reducedThe process of solving a complex problem is reduced to solving easier subproblems

Page 13: Lecture 5 - Agent communication

Benefits of Multi-Agent Systems (II)

EfficiencyProblems can be solved more quickly, due to the inherent concurrency/parallelismDifferent agents are working at the same time in different parts of a problem

These subproblems can be independent or (slightly) dependent

Share partial resultsCoordinate the use of shared resources

Page 14: Lecture 5 - Agent communication

Benefits of Multi-Agent Systems (III)

ReliabilityAvoid single point of failure in centralised systemsWe can have redundancy

Different agents of the same typeDifferent agents that can do a certain task

If an individual agent fails, the other agents can take its work and re-distribute it dynamically

Page 15: Lecture 5 - Agent communication

Benefits of Multi-Agent Systems (IV)

FlexibilityAgents can be created/deleted dynamically, depending on the amount of work to be done, the available resources,etcAgents can dynamically generate subtasks and look for helping agentsAgents with different skills may dynamically form teams/coalitions to work together

Page 16: Lecture 5 - Agent communication
Page 17: Lecture 5 - Agent communication

Distributed problem solving

Agents work together to solve problems that require collective effortRequires:

CoherenceNeed to want to work together

CompetenceNeed to know how to work together

Distributed PlanningDistributed Problem Solving in which the agents work together to construct a plan

Page 18: Lecture 5 - Agent communication

Distributed problem solving steps

1. Task Decomposition2. Task Allocation3. Task Accomplishment4. Result Synthesis

Page 19: Lecture 5 - Agent communication

1-Task decomposition

Divide a complex problem into a set of tasks (e.g. a hierarchy of subproblems)Decompose (recursively, if necessary) large tasks into subtasks that can be tackled by different agentsTasks can be totally independent or can have some relationshipsThis decomposition may be done by the user, by a central coordinator agent or may be negotiated at run time by all the agents of the system

Page 20: Lecture 5 - Agent communication

Example of hierarchical task decomposition in an AND-OR tree

Page 21: Lecture 5 - Agent communication

2-Task allocationAssign the subproblems to different agentsEasy case: there is only one agent capable of solving each subproblem

No flexibilityInteresting case: the same subproblem can be solved by different agents

Dynamic mechanisms of run-time task allocation (e.g. Contract Net)Possibility of recovering fromindividual failures

Page 22: Lecture 5 - Agent communication

3-Task accomplishmentEach agent solves (on its own) its assigned subproblemsThis phase can be done, in principle, without communication (if the problems are independent) There may be dependencies between subproblems

Potential conflicts may appear

Page 23: Lecture 5 - Agent communication

Conflict management

ExamplesTwo sub-solutions are incompatibleConflicts in the use of shared resources

Agents have to communicate with each other to solve these situationsThere may be different solutions to the same subproblem

Page 24: Lecture 5 - Agent communication

Agent support in task execution (I)

Task sharingAn agent can request the help of other agents to solve a particular task

Too complex / expensive for the agent to do individuallyIt can know that other agents have the appropriate knowledge/skills to solve that taskIt can know that other agents already have to solve that task

Problem of task assignmentWho can I ask for help?How do I know what tasks can other agents do?

Page 25: Lecture 5 - Agent communication

Agent support in task execution (II)Result sharing

Use intermediate results obtained by other agents[ For example, traffic routes to certain points of the city ]

Agents can provide intermediate subsolutions to help other agents in their workThat allows a fast recognition of

Incorrect solutionsAn agent, on the basis of its knowledge, can detect an error on the results of other agents

Conflictive solutionsAn agent can detect possible conflicts between its results and subsolutions of other agents

Cooperation/Negotiation to solve these problems

Page 26: Lecture 5 - Agent communication

4-Result synthesis

Put together the results of all agents to find the complete solutionWho makes it?How is it made?If each subproblem has a unique solution, it is a relatively easy stepOtherwise, there may be need of conflict detection, task re-assignment, ...

Page 27: Lecture 5 - Agent communication

Summary: collaborative MAS (I)

Who decomposes the problem?One agent / all agents / user

How is the problem decomposed?1 level / n levelsStatic – beginning / Dynamic – execution time

Who assigns tasks to agents? How is the assignment made?

Static – beginning / Dynamic – execution time

Page 28: Lecture 5 - Agent communication

Summary: collaborative MAS (II)

What kind of interactions can exist between agents when they are solving tasks?

Conflict detectionConflict resolution

How are tasks shared?How are results shared?Who/how merges the subresults to get the final result?

Page 29: Lecture 5 - Agent communication

Why do we need Agent Communication?

Multi agent systems allow distributed problem solvingThis requires the agents to coordinatetheir actionsAgent communication facilitates this by allowing individual agents to interact

allows cooperationallows information sharing

Page 30: Lecture 5 - Agent communication

Communication Categories

We can classify communication in a mechanistic manner

via the type of sendee-addressee linkvia the nature of the medium

or in a higher level meaning-based manner

via the type of intention

Page 31: Lecture 5 - Agent communication

The Sendee - Addressee Link

Communication can bePoint to Point

An agent talks directly to another agentBroadcast

An agent sends some information to a group of agents

MediatedThe communication between two agents is mediated by a third partyExample: facilitators

Page 32: Lecture 5 - Agent communication

Communication via facilitator (I)Agent 1

Facilitator

Agent 2

1

43

5

2

1. Agent_2 tells the facilitator the services it provides

2. Agent_1 asks to the facilitator who can provide a certain service with some conditions

3. The facilitator requests the service to agent_2

4. Agent_2 provides the answer

5. The facilitator sends the answer to agent_1

Page 33: Lecture 5 - Agent communication

Communication via facilitator (II)

1. Agent_2 tells the facilitator the services it provides

2. Agent_1 asks to the facilitator who can provide a certain service with some conditions

3. The facilitator tells agent_1 that agent_2 can do that service

4. Agent_1 requests the service from agent_2

5. Agent_2 sends the answer to agent_1

Agent 1

Facilitator

Agent 2

1

4

53

2

Page 34: Lecture 5 - Agent communication

Locating other agents

Unless we use some broadcast techniques (e.g. blackboard systems), agents must know the address of other agents - possible solutions are

Complete internal directoryPartial/hierarchical internal directoryMediated (e.g. JADE’s DF)

Page 35: Lecture 5 - Agent communication

JADE – Directory Facilitator

Page 36: Lecture 5 - Agent communication

Nature of the mediumDirect routing

Message sent directly to other agent(s) with no interception or attenuation in strength

Signal propagation routingCommonly used by reactive agentsAgent sends signal whose intensity decreases according to distance (e.g. physical robots)

Public notice routingBlackboard systems

Page 37: Lecture 5 - Agent communication

Agent communication

Basic options used in MASBlackboard systemsDirect message passing

Page 38: Lecture 5 - Agent communication

Blackboard Systems

blackboardagent

agent

agentagent

agent

agent

agentagent

Page 39: Lecture 5 - Agent communication

Blackboard-based communication

Each agent can put information/data/knowledge on the common information spaceEach agent can read from the blackboard at any momentThere is no direct communication between agents

Page 40: Lecture 5 - Agent communication

Information in blackboard

Data of the common problemCurrent state of the solutionNext subproblems to be solvedRequests of helpPresent task of each agentIntermediate results

Page 41: Lecture 5 - Agent communication

Uses of blackboard

Detect conflictsDifferent agents that want to perform the same task

Notice incompatible solutionsSolutions using a shared resource at the same time

Share resultsAgents can use partial/complete results obtained by other agents

Share tasksAgents can request help in solving sub-tasks

Page 42: Lecture 5 - Agent communication

Advanced blackboard systems (I)

Moderator agentAdvertises in the blackboard the next problems to be solvedChecks which agents offer to solve themAssigns the pending problems to the agents

It has internal domain and system knowledge to make this assignmentThe blackboard is also used to communicate the assignments

Page 43: Lecture 5 - Agent communication

Advanced blackboard systems (II)

Dispatcher agentTells the agents registered in a blackboard about the changes produced on it that can be interesting / relevant for them

Example: new problem announcement => tell the agents that can be potentially interested in solving it

Agents do not need to be continuously checking the blackboard

Page 44: Lecture 5 - Agent communication

Blackboard systems summary (I)

Positive aspectsFlexible mechanism that allows communication/cooperation

E.g. n blackboardsIndependent of cooperation strategyIt does not place any restriction on the agents’internal architecture

Page 45: Lecture 5 - Agent communication

Blackboard systems summary (II)

Negative aspectsCentralised structureSystem bottleneckEveryone has to write info on the blackboardEveryone has to read from the blackboardSingle point of failure

Page 46: Lecture 5 - Agent communication

Message passing

Information is passed from one agent to another. The nature of this information can be very varied. Speech acts provide one way to describe this variety

Agent 1(Sender)

Agent 2(Receiver)

message

Page 47: Lecture 5 - Agent communication

Speech ActsMost treatments of communication in multi-agent systems borrow their inspiration from speech act theorySpeech act theories are pragmatictheories of language, i.e., theories of language use: they attempt to account for how language is used by people every day to achieve their goals and intentionsThe origin of speech act theories isusually traced to Austin’s 1962 book, How to Do Things with Words

Page 48: Lecture 5 - Agent communication

Speech Act TheoryAustin noticed that some utterances are like‘physical actions’ that appear to change the state of the worldParadigmatic examples would be:

Declaring war‘I now pronounce you man and wife’

But more generally, everything we utter is uttered with the intention of satisfying some goalA theory of how utterances are used to achieve intentions is a speech act theory

Page 49: Lecture 5 - Agent communication

Speech Acts

A speech act is an act of communicationSpeech does not imply any particular communication mediaThere are various types of speech actBy using the various types of speech act, agents can interact effectively

Page 50: Lecture 5 - Agent communication

Types of speech act

inform other agents about some dataquery others about their current situationanswer questionsrequest others to actpromise to do something offer dealsacknowledge offers and requests…

Page 51: Lecture 5 - Agent communication

Speech acts types – Searle (I)

RepresentativeCommunicate some state of affairs

Informing, asserting, claiming, describing, …

CommissiveCommit the speaker to some future course of action

Promising, agreeing, threatening, inviting, offering, swearing, volunteering, ...

Page 52: Lecture 5 - Agent communication

Speech acts types – Searle (II)

DirectiveIntention to get the receiver to carry out some action

Requesting, commanding, daring, asking, begging, forbidding, advising, ...

DeclarationBring about a state of affairs

Arresting, marrying, declaring, ...Expressive

Indicate the speaker’s psychological state or mental attitude

Thanking, greeting, congratulating, apologizing, ...

Page 53: Lecture 5 - Agent communication

Speech Act components

In general, a speech act can be seen to have two components:

a performative verb:(e.g., request, inform, promise, … )propositional content:(e.g., “the door is closed”)

Page 54: Lecture 5 - Agent communication

Communicative ActsIs the door open?

Open the door (for me)

OK! I’ll open the door

The door is open

I am unable to open the door

I don’t want to open the door

Tell me when the door becomes open

Does anyone want to open the door?

I can open the door for you... at a price

Door? What’s that? Don’t understand...

query

request

agree

inform

failure

refuse

subscribe

cfp

propose

not-understood

Same content of the message, different meanings (depending on the used performative)

Page 55: Lecture 5 - Agent communication

Conversations

Speech acts are rarely carried out in isolationSpeech acts must be considered in terms of the other speech acts of the conversationSpeech acts therefore can have different meanings based on the previous discourseEstablishing meaning is thus more than understanding individual utterances

Page 56: Lecture 5 - Agent communication

Communication Standards

Agents must understand each other even if running on different machines and/or different operating systemsStandards

allow different groups to write cooperating agentshelp abstract out communication, by defining high-level general languages and protocols

Page 57: Lecture 5 - Agent communication

FIPA

Foundation for Intelligent Physical AgentsBeginning (1996): stand-alone non-profit organisationNow: IEEE Computer Society standards committeeMission: develop and promote agent standards

MAS architectureAgent communication language (FIPA-ACL)Communication protocols

Page 58: Lecture 5 - Agent communication

(inform:sender agent1:receiverhpl-auction-server:content

(price (bid good02) 150):in-reply-to round-4:reply-withbid04:language sl:ontology hpl-auction

)

Begin message structure

Communicative act type

Message parameters

ACL message

Message content expression

Parameter expression

Components of a FIPA-ACL message

Page 59: Lecture 5 - Agent communication

Parameters in a FIPA ACL message

:sender - who sends the message:receiver - who is the recipient of the message:content - content of the message:reply-with - identifier of the message:reply-by - deadline for replying the message :in-reply-to - identifier of the message being replied:language – language in which the content is written:ontology - ontology used to represent the domain concepts:protocol - communication protocol to be followed :conversation-id - identifier of conversation

Page 60: Lecture 5 - Agent communication

FIPA-ACL performatives

Page 61: Lecture 5 - Agent communication

InformContent: statementThe sender informs the receiver that a given proposition is trueThe sending agent:

holds that some proposition is trueintends that the receiving agent also comes to believe that the proposition is truedoes not already believe that the receiver has any knowledge of the truth of the proposition

Page 62: Lecture 5 - Agent communication

Inform example

(inform:sender (agent-identifier :name i):receiver (agent-identifier :name j):content ”door( now, open )":language Prolog)

)

Page 63: Lecture 5 - Agent communication

RequestContent: actionThe sender requests the receiver to perform some actionThe sending agent:

intends the action content to be performedbelieves recipient is capable of performing this actiondoes not believe that receiver already intends to perform action

Page 64: Lecture 5 - Agent communication

Request example

(request

:sender (agent-identifier :name i)

:receiver (agent-identifier :name j)

:content (action (agent-identifier :name j) open_the_door)

:language fipa-sl

)

Page 65: Lecture 5 - Agent communication

Communication protocols

There are many situations in which agents engaged in a dialogue with a certain purpose exchange the same sequence of messages

When an agent makes a question to anotherWhen an agent requests a service from anotherWhen an agent looks for help from other agents

To ease the management of this typical message interchanges we can use predefined protocols

Page 66: Lecture 5 - Agent communication

FIPA-Request protocol

Page 67: Lecture 5 - Agent communication

FIPA-Query protocol

Page 68: Lecture 5 - Agent communication

FIPA- Contract

Net

protocol

Page 69: Lecture 5 - Agent communication

FIPA Contract Net

Agent

agent agent

agent

agent

1) cfp

1) cfp

1) cfp

1) cfp

2) propose

3) propose

4) propose

5) accept-proposal5) reject-proposal

5) reject-proposal

6) inform

agent

agent

agent

Page 70: Lecture 5 - Agent communication

Readings for this week

FIPA web page http://www.fipa.orgFIPA specifications