h 4 1 Agent- oriented methodology 2 Technological challenge - - PowerPoint PPT Presentation

h 4
SMART_READER_LITE
LIVE PREVIEW

h 4 1 Agent- oriented methodology 2 Technological challenge - - PowerPoint PPT Presentation

Software agent computing 2 nd laboratory activities at Warsaw University of Technology Maciej Gawinecki Systems Research Institute, Polish Academy of Sciences maciej.gawinecki@ibspan.waw.pl http://www.ibspan.waw.pl/~gawinec h 4 1


slide-1
SLIDE 1

1

Maciej Gawinecki

Systems Research Institute, Polish Academy of Sciences maciej.gawinecki@ibspan.waw.pl http://www.ibspan.waw.pl/~gawinec

Software agent computing

2nd laboratory activities at Warsaw University of Technology

4 h

slide-2
SLIDE 2

2

Agent-

  • riented

methodology

slide-3
SLIDE 3

3

Technological challenge

Chris Preist

HP Laboratories Bristol, UK

et al. say*

* M. Luck, P. McBurney, Ch. Preist (2003). Agent technology: Enabling next generation computing: A roadmap for agent-based computing. AgentLink report., http://www.ecs.soton.ac.uk/~mml/papers/al2roadmap.pdf

“One of the most fundamental obstacles to large-scale take-up of agent technology is the lack of mature software development methodologies for agent-based systems.”

Methodology for software development is intended to: ✔ discipline software development by defining set of guidelines for covering the whole lifecycle of system development ✔ define the abstraction for modelling software (object-oriented, agent-oriented, data-oriented, knowledge-based etc.)

slide-4
SLIDE 4

4

Ask Kate Slezavina,

Project #3: Designing eLearning environment with

three different agent-oriented methodologies

Exisiting methodologies

■ Exisiting methodologies

 MaSE

Scott A. DeLoach, Mark F. Wood and Clint H. Sparkman, “Multiagent Systems Engineering”, The International Journal of Software Engineering and Knowledge Engineering, Volume 11 no. 3, June 2001, http://www.cis.ksu.edu/~sdeloach/publications/Journal/MaSE%20-%20IJSEKE.pdf

 Tropos

Perini, P. Bresciani, F. Giunchiglia, P. Giorgini, and J. Mylopoulos. “A knowledge level software engineering methodology for agent oriented programming”. Autonomous Agents, Montreal CA, May 2001, http://www.auml.org/auml/supplements/Bresciani-Agents2001.pdf

 JADE-oriented

Magid Nikraz1a, Giovanni Caireb, Parisa A. Bahri (2006), "A Methodology for the Analysis and Design of Multi-Agent Systems using JADE", http://jade.tilab.com/doc/JADE_methodology_website_version.pdf

 Other: Gaia, Prometheus – described on 1st lecture!

■ Comparision:which one is better ?

Onn Shehory, Arnon Sturm, Methodologies for Agent-Oriented Software Engineering, Presentation from EASSS 2006, Annecy, France.

➔ I've got copy for you :-) ➔ See links there

✔See ✔1st Lecture ✔for details.
slide-5
SLIDE 5

5

Software development lifecycle

■ Planning ■ Analysis ■ Design ■ Implementation ■ Testing

I propose methodology based on

✔ JADE-oriented methodology ✔ Prometheus methodology ✔ own experience

slide-6
SLIDE 6

6

Planning phase

PLANNING PHASE

slide-7
SLIDE 7

7

Planning phase

Is an agent-based approach the best alternative ?

Existing agent-based solutions Piftalls Existing traditional solutions

Use another technique! [No]

Methodologies

Not formally addressed Go on! [Yes] PLANNING PHASE

slide-8
SLIDE 8

8

Philosophy of agent modelling

 Agents mainly should be used for modelling

✔ Decentralized nature of a problem ✔ Many points of control ✔ Various perspectives ✔ Competitive tasks

*Nicholas R. Jennings. An agent-based approach for building complex software

  • systems. Commun. ACM, 44(4):35–41, 2001.
  • Prof. Nick Jennings

School of Electronics & Computer Science University of Southampton, UK

says*

PLANNING PHASE

slide-9
SLIDE 9

9

Examples and contr-example

✔ Air Traffic Manament System,

 tested at Sydney airport

✔ Flexible Manufacturing System

 developed and used by DaimlerChrysler

PLANNING PHASE

✗ Travel Support System,

slide-10
SLIDE 10

1

Example 1: Flexible Manufacturing System

PLANNING PHASE

slide-11
SLIDE 11

1 1

Traditional manufacturing line

✗ Mała zdolność do adaptacji

