1 introduction to jade presenter: ji-yu li. 2 outline introduction foundation for intelligent...
TRANSCRIPT
![Page 1: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/1.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/2.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/3.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/4.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/5.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/6.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/7.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/8.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/9.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/10.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/11.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/12.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/13.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/14.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/15.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/16.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/17.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/18.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/19.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/20.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/21.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/22.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/23.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/24.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/25.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/26.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/27.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/28.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/29.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/30.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/31.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/32.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/33.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/34.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/35.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/36.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/37.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/38.jpg)
39
![Page 39: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/39.jpg)
40
![Page 40: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/40.jpg)
41
![Page 41: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/41.jpg)
42
![Page 42: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/42.jpg)
43
![Page 43: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/43.jpg)
44
![Page 44: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/44.jpg)
45
![Page 45: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/45.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/46.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/47.jpg)
48
![Page 48: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/48.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/49.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/50.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/51.jpg)
52
![Page 52: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/52.jpg)
53
![Page 53: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/53.jpg)
54
![Page 54: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/54.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/55.jpg)
56
![Page 56: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/56.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/57.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/58.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/59.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/60.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/61.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/62.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/63.jpg)
64
![Page 64: 1 Introduction to JADE presenter: Ji-Yu Li. 2 Outline Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/64.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/65.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/66.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/67.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/68.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/69.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/70.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/71.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/72.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/73.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/74.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/75.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/76.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/77.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/78.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/79.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/80.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/81.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/82.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/83.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/84.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/85.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/86.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/87.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/88.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/89.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/90.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/91.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/92.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/93.jpg)
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](https://reader030.vdocuments.mx/reader030/viewer/2022032607/56649ecb5503460f94bd9c16/html5/thumbnails/94.jpg)
95
End