Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

1 1 Introduction to JADE presenter: Ji-Yu Li

2 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.5 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

3 3 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.5 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

4 4 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 management Agent communication language (ACL) Integration agent and other computer software http://www.fipa.org/ A software agent A piece of software that acts for a user or other program in a relationship of agency

5 5 FIPA (Foundation for Intelligent Physical Agents)

6 6 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.5 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

7 7 JADE JADE (Java Agent Development Framework) Framework aimed at developing multi-agent systems and applications conforming to FIPA standards for intelligent agents.

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

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

10 10 JADE 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

11 11

12 12 Containers and Platforms

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

14 14 Containers and Platforms The set of active containers is called a Platform.

15 15 Containers 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.

16 16 JADE

17 17 JADE Main container

18 18 JADE 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.

19 19 Agent Management System (AMS)

20 20 Agent Management System Provides the naming service Ensures that each agent in the platform has a unique name Represents the authority in the platform To create/kill agents on remote containers by requesting that to the AMS

21 21 Directory Facilitator

22 22 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.

23 23 DF Agent

24 24 Remote Monitoring Agent Provide the GUI to control agents’ lifecycle

25 25 Message Transport System Agent Communication Channel (ACC) Agent to Agent Agent Platform to Agent Platform

26 26 JADE

27 27 JADE Agent identifier @ nickname platform_name

28 28 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.5 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

29 29 Install 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

30 30 Install JDK 1.5 -- step 1 downloads Web Site

31 31 Install JDK 1.5 -- step 2 Select Java SE

32 32 Install JDK 1.5 -- step 3 Download

33 33 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.5 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

34 34 JADE http://jade.tilab.com/

35 35 JADE Package JADE-doc Document JADE-src Source Code JADE-bin Binary Code JADE-example Example Code

36 36 Download eclipse Eclipse - an open development platform Eclipse 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/

37 37 Download eclipse

38 38 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.5 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

39 39

40 40

41 41

42 42

43 43

44 44

45 45

46 46 jade.Boot 1 2 3

47 47 -gui 1 2 3

48 48

49 49 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.5 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

50 50 Implementation 1.Import jade.core.Agent Library 2.setup() 初始化 agent ,向 AMS 註冊,此時狀態為 ACTIVE 3.addBehaviour() 加入 behaviours 到排程佇列,傳入的參 數為一個 Behaviour class 4.action() 定義 behaviour 中的行為 5.doDelete() 結束此 agent

51 51 Implementation 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(); }

52 52

53 53

54 54

55 55 -container -host :

56 56

57 57 End

58 58 Introduction to Agent presenter: Ji-Yu Li

59 59 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

60 60 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.

61 61 Behaviour class WakerBehaviour This abstract class implements a one-shot task that must be executed only once just after a given timeout is elapsed. class TickerBehaviour This abstract class implements a cyclic task that must be executed periodically.

62 62

63 63 Implementation OneShotBehaviour agent 只會執行一次 CyclicBehaviour agent 的會以輪詢的方式來執行 import jade.core.behaviours.OneShotBehaviour import jade.core.behaviours.CyclicBehaviour

64 64

65 65 SimpleBehaviour class SimpleBehaviour class 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 CyclicBehaviour This abstract class models atomic behaviours that must be executed forever. So its done() method always returns false.

66 66 CompositeBehaviour class CompositeBehaviour class SequentialBehaviour This class is a CompositeBehaviour that executes its sub- behaviours sequentially and terminates when all sub- behaviours are done. class ParallelBehaviour This class is a CompositeBehaviour that executes its sub- behaviours concurrently and terminates when a particular condition on its sub-behaviours is met. class FSMBehaviour This class is a CompositeBehaviour that executes its children according to a Finite State Machine defined by the user.

67 67 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

68 68 Agent Communication

69 69 Agent Communication sender of the message list of receivers communicative intention (or “performative”) content content language ontology some fields

70 70 Agent Communication Receiving Messages

71 71 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

72 72 Example 寫兩支 Agent 於 JADE 上 : SenderAgent OneShotBehaviour 用 ACLMessage 傳送字串給 ReceiverAgent ReceiverAgent CyclicBehaviour 接收由 SenderAgent 傳送之字串並印出

73 73 Example

74 74 Sender

75 75 Receiver

76 76 Exmaple

77 77 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

78 78 Sniffer

79 79 Sniffer

80 80 Sniffer

81 81 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

82 82 Example 2 寫三支 agent Sender 送給 HelloAgent 字 串 ”Hello” , HelloAgent 會在執 行畫面上印出 sender 的名稱並 回傳 Hi 接著 SenderAgent 再傳送數字 給 MathAgent , MathAgen 收 到後再回傳從 1 加到該數字的 總和,並在 SenderAgent 端執 行畫面印出。

83 83 Arguments

84 84 SenderAgent

85 85 SenderAgent

86 86 SenderAgent

87 87 HelloAgent 寫三支 agent Sender 送給 HelloAgent 字 串 ”Hello” , HelloAgent 會在執 行畫面上印出 sender 的名稱並 回傳 Hi 接著 SenderAgent 再傳送數字 給 MathAgent , MathAgen 收 到後再回傳從 1 加到該數字的 總和,並在 SenderAgent 端執 行畫面印出。

88 88 HelloAgent

89 89 MathAgent 寫三支 agent Sender 送給 HelloAgent 字 串 ”Hello” , HelloAgent 會在執 行畫面上印出 sender 的名稱並 回傳 Hi 接著 SenderAgent 再傳送數字 給 MathAgent , MathAgen 收 到後再回傳從 1 加到該數字的 總和,並在 SenderAgent 端執 行畫面印出。 ※一樣要 do sniffer 觀察這三支 agent

90 90 MathAgent

91 91 Results SenderAgent HelloAgent MathAgent

92 92 Results

93 93 Sniffer Agent

94 94 Homework 寫兩支 Agent 互相溝通 (a) 輸入地點,查詢今日天氣預報 (b) 猜數字遊戲

95 95 End


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

Similar presentations


Ads by Google