każda zmiana produktu to kosztowna rekonstrukcja linii produkcyjnej

✗ Brak elastyczności

uszkodzenie pojedynczej maszyny to blokada całej linii produkcyjnej

Problem Sytuacja

✔ różne maszyny realizują różne etapy

produkcyjne

✔ przesuwacze dostarczają maszynom produkty

z taśmy

Machine2 Machine1 Machine3

Przesuwacz Przesuwacz Przesuwacz Przesuwacz

PLANNING PHASE

slide-12
SLIDE 12

1 2

Making the system flexible

Machine2 Machine1

Przesuwacz Przesuwacz Przesuwacz Przesuwacz

Machine3

Machine Agent

* S. Bussmann and K. Schild (2004). An Agent-based Approach to the Control of Flexible Production Systems

Machine Agent Switch Agent Product Agent Switch Agent Product Agent Machine Agent

DaimlerChrysler: Agent-based Manufacturing Control System*

✔ Lokalni agenci

każdy element systemu kontroluje oddzielny agent

✔ Koordynacja

agenci koordynuują działania między sobą

✔ Negocjacje zmniejszają obciążenie

ProductAgent ogłasza aukcję, MachineAgenci składają propozycje – wygrywa maszyna o (przede wszystkim) najmniejszym aktualnym

  • bciążeniu

✔ Rozmowy bilateralne rozwiązują deadlock

rozmowy między ProductAgent a SwitchAgent pozwalają przemieszczać produkty w kierunku pożądanych maszyn z pomięciem zablokowanych maszyn Zysk

✔ Zwiększona wydajność (10%) ✔ Elastyczność: szybka reakcja na lokalne problemy typu bottleneck

PLANNING PHASE

slide-13
SLIDE 13

1 3

Q u e s t i

  • n

s ? ?

PLANNING PHASE

slide-14
SLIDE 14

1 4

Example 2: “OASIS” Air Traffic Manament System

PLANNING PHASE

slide-15
SLIDE 15

1 5

Aim of project

■ Aim: Design an air traffic manament system which:

✔ Calculates expected time of arrival (ETA) of aircraft ✔ Sequences them in respect to optimality criteria ✔ Issuing control directives to the pilots to achieve assigned ETAs ✔ Monitor conformance

PLANNING PHASE

slide-16
SLIDE 16

1 6

Domain characteristics

■ Environment can evolve in nondeterministic way:

 wind field can change  operating conditions can change  runway conditions can change  presence of other aircraft can change, etc.

■ System can act in nondeterministic way:

 system can take a number of different actions:

➔ Requesting an aircraft change speed ➔ Strech / shorten / hold a flight path, etc.

■ PLANNING PHASE

slide-17
SLIDE 17

1 7

Q u e s t i

  • n

s ? ?

PLANNING PHASE

slide-18
SLIDE 18

1 8

Other examples

Ask Paweł Olesiuk,

Project #8: Modelling logistic company with

holonic multi-agent system Ask Andrzej Borowczyk,

Project #9: BDI agents in erderly people

hospitalization

PLANNING PHASE

slide-19
SLIDE 19

1 9

Contr-example: Travel Support System

PLANNING PHASE

slide-20
SLIDE 20

2

Inspiration for system

“Hungry foreign tourist arrives to an unknown city and seeks a nice restaurant serving cuisine that she

  • likes. Internet, contacted for advice about

restaurants in the neighborhood, recommends mainly establishments serving steaks, not knowing that the tourist is a fanatic vegetarian.”

■ Paradigmatic case of agent system design and implementation

PLANNING PHASE

✔See ✔1st Lecture ✔for details.
slide-21
SLIDE 21

2 1

Bird-flight perspective

PLANNING PHASE

slide-22
SLIDE 22

2 2

Pitfall of agentifying all

  • Prof. Michael Wooldridge

Department of Computer Science University of Liverpool Liverpool, UK

  • Prof. Marcin Paprzycki

Systems Research Institute Polish Academy of Sciences Warsaw, Poland

“Decompose all functionalities as agents! Agentify all! If something is not an agent (e.g. expert system, database, etc.) it will be wrapped in an agent or interfaced via an agent.”*

E X P E R I M E N T !

“You see agents everywhere! It'ss a pitfall.”* PLANNING PHASE

* Wooldridge, M., Jennings, N.R.: “Pitfalls of Agent-Oriented Development”. In Sycara, K.P., Wooldridge, M., eds.: Proceedings of the 2nd International Conference on Autonomous Agents (Agents’98), New York, ACM Press (1998) 385–391 * Maciej Gawinecki, Mateusz Kruszyk, Marcin Paprzycki, Maria Ganzha (2007) “Pitfall of agent system development o the basis of a Travel Support System”. Proceedings of the BIS Conference (to appear)

