Introduction to JADE 簡嘉建.

Slides:



Advertisements
Similar presentations
黄国文 中山大学 通用型英语人才培养中的 语言学教学 黄国文 中山大学
Advertisements

-CHINESE TIME (中文时间): Free Response idea: 你周末做了什么?
中职英语课程改革中 如何实践“以就业为导向,服务为宗旨”的办学理念
Java Programming Hygiene - for DIDC
全球科研项目整合检索系统 海研网
无处不在的计算 天津大学计算机科学与技术学院 冯志勇教授.
程設一.
Google App Engine Google 應用服務引擎.
MovieBot: Booking Tickets Easily
Unit title: 爱好 Hobbies Area of interaction focus Significant concepts
Lab312.
Ericsson Solutions for Intelligent Transport Systems and Solutions
Microsoft .NET 第4組 十月15, 2002 B 陳東傑 B 蔣佳勳
形式语言与网络 计算环境构建 1.
Symbian OS介绍 概述 第一部分.
軟體原型 (Software Prototyping)
(C) Active Network CO., Ltd
Unit title: 嗨!Hi! Introducing yourself in Chinese
The Research of Applying GuideLine Interchange Format (GLIF) of Protégé Application 報告人:博三 陳正怡 指導教授 李友專 博士 2018年11月20日 醫學資訊報告.
从UNIX到Windows的 电信软件移植实践
Knowledge Engineering & Artificial Intelligence Lab (知識工程與人工智慧)
Chap 3 資料庫模型與處理架構.
Michael Alexander Kirkwood Halliday (often M. A. K
Ch13 集合與泛型 物件導向程式設計(2).
單元3:軟體設計 3-2 順序圖(Sequence Diagrams)
HLA - Time Management 陳昱豪.
ICT RTOS Research Group 胡伟平,王剑
文字探勘與知識工程 Text Mining & Knowledge Engineering
China Standardization activities of ITS
第5章 方案工程(Solutions Engineering)
Historical background: Descartes and Locke
第4章 物件導向分析與設計簡介 4-1 物件導向的軟體系統開發 4-2 物件導向分析與設計 4-3 UML的物件導向分析與設計
SAP 架構及基本操作 SAP前端軟體安裝與登入 Logical View of the SAP System SAP登入 IDES
邏輯設計 Logic Design 顧叔財, Room 9703, (037)381864,
第三章 语言测试的目标构念 湖南师范大学外国语学院 邓 杰 教授.
校園網路架構介紹與資源利用 主講人:趙志宏 圖書資訊館網路通訊組.
第4章(1) 空间数据库 —数据库理论基础 北京建筑工程学院 王文宇.
第六章 DAI与MAS 第一节分布式人工智能(DAI) 一、基本概念 研究在逻辑上或物理上分散的智能系统如何并行地、相互协作地实现问题求解。
Chapter 3 Nationality Objectives:
Advanced Basic Key Terms Dependency Actor Generation association
服務於中國研究的網絡基礎設施 A Cyberinfrastructure for Historical China Studies
第三章 语言测试的目标构念 湖南师范大学外国语学院 邓 杰 教授.
Study for Specification of EPG EPG规范研究
Abstract Data Types 抽象数据类型 Institute of Computer Software 2019/2/24
Chapter 5 Recursion.
資料結構 Data Structures Fall 2006, 95學年第一學期 Instructor : 陳宗正.
SAP R/3架構及前端軟體安裝 Logical View of the R/3 System SAP Frontend 6.2安裝
Version Control System Based DSNs
成品检查报告 Inspection Report
Real-Time System Software Group Lab 408 Wireless Networking and Embedded Systems Laboratory Virtualization, Parallelization, Service 實驗室主要是以系統軟體設計為主,
SOA模型设计 杨子 2009/09/30.
Cisco Troubleshooting and Maintaining Cisco IP Networks (TSHOOT)
從 ER 到 Logical Schema ──兼談Schema Integration
Inheritance -II.
Outline Overview of this paper Motivation and Initialization
Chapter 10 Mobile IP TCP/IP Protocol Suite
Mobile Agent Communication
SAP 架構及基本操作 SAP前端軟體安裝與登入 Logical View of the SAP System SAP登入 IDES
IEEM 5352 Enterprise Integration
第8章 Agent系统 8.1 Agent的概念 8.2 Agent的结构 8.3 Agent实例─Web Agent
钱炘祺 一种面向实体浏览中属性融合的人机交互的设计与实现 Designing Human-Computer Interaction of Property Consolidation for Entity Browsing 钱炘祺
第8章 Agent系统 8.1 Agent的概念 8.2 Agent的结构 8.3 Agent实例─Web Agent
Advanced Basic Key Terms Dependency Generalization Actor Stereotype
护士与病人.
Operating System Software School of SCU
SAP 架構及前端軟體安裝 Logical View of the SAP System SAP Frontend 7.1安裝 SAP登入
Introduction to Computer Security and Cryptography
LIU Lei Shanghai Center for Bioinformation Technology 03/05/2013
本教學投影片係屬教科書著作之延伸,亦受著作權 法之保護。
Windows Workflow Foundation CON 230
Presentation transcript:

Introduction to JADE 簡嘉建

Outline DEMO Agent Standards JADE Term Project進度報告 DEMO(again) Agent platform Programming Term Project進度報告 DEMO(again)

Agent Standards– FIPA FIPA (Foundation for Intelligent Physical Agents) 是一個國際組織, 其主要的任務在於促進智慧型代理人技術。 FIPA組織會員是開放給任何個人, 公司與政府單位或國際組織。 FIPA是一個非營利性的組織在瑞士日內瓦註冊。 FIPA2000參與的公司包括SUN、IBM、Fujitsu、HP….。 www.fipa.org

FIPA Standards FIPA是一個國際性的非營利性組織,其目的在為一致性的代理人技術訂定規格。 FIPA並不是為單一領域的技術做促銷,而是希望對不同領域提供一互動的標準,來讓開發人員能整合不同的系統。FIPA只針對系統元件外部的行為作一規範,至於實作的細節和系統內部的架構則留給平台的開發者。 FIPA-compliant Agent Platforms: JADE、 FIPA-OS(NORTEL)、ASL、Bee-gent(Toshiba)、Grasshopper-2 ….

FIPA Standards Online FIPA 標準目前線上可以閱讀的文件包括: 1) 代理人管理 (Agent management) 2) 發展者的指引 (developer guide) 3) 人機互動 (human-machine interaction) 4) 本體語言 (ontology) 與 5) 安全管理 (security management)

