Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to JADE presenter: Syuan-Hao Li

Similar presentations


Presentation on theme: "Introduction to JADE presenter: Syuan-Hao Li"— Presentation transcript:

1 Introduction to JADE presenter: Syuan-Hao Li

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

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

4 Java Virtual Machine An abstract computing machine.
The JVM knows nothing of the Java PL, only of a particular binary format, the class file format. A class file contains JVM instructions (or byte codes) and a symbol table, as well as other ancillary information.

5 Java Byte Codes Rather than generating an executable machine instructions, a Java compiler outputs what are known as Java byte codes. Java byte codes are instructions written for a Java Virtual Machine that does not really exist. Java interpreter executes the byte code by emulating the JVM on whatever platform you happen to be using.

6 Comparison Java Virtual Machine

7 Must be the same to the file name
Example HelloWorld.java import javax.swing.JOptionPane; public class HelloWorld { public static void Print() JOptionPane.showMessageDialog(null, "Hello! World!"); } public static void main(String[] args) System.out.println("Hello! World!"); Print(); Import library Must be the same to the file name Entry point

8 Homework Write a java program Reference
Query the information of a web site (ex. Stock, Weather forecast ) by user input. Reference Java API Docs 良葛格 java 學習筆記

9 Outline Introduction Running JADE Platform Java Virtual Machine
Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.6 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

10 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 A software agent A piece of software that acts for a user or other program in a relationship of agency

11 Outline Introduction Running JADE Platform Java Virtual Machine
Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.6 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

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

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

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

15 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

16

17 Containers and Platforms

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

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

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

21 JADE

22 JADE Main container

23 JADE AMS (Agent Management System) DF (Directory Facilitator)
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.

24 Agent Management System (AMS)

25 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

26 Directory Facilitator

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

28 DF Agent

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

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

31 JADE

32 JADE Agent identifier <nickname>@<platform_name> nickname

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

34 Install JDK 1.6 http://java.sun.com/
Download J2SE Development Kit (JDK) 1.6 The Java Runtime Environment (JRE) Command-line development tools, such as compilers and debuggers, that are necessary or useful for developing applets and applications

35 Install JDK step 1 Web Site downloads

36 Install JDK step 2 Download

37 Install JDK step 3 Your platform 37

38 Install JDK step 4 Download 38

39 Outline Introduction Running JADE Platform Java Virtual Machine
Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.6 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

40 JADE

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

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

43 Download eclipse

44 Outline Introduction Running JADE Platform Java Virtual Machine
Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.6 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

45

46

47

48

49

50

51

52 2 1 3 jade.Boot

53 1 -gui 2 3

54

55 1 -help 2 3

56 Arguments Options -host <host name> -port <port number>
Host where RMI registry for the platform is located -port <port number> The port where RMI registry for the platform resides -container If specified, a new Agent Container is added to an existing platform. Otherwise a new Agent Platform is created -conf Shows the gui to set the configuration properties to start JADE. -gui If specified, a new Remote Management Agent is created. -version If specified, current JADE version number and build date is printed.

57 Outline Introduction Running JADE Platform Java Virtual Machine
Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE) Running JADE Platform Install JDK 1.6 Install JADE Platform Run JADE Platform Run Agent on JADE Platform

58 Implementation Import jade.core.Agent Library
setup() Initialize and register this agent to AMS, the current state is ACTIVE. addBehaviour() Add behaviours to queue, the parameter is a behaviour class. action() Define action of behaviour. doDelete() Shut down the agent.

59 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();

60

61

62

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

64

65 End

66 Introduction to Agent presenter: Syuan-Hao Li

67 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

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

69 Behaviour class WakerBehaviour class TickerBehaviour
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.

70

71 Implementation OneShotBehaviour CyclicBehaviour
Agent execute only once. CyclicBehaviour Agent execute by polling. import jade.core.behaviours.OneShotBehaviour import jade.core.behaviours.CyclicBehaviour

72

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

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

75 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

76 Agent Communication

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

78 Agent Communication Receiving Messages

79 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

80 Example Write two agent in JADE Platform: SenderAgent ReceiverAgent
OneShotBehaviour Send string to ReceiverAgent by using ACLMessage. ReceiverAgent CyclicBehaviour Receive and print the string from SenderAgent.

81 Sender

82 Receiver

83 Exmaple

84 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

85 Sniffer

86 Sniffer

87 Sniffer

88 Outline Behaviour Agent Communication Example Sniffer Agent Example 2

89 Example 2

90 Arguments

91 SenderAgent

92 SenderAgent

93 SenderAgent

94 HelloAgent

95 HelloAgent

96 MathAgent

97 MathAgent

98 Results SenderAgent HelloAgent MathAgent

99 Results

100 Sniffer Agent

101 Homework Game: Write two or three Agent (A,B+C or A,B,C)
Three In A Row (3X3) Five In A Row (9X9) Write two or three Agent (A,B+C or A,B,C) Agent A : User Input the position (X,Y) in chess board. Agent B : Chess board Store position of chess and judge who win. Agent C : AI

102 End


Download ppt "Introduction to JADE presenter: Syuan-Hao Li"

Similar presentations


Ads by Google