slide-23
SLIDE 23

2 3

MVC pattern – theory

PLANNING PHASE

slide-24
SLIDE 24

2 4

MVC pattern – adaptation

PLANNING PHASE

Ask Edilbek Slanor,

Project #6: Agent as data provider in

Content Management System

SHA – Session Handling Agent, PrA – Proxy Agent, VTA – View Transforming Agent, PA – Personal Agent

slide-25
SLIDE 25

2 5

Why not agents ?

■ Characteristics of MVC + HTTP:

 stateless – each user request is independent to others,  reactive – MVC components react only to external

requests,

 synchronous – process of realizing a single user request is

a sequence of steps, where each next step cannot be realized until the previous one has been finished,

 parallel, but not concurrent – parallelism is utilized to

decrease interleaving in I/O operations.

■ But... agents are:

 proactive,  statefull,  concurrent,  use asynchronous communication.

PLANNING PHASE

slide-26
SLIDE 26

2 6

General guideline

■ Modelling a part of the system with higher

abstraction than naturally necessary, results in difficulties of verifying and reasoning about such solution (i.e. the simpler the model the easier it is to think about it, to verify its correctness and to remove errors).*

PLANNING PHASE

Use simpler traditional approaches if possible!

* Maciej Gawinecki, Mateusz Kruszyk, Marcin Paprzycki, Maria Ganzha (2007) “Pitfall of agent system development o the basis of a Travel Support System”. Proceedings of the BIS Conference (to appear)

slide-27
SLIDE 27

2 7

Q u e s t i

  • n

s ? ?

PLANNING PHASE

slide-28
SLIDE 28

2 8

Example for modelling E-Commerce Agent Platform

PLANNING PHASE

slide-29
SLIDE 29

2 9

E-CAP team

Costin Badica

PLANNING PHASE

slide-30
SLIDE 30

3

ANALYSIS PHASE

Analysis Phase

slide-31
SLIDE 31

3 1

Analysis aim and steps

■ Aim

 Clarify the problem  Avoid concerning about the solution

■ Steps

 Defining system scenarios and use cases  Identifying roles and their responsibilies  Identifying roles acquaintance  Matching agents with roles  Deploying agents over platforms and hosts

ANALYSIS PHASE

slide-32
SLIDE 32

3 2

Main scenario in E-CAP

  • 1. The Client chooses a Shop to negotiate at.
  • 2. The Shop registers the Client for negotiation.
  • 3. Negotiations.
  • 4. The Shop reserves a product for the Client.
  • 5. The Client confirmes/cancels the reservation.
  • 6. Sale finilization:

(a) the Client pays for the product to the Shop, (b) the Shop delivers the product to the Client. ANALYSIS PHASE

slide-33
SLIDE 33

3 3

Identifying roles and responsibilies

slide-34
SLIDE 34

3 4

E-CAP general use-case diagram

ANALYSIS PHASE

slide-35
SLIDE 35

3 5

E-CAP detailed use-case diagram

ANALYSIS PHASE

slide-36
SLIDE 36

3 6

Deploying agents over platforms

■ Physical hosts/platforms are indicated for particular

agents

■ Factors to consider:

 agents belonging to competitive or politically conflicted

  • wners go to different platforms (security reasons)

 communication efficiency  inter-platform communication  inter-platform mobility

ANALYSIS PHASE

slide-37
SLIDE 37

3 7

Deployment diagram

Maria's Agent Platform Marcin's Agent Platform Paweł's Agent Platform

BuyerAgent GatewayAgent BuyerAgent

migrating creatjng created registrating

ShopAgent SellerAgent GatewayAgent BuyerAgent

finilizing transaction creating negotiating delegating negotiating Costin's Agent Platform

ClientAgent ClientAgent

Created, after migration

BuyerAgent

E-Commerce Agent Platform*

ShopAgent

ANALYSIS PHASE

slide-38
SLIDE 38

3 8

DESIGN PHASE

Design Phase

slide-39
SLIDE 39

3 9

Analysis aim and steps

■ Aim

 Clarify the problem  Avoid concerning the about solution

■ Steps

 Defining system scenarios and use cases  Identifying roles and their responsibilies  Identifying roles acquaintance  Matching agents with roles  Deploying agents over platforms and hosts

DESIGN PHASE

slide-40
SLIDE 40

4

Implementation Phase

IMPLEMENTING PHASE

slide-41
SLIDE 41

4 1

Analysis aim and steps