Mobile Agent Standards – MASIF MAF (Mobile Agent Facility)的 MASIF提議自1988年起由 OMG (Object Management Group) 開始研究。 MASIF 主要著眼於 1) 代理人管理: (啟始, 終止, 暫停, 回復) 2) 代理人的轉移 3) 代理人與代理人系統的命名 The MASIF specification is largely based on the IBM Aglets mobile agent system design.

FIPA vs. OMG FIPA is dominated by computer and telecommunications companies and is focus primarily on agent-level issues. (BDI: belief-desire-intention) expecting agent to have mental states, beliefs about other agents and the state of the world, and desires and plans for take actions to change the state of the world. OMG is the standards body that created the CORBA distributed object protocol and tends to focus on object-level interoperability and management.

JADE (Java Agent DEvelopment Framework) 由CSLET S.p.A in Torino, Italy所開發。 一符合FIPA標準的多代理人系統(multi-agent systems)開發架構。 JADE: http://sharon.cselt.it/projects/jade

Two Main Products in JADE 符合FIPA標準的代理人平台(參照下圖) JADE是一個符合FIPA的執行時期多代理人系統,可以讓代理人在上面活動並使用它所提供的特色,如訊息傳遞、代理人生命週期的管理。 開發Java代理人的程式套件 另一方面,JADE是一個Java架構,提供程式開發者來發展一符合FIPA的代理人應用程式。

Agent Platform Reference Model (FIPA )

AMS (Agent Management System) AMS本身是一個代理人,它擁有整個代理人平台存取的管理權,並負責代理人平台內所有代理人的認證和登錄。一個理人平台只能有一個AMS。 AMS提供white-page和life-cycle服務,前者負責AID(agent identifiers)的目錄,每個agent一初始必須要跟AMS登錄以取得一個有效的AID;後者維護代理人的各個狀態(參照下圖)。

Agent Life Cycle

DF (Directory Facilitator) DF本身是一個代理人,提供yellow-page服務,每個代理人都可向DF登錄自己所提供的服務,而其他的代理人可以查詢平台內代理人所提供的服務有哪些是自己需要的。

ACC (Agent Communication Channel) 當JADE agent和non-JADE agent溝通時,ACC負責雙向的交談。 FIPA要求ACC支援IIOP(Internet InterOrb Interoperability Protocol)使得只要遵守FIPA的代理人平台能夠互相運作。

JADE Platform 單一的JADE代理人平台可以跨數個主機系統(host systems),但每一主機需要Java Virtual Machine(JVM) 。

JADE Platform (cont’d)

Features of JADE FIPA-compliant Agent Platform 以Java程式撰寫 分散式的代理人平台 Other FIPA-compliant Agent Platform, FIPA-OS(NORTEL)、ASL、Bee-gent(Toshiba)、Grasshopper-2 …. 以Java程式撰寫 分散式的代理人平台 圖形化的平台管理介面 Remote Management Agent(RMA),也是一個Agent

