94
1 Introduction to JADE presenter: Ji-Yu Li

1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

Embed Size (px)

Citation preview

Page 1: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

1

Introduction to JADE

presenter: Ji-Yu Li

Page 2: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

2

OutlineOutline

IntroductionFoundation for Intelligent Physical Agents (FIPA)

Java Agent Development Environment (JADE)

Running JADE PlatformInstall JDK 1.5

Install JADE Platform

Run JADE Platform

Run Agent on JADE Platform

Page 3: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

3

OutlineOutline

IntroductionFoundation for Intelligent Physical Agents (FIPA)

Java Agent Development Environment (JADE)

Running JADE PlatformInstall JDK 1.5

Install JADE Platform

Run JADE Platform

Run Agent on JADE Platform

Page 4: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

4

Foundation for Intelligent Physical Agents (FIPA)Foundation for Intelligent Physical Agents (FIPA)

IEEE Computer Society standards organization A body for developing and setting computer software standards for heterogeneous and interacting agents and agent-based systems. Agent managementAgent communication language (ACL)Integration agent and other computer softwarehttp://www.fipa.org/

A software agentA piece of software that acts for a user or other program in a relationship of agency

Page 5: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

6

OutlineOutline

IntroductionFoundation for Intelligent Physical Agents (FIPA)

Java Agent Development Environment (JADE)

Running JADE PlatformInstall JDK 1.5

Install JADE Platform

Run JADE Platform

Run Agent on JADE Platform

Page 6: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

7

JADEJADEJADE (Java Agent Development Framework)

Framework aimed at developing multi-agent systems and applications conforming to FIPA standards for intelligent agents.

Page 7: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

8

JADEJADEThe agent platform can be split among several hosts. Only one Java application(Main container) is executed on each host.

Page 8: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

9

JADEJADE

Support to the execution of multiple, parallel and concurrent agent activities via the behaviour model.

Page 9: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

10

JADE platformJADE platform

JADE is a middleware that facilitates the development of Multi Agent Peer-to-Peer applications.

Full Java

Runs on all JVM from J2EE to J2ME MIDP1.0

Downloadable from http://jade.tilab.com

Page 10: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

11 11

Page 11: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

12

Containers and PlatformsContainers and Platforms

Page 12: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

13

Containers and PlatformsContainers and Platforms

Each running instance of the JADE runtime environment is called a Container as it can contain several agents.

Page 13: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

14

Containers and PlatformsContainers and Platforms

The set of active containers is called a Platform.

Page 14: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

15

Containers and PlatformsContainers and Platforms

A single special Main container must always be active in a platform and all other containers register with it as soon as they start.

Page 15: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

16

JADEJADE

Page 16: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

17

JADEJADE

Main container

Page 17: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

18

JADEJADE

AMS (Agent Management System) Provides the naming service and represents the authority in the platform.

DF (Directory Facilitator) Provides a Yellow Pages service by means of which an agent can find other agents providing the services he requires in order to achieve his goals.

RMA(Remote Management Agent)Acting as graphical console for platform management and control.

Page 18: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

19

Agent Management System (AMS)Agent Management System (AMS)

Page 19: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

20

Agent Management SystemAgent Management System

Provides the naming serviceEnsures that each agent in the platform has a unique name

Represents the authority in the platformTo create/kill agents on remote containers by requesting that to the AMS

Page 20: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

21

Directory FacilitatorDirectory Facilitator

Page 21: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

22

Directory FacilitatorDirectory Facilitator

Provides a Yellow Pages service by means of which an agent can find other agents providing the services he requires in order to achieve his goals.

Page 22: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

23

DF AgentDF Agent

Page 23: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

24

Remote Monitoring AgentRemote Monitoring Agent

Provide the GUI to control agents’ lifecycle

Page 24: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

25

Message Transport SystemMessage Transport System

Agent Communication Channel (ACC)

Agent to Agent

Agent Platform to Agent Platform

Page 25: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

26

JADEJADE

Page 26: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

27

JADEJADE

Agent identifier <nickname>@<platform_name>

nickname platform_name

Page 27: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

28

OutlineOutline

IntroductionFoundation for Intelligent Physical Agents (FIPA)

Java Agent Development Environment (JADE)