■ Aim

 Clarify the problem  Avoid concerning the about solution

■ Steps

 Defining system scenarios and use cases  Identifying roles and their responsibilies  Identifying roles acquaintance  Matching agents with roles  Deploying agents over platforms and hosts

IMPLEMENTING PHASE

slide-42
SLIDE 42

4 2

Perspectives in MAS

■ External (inter-agent) perspective

 Cooperation and competitiveness  Communication  Interaction protocols  Communication ontologies

■ Internal (intra-agent) perspective

 Behaviours  Knowledge  Handling with messages

IMPLEMENTING PHASE IMPLEMENTING PHASE IMPLEMENTING PHASE IMPLEMENTING PHASE

Perspectives in MAS

slide-43
SLIDE 43

4 3

Translating Interaction Protocols into FSMBehaviour

IMPLEMENTING PHASE IMPLEMENTING PHASE IMPLEMENTING PHASE

slide-44
SLIDE 44

4 4

Interaction protocols

■ Having a standard set of types of messages (INFORM,

REQUEST, PROPOSE ....) allows specifying predefined sequences of messages exchanged by agents during a conversations.

■ These are known as Interaction Protocols

IMPLEMENTING PHASE IMPLEMENTING PHASE

slide-45
SLIDE 45

4 5

FIPA Propose Interaction Protocol

FIPA Propose Interaction Protocol Specification, http://www.fipa.org/specs/fipa00036/

 Description:

Initiator propose to do an action, if Participant will accept the proposal.

 Exception:

Participant can inform Initiator that it did not understand what was communicated. IMPLEMENTING PHASE

slide-46
SLIDE 46

4 6

Support for interaction protocols

■ The jade.proto package contains behaviours for both the Initiator and

Responder role in the most common interaction protocols:

 FIPA-Request (AchieveREInitiator/Responder)  FIPA-Contract-Net (ContractNetInitiator/Responder)  FIPA-Subscribe (SubscriptionInitiator/Responder)  FIPA-Propose (ProposeInitiator/Responder)

■ All these classes automatically handle

 the flow of messages checking that it is compliant to the protocol  The timeouts (if any)

■ They provide callback methods that should be redefined to take the

necessary actions when e.g. a message is received or a timeout expires. IMPLEMENTING PHASE

slide-47
SLIDE 47

4 7

Propose Participant states

IMPLEMENTING PHASE

slide-48
SLIDE 48

4 8

Propose Participant implementation

public class ProposeResponder extends FSMBehaviour implements FIPANames.InteractionProtocol { ... // Register the FSM transitions registerDefaultTransition(RECEIVE_PROPOSE, PREPARE_RESPONSE); registerDefaultTransition(PREPARE_RESPONSE, SEND_RESPONSE); registerDefaultTransition(SEND_RESPONSE, RECEIVE_PROPOSE); // Create and register the states that make up the FSM Behaviour b = null; // RECEIVE_PROPOSE rec = new MsgReceiver(myAgent, mt, -1, getDataStore(), PROPOSE_KEY); registerFirstState(rec, RECEIVE_PROPOSE); // PREPARE_RESPONSE b = new PrepareResponse(myAgent); b.setDataStore(getDataStore()); registerState(b, PREPARE_RESPONSE); // SEND_RESPONSE b = new ReplySender(myAgent, RESPONSE_KEY, PROPOSE_KEY); b.setDataStore(getDataStore()); registerState(b, SEND_RESPONSE);

➢ Code: jade.proto.ProposeResponder

IMPLEMENTING PHASE

slide-49
SLIDE 49

4 9

Propose Initiator states

IMPLEMENTING PHASE

slide-50
SLIDE 50

5

Propose Initiator implementation

public class ProposeInitiator extends FSMBehaviour { ... // Register the FSM transitions registerDefaultTransition(PREPARE_INITIATIONS, SEND_INITIATIONS); registerTransition(SEND_INITIATIONS, DUMMY_FINAL, 0); registerDefaultTransition(SEND_INITIATIONS, RECEIVE_REPLY); registerTransition(RECEIVE_REPLY, CHECK_SESSIONS, MsgReceiver.TIMEOUT_EXPIRED); registerTransition(RECEIVE_REPLY, CHECK_SESSIONS, MsgReceiver.INTERRUPTED); registerDefaultTransition(RECEIVE_REPLY, CHECK_IN_SEQ); registerTransition(CHECK_IN_SEQ, HANDLE_NOT_UNDERSTOOD, ACLMessage.NOT_UNDERSTOOD); registerTransition(CHECK_IN_SEQ, HANDLE_REJECT_PROPOSAL, ACLMessage.REJECT_PROPOSAL); registerTransition(CHECK_IN_SEQ, HANDLE_ACCEPT_PROPOSAL, ACLMessage.ACCEPT_PROPOSAL); registerDefaultTransition(CHECK_IN_SEQ, HANDLE_OUT_OF_SEQ); registerDefaultTransition(HANDLE_NOT_UNDERSTOOD, CHECK_SESSIONS); registerDefaultTransition(HANDLE_REJECT_PROPOSAL, CHECK_SESSIONS); registerDefaultTransition(HANDLE_ACCEPT_PROPOSAL, CHECK_SESSIONS); registerDefaultTransition(HANDLE_OUT_OF_SEQ, RECEIVE_REPLY); registerDefaultTransition(CHECK_SESSIONS, RECEIVE_REPLY, toBeReset); registerTransition(CHECK_SESSIONS, HANDLE_ALL_RESPONSES, ALL_RESPONSES_RECEIVED); registerTransition(CHECK_SESSIONS, DUMMY_FINAL, TERMINATED); registerDefaultTransition(HANDLE_ALL_RESPONSES, CHECK_AGAIN); registerTransition(CHECK_AGAIN, DUMMY_FINAL, 0); registerDefaultTransition(CHECK_AGAIN, RECEIVE_REPLY, toBeReset); ... registerFirstState(b, PREPARE_INITIATIONS); ... registerLastState(b, DUMMY_FINAL);

➢ Code: jade.proto.ProposeIntiator

IMPLEMENTING PHASE

slide-51
SLIDE 51

5 1

Documentation

■ Chapter 3.5 in the Programmers guide included in the JADE

distribution provides a detailed explanation of the interaction protocol support

■ API documentation (javadoc): jade.proto package ■ Sample code: examples.protocols package in the examples

included in the JADE distribution. IMPLEMENTING PHASE

slide-52
SLIDE 52

5 2

Q u e s t i