Features of JADE (cont’d) 除錯工具Dummy Agent、Sniffer、IntrospectorAgent Mobility (Java Serialization, Reflection API) 開放的原始碼,遵從LGPL(Lesser General Public License) 可與JESS(Java Expert System Shell, a Java version of CLIPS)整合,提供代理人reasoning的功能

JADE Agent程式設計最重要的三件事 Agent Content Language : Ontology Agent communication languages Agent Behaviour

JADE Agent程式設計最重要的三件事 Agent Content Language : Ontology Agent communication languages Agent Behaviour

Agent Language Agent implementation languages C++ Java Agent communication languages KQML (Knowledge Query Manipulation Language) FIPA-ACL Agent Content Language : Ontology KIF (knowledge interchange format) WORDNET

MAS(Multi-Agent System) 發展一個多代理人系統最重要的任務就是異質軟體的整合,亦即獨立開發的代理人彼此間可以成功的互動。 以多代理人為基礎的技術若缺乏一個相互溝通的標準,它將無法運作。 Agent content language : Ontology Domain 的vocabulary 類似XML Schema Agent communication languages

XML & XML Schema <CD> <TITLE>Carolyn Debern</TITLE> <PRICE>480</PRICE> <TRACKS> <TRACK>Every breath you take</TRACK> <TRACK>Autumn Leaves</TRACK> <TRACK>Tore Amour</TRACK> </TRACKS> </CD>

Agent Content Language:Ontology There is a person whose name is Giovanni and who is 33 years old in an ACL content expression could be represented as the string (Person :name Giovanni :age 33) 舊的content expression(用string表示) Not suitable to handle the information (require each time to parse the string) Perform a number of semantic checks 新的content expression (用object表示) Conveniently be represented inside an agent as Java objects.

Internal Mechanism