Running JADE PlatformInstall JDK 1.5

Install JADE Platform

Run JADE Platform

Run Agent on JADE Platform

Page 28: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

29

Install JDK 1.5Install JDK 1.5

http://java.sun.com/ Download J2SE Development Kit (JDK) 1.5

The Java Runtime Environment (JRE)

Command-line development tools, such as compilers and debuggers, that are necessary or useful for developing applets and applications

Page 29: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

30 30

Install JDK 1.5 -- step 1Install JDK 1.5 -- step 1

downloads

Web Site

Page 30: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

31 31

Install JDK 1.5 -- step 2Install JDK 1.5 -- step 2

Select Java SE

Page 31: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

32 32

Install JDK 1.5 -- step 3Install JDK 1.5 -- step 3

Download

Page 32: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

33

OutlineOutline

IntroductionFoundation for Intelligent Physical Agents (FIPA)

Java Agent Development Environment (JADE)

Running JADE PlatformInstall JDK 1.5

Install JADE Platform

Run JADE Platform

Run Agent on JADE Platform

Page 33: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

34

JADEJADE

http://jade.tilab.com/

Page 34: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

35

JADE PackageJADE Package

•JADE-doc•Document

•JADE-src•Source Code

•JADE-bin•Binary Code

•JADE-example•Example Code

Page 35: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

36

Download eclipseDownload eclipse

Eclipse - an open development platformEclipse is an open source community whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle.

http://www.eclipse.org/downloads/

Page 36: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

37

Download eclipseDownload eclipse

Page 37: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

38

OutlineOutline

IntroductionFoundation for Intelligent Physical Agents (FIPA)

Java Agent Development Environment (JADE)

Running JADE PlatformInstall JDK 1.5

Install JADE Platform

Run JADE Platform

Run Agent on JADE Platform

Page 38: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

39

Page 39: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

40

Page 40: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

41

Page 41: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

42

Page 42: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

43

Page 43: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

44

Page 44: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

45

Page 45: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

46

jade.Boot

1

2

3

Page 46: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

47

-gui

1

2

3

Page 47: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

48

Page 48: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

49

OutlineOutline

IntroductionFoundation for Intelligent Physical Agents (FIPA)

Java Agent Development Environment (JADE)

Running JADE PlatformInstall JDK 1.5

Install JADE Platform

Run JADE Platform

Run Agent on JADE Platform

Page 49: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

50

ImplementationImplementation

1. Import jade.core.Agent Library

2. setup() 初始化 agent ,向 AMS 註冊,此時狀態為ACTIVE

3. addBehaviour() 加入 behaviours 到排程佇列,傳入的參數為一個 Behaviour class

4. action() 定義 behaviour 中的行為

5. doDelete() 結束此 agent

Page 50: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

51

ImplementationImplementation

import jade.core.Agent;import jade.core.behaviours.OneShotBehaviour;