  • n

s ? ?

IMPLEMENTING PHASE

slide-53
SLIDE 53

5 3

Tools for testing phase

TESTING PHASE

slide-54
SLIDE 54

5 4

Debugging communication

 DummyAgent

 interacting with JADE agents  sending ACL messages  maintains a list of ACL messages sent and received

 Introspector

 monitoring and controlling the life-cycle of agent  monitoring agent's exchanged messages  monitoring the queue of behaviours (step-by-step execution)

 SnifferAgent

 tracking and displaying messages from/to sniffed an agents  saving tracked messages

✔See tutorial from

1st Laboratory

✔for details.

TESTING PHASE

slide-55
SLIDE 55

5 5

Logging

■ Type of error information and its narrow context are usually sufficient

to find the reason of the error and eliminate it in the source code.

■ Traditional solutions for Java:

 Java Logging API (JSR47), comes with the JRE,

http://java.sun.com/

 log4j, http://logging.apache.org/log4j/

■ Agent-oriented solutions for JADE:

 JADE Logging service, http://jade.tilab.com ➔ JSR47-based  LoggerAgent environment, http://jadex.sourcefoge.net/ ➔ Part of JADEX project, ➔ JSR47-based  Log4JADE (experimental), http://log4jade.sourceforge.net/ ➔ log4j-based

■ Comparision of different approaches can be found in

 Maciej Gawinecki, “Agent-based logging system," in: Proceedings

  • f the 18th Mountain Summer School of Polish Information

Processing Society. Szczyrk, Poland. 2006. TESTING PHASE

slide-56
SLIDE 56

5 6

Testing suites

■ Traditional solution TESTING PHASE

slide-57
SLIDE 57

5 7

TESTING PHASE

slide-58
SLIDE 58

5 8

Q u e s t i

  • n

s ? ?

TESTING PHASE

slide-59
SLIDE 59

5 9

slide-60
SLIDE 60

6

slide-61
SLIDE 61

6 1

Ask Michał Oglodek,

Project #5: Utilization of an agent and Web Service

as wrappers for existing legacy software

Agents and legacy software

slide-62
SLIDE 62

6 2

slide-63
SLIDE 63

6 3

Homework

■ Re-implement presented application by use of any of complex

behaviours (SequentialBehaviour, FSMBehaviour)

 Documentation ➔ examples.behaviours.ComplexBehaviourAgent,

examples.behaviours.FSMAgent classes in JADE package

➔ JADE Programmer’s Guide, http://jade.tilab.com

■ Think about agents modelling some phenomen from real world

Q u e s t i

  • n

s ? ?

slide-64
SLIDE 64

6 4

Acknowledgements

■ Mateusz Kruszyk for veryfing part of tutorial