CD.java public class CD extends Item{ // title private String title; public void setTitle(String s) { this.title=s; } public String getTitle() { return this.title; } // price private String price; public void setPrice(String p) { this.price=p; } public String getPrice() { return this.price; } // tracks private List tracks = new ArrayList(); public void addTracks(Track o) { tracks.add(o); } public boolean removeTracks(Track o) {return tracks.remove(o); } public List getTracks() {return tracks; } public void setTracks(List l) {tracks = l; }}

MusicShopOntology.java cdSchema.add(CD_TITLE,(TermSchema)getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY); cdSchema.add(PRICE,(TermSchema)getSchema(BasicOntology.STRING), ObjectSchema.OPTIONAL); cdSchema.add(CD_TRACKS, trackSchema, 1,20);

CD in ACLMessage (CD :TITLE \"Carolyn Debern\" :PRICE \"480\" :TRACKS (sequence (Track :NAME \"Every breath you take\") (Track :NAME \"Autumn Leaves\") (Track :NAME \"Tore Amour\")) )

Codec SL language is a human-readable string-encoded LEAP language is a non-human-readable byte-encoded XMLCodec

SL0Codec Vs. SLCodec jade.lang.sl.SL0Codec(JADE2.0) jade.content.lang.sl.SLCodec(JADE2.5) Elements that can appear within a valid sentence Concepts : indicate entities that“exist”in the world. Ex. (Person :name John) Predicates : say something about the status of the world and can be true or false. Ex. (Works-for (Person :name John) (Company :name TILAB)) Agent action : indicate actions that can be performed by some agents. Ex. (Sell (Book :title “The Lord of the rings”) (Person :name John))

JADE Agent程式設計最重要的三件事 Agent Content Language : Ontology Agent communication languages Agent Behaviour

Agent Communication Language: ACL-KQML 由KQML(Knowledge Query and Manipulation Language)衍生而來 It describes the “speech act” of the message using a set of performatives( message types ), that express an attitude regarding the content of the exchange. The content language of the message is not part of KQML, but can be specified by KQML performatives.

An KQML Example (QUERY-IF :content “(Works-for (Person :name John) (Company :name TILAB))” :sender RequesterAgent :receiver EngagerAgent :language FIPA-SL :ontology employment-ontology)

An KQML Example(cont’d) (INFORM :content “(Works-for (Person :name John) (Company :name TILAB))” :sender EngagerAgent :receiver RequesterAgent :language FIPA-SL :ontology employment-ontology)

Categories of Performatives Basic Query: Evaluate, ask-if, ask-about, ask-one, ask-all Multi-response Query: stream-about, stream-all, eos Response: reply, sorry Generic information: tell, achieve, cancel, untell, unachieve

JADE Agent程式設計最重要的三件事 Agent Content Language : Ontology Agent communication languages Agent Behaviour

Agent Behaviour An agent must be able to carry out several concurrent tasks in response to different external events. All agent’s tasks are modeled and can be implemented as Behaviour objects. 基本的behaviour Behaviour:atomic behaviour. OneShotBehaviour:must be executed only once and cannot be blocked. CyclicBehaviour:must be executed forever. CompositeBehaviour:are made up by composing a number of other children behaviours.

Agent Behaviour (cont’d) FIPA defined a set of interaction protocols Which are tightly scripted sequences of speech acts, for asking questions, sharing knowledge, and participating in various types of auctions and negotiation. (ex. contract net negotiation protocol、English and Dutch auctions….) For defining dialogues between agents.(不同於echo,而是更進一步定義訊息如何傳送,如何回覆) JADE以behaviour的方式來implement這些interaction protocols.

Contract Net Protocol Tasks allocation(應用:Vehicle Routing Problem)

Contract-Net Protocol Support in JADE cfp propose refuse Not-understd accept reject cancel inform failure Initiator Responder Initiator:createCfpContent Responder:handleCfpMessage Initiator: handleProposeMessages handleOtherMessages handleAcceptProposalMessage handleRejectProposalMessage

測試情境 在這個多代理人系統內,存在有兩個Seller Agents和一個Buyer Agent。 Seller Agents販賣音樂CD,而Buyer Agent則輔助使用者購買CD。當使用者在介面上輸入某首歌曲的名稱,Buyer Agent會broadcast一個CFP (Call for Proposal)訊息給系統內的Seller Agents,Seller Agents在收到這個CFP後,會查詢庫存資料庫來判斷這首歌出現在哪幾片CD內,這片CD是否尚有庫存。

開發環境 Java 2 SDK, Standard Edition, version 1.3.1 (JDK 1.3.1) JADE 2.5 JESS version 6.0

何謂合適? Seller Agent評估這個CFP訊息,並提出合適的Proposal (何謂合適?). Buyer Agent評估這些Proposals,選出合適的Proposals (何謂合適?),並採取相對應的動作. 如果Agent只是做data collection的工作,其實跟直接搜尋database沒什麼兩樣。我們希望它能表現出智慧!!原本由人來做決策,改成由Agent.

Seller Agent 目前,Seller Agent的 knowledge base只有一個rule (i.e querydb),這個rule會查詢庫存資料庫有無產品的存貨和相關資訊,這個rule在下一階段仍會繼續使用,因為畢竟有東西可以賣是先決的條件。 下一步 (Knowledge Engineering) 例如:Buyer Agent在購買衣服時會順便附上使用者的資料,如身高、體重、職業等,而Seller Agent可以以它的領域知識,例如如果Buyer的身高、體重成某種比例,那麼Buyer是一個胖子。如果Buyer是一個胖子,就不能推薦橫條紋的衣服。

Seller Agent’s Rules 當 Seller Agent 接收到CFP訊息時,會新增一個Fact : (defrule querydb ;querydb rule ?m <- (TrackName ?n) => (queryCDbyTrack ?m) ;’queryCDbyTrack’ is a user-defined function (retract ?m)) 當 Seller Agent 接收到CFP訊息時,會新增一個Fact : (assert (TrackName Every_breath_you_take))。

Buyer Agent 我們並不希望Buyer Agent在作購買的決策上有絕對的自主權,而是希望Buyer Agent站在決策輔助者的角色上,提供使用者足夠的資訊來決定是否採取購買的行動。 Data Fusion Buyer Agent不只是蒐集Data,而是更進一步做Data的整理,來產生有用的information,這些information是使用者做最終決策的基礎。在系統實作上,採用針對proposal的各組成因子(如,價格),提出comments。

Buyer Agent’s Rules (defrule match-input ;match-input rule ?m <- (input ?c&:(external-addressp ?c)) => (assert (cdprice (call ?c getPrice))) (retract ?m)) ----------------------------------------------------- (defrule compare-price ;compare-price rule ?m <- (cdprice ?x) (test (> ?x 500)) (assert (comment (fetch CD))) (assert (price2high (str-cat ?x "(***too expensive)"))) (defrule price-comments ;price-comments rule ?m <- (comment ?c&:(external-addressp ?c)) ?n <- (price2high ?p) => (call ?c setPrice ?p) (retract ?m) (retract ?n))

References FIPA:http://www.fipa.org JADE: http://sharon.cselt.it/projects/jade JESS: http://herzberg.ca.sandia.gov/jess/ Joseph P. Bigus, Jennifer Bigus, “Constructing Intelligent Agents Using Java: Professional Developer's Guide, 2/e”, JOHN WILEY & SONS,INC Danny B. Lance, Mitsuru Oshima, “Programming And Deploying Java Mobile Agents With Aglets”, ADDISON-WESLEY