public class HelloAgent extends Agent{ protected void setup() { addBehaviour(new InitBeha()); }

class InitBeha extends OneShotBehaviour { public void action() { System.out.println(“Hello!"); doDelete(); } }}

Page 51: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

52

Page 52: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

53

Page 53: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

54

Page 54: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

55

-container -host <IP> <agent_name>:<class_name>

Page 55: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

56

Page 56: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

57

End

Page 57: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

58

Introduction to Agent

presenter: Ji-Yu Li

Page 58: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

59

Outline Outline

Behaviour

Agent Communication

Example

Sniffer Agent

Example 2

Page 59: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

60

Behaviour Behaviour

The setup() method should add at least one behaviour to the agent.

Every JADE agent is compose of a single execution thread and all its tasks are modeled and can be implemented as Behaviour objects.

addBehavior(Behaviour) & removeBehaviour(Behaviour) allow to manage the ready tasks queue of an agent.

Page 60: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

61

Behaviour Behaviour

class WakerBehaviourThis abstract class implements a one-shot task that must be executed only once just after a given timeout is elapsed.

class TickerBehaviourThis abstract class implements a cyclic task that must be executed periodically.

Page 61: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

62 62

Page 62: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

63

ImplementationImplementation

OneShotBehaviouragent 只會執行一次

CyclicBehaviouragent 的會以輪詢的方式來執行

import jade.core.behaviours.OneShotBehaviour

import jade.core.behaviours.CyclicBehaviour

Page 63: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

64

Page 64: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

65

SimpleBehaviourSimpleBehaviour

class SimpleBehaviourclass OneShotBehaviour

This abstract class models atomic behaviours that must be executed only once and cannot be blocked. So, its done() method always returns true.

class CyclicBehaviourThis abstract class models atomic behaviours that must be executed forever. So its done() method always returns false.

Page 65: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

66

CompositeBehaviourCompositeBehaviour

class CompositeBehaviourclass SequentialBehaviour

This class is a CompositeBehaviour that executes its sub-behaviours sequentially and terminates when all sub-behaviours are done.

class ParallelBehaviourThis class is a CompositeBehaviour that executes its sub-behaviours concurrently and terminates when a particular condition on its sub-behaviours is met.

class FSMBehaviourThis class is a CompositeBehaviour that executes its children according to a Finite State Machine defined by the user.

Page 66: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

67

Outline Outline

Behaviour

Agent Communication

Example

Sniffer Agent

Example 2

Page 67: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

68

Agent CommunicationAgent Communication

Page 68: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

69

Agent CommunicationAgent Communication

sender of the message

list of receivers

communicative intention (or “performative”)

content

content language

ontology

some fields

Page 69: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

70

Agent CommunicationAgent Communication

Receiving Messages

Page 70: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

71

Outline Outline

Behaviour

Agent Communication

Example

Sniffer Agent

Example 2

Page 71: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

72

Example Example

寫兩支 Agent 於 JADE 上 :SenderAgent

OneShotBehaviour

用 ACLMessage 傳送字串給 ReceiverAgent

ReceiverAgentCyclicBehaviour

接收由 SenderAgent 傳送之字串並印出

Page 72: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

73

ExampleExample

Page 73: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

74

SenderSender

Page 74: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

75

ReceiverReceiver

Page 75: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

76

Exmaple Exmaple

Page 76: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

77

Outline Outline

Behaviour

Agent Communication

Example

Sniffer Agent

Example 2

Page 77: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

78

Sniffer Sniffer

Page 78: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

79

Sniffer Sniffer

Page 79: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

80

Sniffer Sniffer

Page 80: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

81

Outline Outline

Behaviour

Agent Communication

Example

Sniffer Agent

Example 2

Page 81: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

82

Example 2 Example 2

寫三支 agent

•Sender 送給 HelloAgent 字串” Hello” , HelloAgent 會在執行畫面上印出 sender 的名稱並回傳 Hi

•接著 SenderAgent 再傳送數字給 MathAgent , MathAgen 收到後再回傳從 1加到該數字的總和,並在SenderAgent 端執行畫面印出。

Page 82: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

83

Arguments Arguments

Page 83: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

84

SenderAgent SenderAgent

Page 84: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

85

SenderAgent SenderAgent

Page 85: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

86

SenderAgentSenderAgent

Page 86: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

87

HelloAgent HelloAgent

寫三支 agent

•Sender 送給 HelloAgent 字串” Hello” , HelloAgent 會在執行畫面上印出 sender 的名稱並回傳 Hi

•接著 SenderAgent 再傳送數字給 MathAgent , MathAgen 收到後再回傳從 1加到該數字的總和,並在SenderAgent 端執行畫面印出。

Page 87: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

88

HelloAgentHelloAgent

Page 88: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

89

MathAgent MathAgent

寫三支 agent

•Sender 送給 HelloAgent 字串” Hello” , HelloAgent 會在執行畫面上印出 sender 的名稱並回傳 Hi

•接著 SenderAgent 再傳送數字給 MathAgent , MathAgen 收到後再回傳從 1加到該數字的總和,並在SenderAgent 端執行畫面印出。

※一樣要 do sniffer 觀察這三支 agent

Page 89: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

90

MathAgentMathAgent

Page 90: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

91

Results Results

SenderAgent

HelloAgent

MathAgent

Page 91: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

92

ResultsResults

Page 92: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

93

Sniffer AgentSniffer Agent

Page 93: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

94

HomeworkHomework

寫兩支 Agent 互相溝通

(a) 輸入地點,查詢今日天氣預報

(b) 猜數字遊戲

Page 94: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment

95

End