Workshop 9 in AOM & MAS Prof Kuldar Taveter, Tallinn University of Technology.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

Design By Contract Using JMSAssert.
13/04/2015Client-server Programming1 Block 6: Threads 1 Jin Sa.
INHERITANCE BASICS Reusability is achieved by INHERITANCE
METHOD OVERRIDING Sub class can override the methods defined by the super class. Overridden Methods in the sub classes should have same name, same signature.
SELBO Agent Ivan Minov University of Plovdiv “Paisii Hilendarski“
Overview UML Extensions for Agents UML UML Agent UML (AUML) Agent UML (AUML) Agent Interaction Protocols Agent Interaction Protocols Richer Role Specification.
PACKAGES. PACKAGES IN JAVA A package is a collection of related classes and interfaces in Java Packages help in logical grouping of classes and interfaces.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Classes and Objects: Recap A typical Java program creates many objects which interact with one another by sending messages. Through the objects interactions,
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
CS220 Software Development Lecture: Multi-threading A. O’Riordan, 2009.
Introduction to JADE presenter: Syuan-Hao Li
Jade (3 h) Dott. Daniela Briola. Jade Agent JADE Agents are defined as subclasses of the predefined class Agent Their initial code (if any) must be placed.
Java Overview February 4, /4/2004 Assignments Due – Homework 1 Due – Reading and Warmup questions Project 1 – Basic Networking.
Classes and Objects  A typical Java program creates many objects which interact with one another by sending messages. Through the objects interactions,
JADE Java Agent Development Framework An Overview.
Programming Agents with JADE for Multi-Agent Systems
Multi-Agent System for Online Auctions Jose Manuel Valladares Pernas CIS Master Project - Fall 2004 Advisor: Dr. Haiping Xu.
2° cycle degree programme (lm) in Telecommunications Engineering Principles Models and Applications for Distributed Systems Prof. Maurelio Boari
JADE: installation and “Hello World” application Fabiano Dalpiaz Agent-Oriented Software Engineering (AOSE)
Java Agent Development Environment (JADE) Jade is a platform for running agents; it supports: –An asynchronous agent programming model –Communication between.
A Bridge to Your First Computer Science Course Prof. H.E. Dunsmore Concurrent Programming Threads Synchronization.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Concurrency in Android with.
1 Introduction of Java Agent Development Environment (JADE) Presented by Po-Cheng Huang.
IDK5151 kohtumine kaugõppijatega
Austin Java Users Group developerWorks article – µActor Library BARRY FEIGENBAUM, PH. D. 02/26/13.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
The Java Programming Language
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 2.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
POS 406 Java Technology And Beginning Java Code
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
IBM TSpaces Lab 1 Introduction. Summary TSpaces Overview Basic Definitions Basic primitive operations Reading/writing tuples in tuplespace HelloWorld.
CSC 205 – Java Programming II Applet. Types of Java Programs Applets Applications Console applications Graphics applications Applications are stand-alone.
Tutorial 1 Running JADE Under Eclipse Dr. Fuhua Lin School of Computing and Information Systems Athabasca University, Alberta, Canada Oct. 27, 2009.
Chapter 4: A Paradigm Program structure Connecting to the Java world Types Access modifiers Lifetime modifiers.
Concurrent Programming and Threads Threads Blocking a User Interface.
JADE: agents insights Fabiano Dalpiaz Agent-Oriented Software Engineering (AOSE)
Sensor Web – TITAN Research 4/24/2017
Remote Procedure Calls CS587x Lecture Department of Computer Science Iowa State University.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Introduction to Java Chapter 7 - Classes & Object-oriented Programming1 Chapter 7 Classes and Object-Oriented Programming.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
Concurrent Computing CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
CSI 3125, Preliminaries, page 1 Compiling the Program.
Tutorial 2 Agent Actions Specification --- Behavior Dr. Fuhua Lin School of Computing and Information Systems Athabasca University, Alberta, Canada Oct.
Getting Started with the Open Services Gateway Initiative (OSGi) CNT 5517 Dr. Sumi Helal, Ph.D. Professor Computer & Information Science & Engineering.
(1) Introduction to Java GUIs Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
EEL 5937 The Bond Agent System (4) EEL 5937 Multi Agent Systems Lecture 18, March. 6, 2003 Lotzi Bölöni.
EEL 5937 The Bond Agent System (3) EEL 5937 Multi Agent Systems Lecture 17, March. 4, 2003 Lotzi Bölöni.
Chapter11 Concurrent. 集美大学 计算机工程学院 Java 程序设计 年 第二版 Concurrent ●Computer users take it for granted that their systems can do more than one thing.
JADE: installation and “Hello World” application
 2005 Pearson Education, Inc. All rights reserved. 1 Introduction to Classes and Objects.
IDK kohtumine kaugõppijatega Prof Kuldar Taveter, Tallinna Tehnikaülikool.
OOP Basics Classes & Methods (c) IDMS/SQL News
Creating Java Applications (Software Development Life Cycle) 1. specify the problem requirements - clarify 2. analyze the problem - Input? Processes? Output.
Throw, Throws & Try-Catch Statements Explanations and Pictures from: Reference:
JADE Java Agent Development Environment Yunus Emre ÇAKMAZ Ahmet Cahit YAŞA 1.
Real-Time Systems Laboratory Seolyoung, Jeong JADE (Java Agent DEvelopment framework )
M OBILE A GENTS & JADE Shaquille Wilkins Zak Lowman.
Multi-Agent System for Online Auctions Jose Manuel Valladares Pernas CIS Master Project - Fall 2004 Advisor: Dr. Haiping Xu.
Developing Mobile Agent Systems
Msury Mahunnah, Tallinn University of Technology
Remote Method Invocation
Chapter 2 - Introduction to Java Applications
Android Topics UI Thread and Limited processing resources
Android Topics Asynchronous Callsbacks
Constructors, GUI’s(Using Swing) and ActionListner
Presentation transcript:

Workshop 9 in AOM & MAS Prof Kuldar Taveter, Tallinn University of Technology

Have you decided the team and topic of your miniproject? The teams and topics of your miniprojects should have been decided by 24 March If you have not done so yet, please mail the names of your team members and the title of your topic to Prof Taveter

Greeting Goal Model

Greeting Role Model Greetee: To be greeted by greeter Responsibilities: To be noticed by greeter; To perceive greeting Constraints: None Greeter: To greet another agent coming within environment Responsibilities: To notice greetee; To formulate greeting; To articulate greeting Constraints: Articulation within 10 seconds of noticing; Formulation must be appropriate to greetee + environment Evaluator: To evaluate the greeting Responsibilities: To observe greeting; To evaluate greeting; To publish report Constraints: timeliness

Combined behaviour and interaction model for greeting

Exercises Create two JADE agents that greet each other. Follow the Greeting Goal Model and Greeting Role Model. Continue with the design for your miniproject either manually or using a suitable tool.

JADE (Java Agent Development Environment) Distributed agent platform which can be split among several hosts Java Application Programmer’s Interface. Graphical User Interface to manage several agents from the same Remote Management Agent Library of FIPA interaction protocols, such as Contract Net Available at

JADE Agent Platform

Agent life cycle

Concurrent tasks An agent must be able to carry out several concurrent tasks in response to different external events Every JADE agent is composed of a single execution thread Concurrent tasks are modelled and can be implemented as instances of jade.core.behaviours.Behaviour

Agent thread

Hierarchy of behaviours

Defining JADE agents package DigitalPet; import jade.core.*; public class Tamagotchi extends Agent { // Put agent initializations here protected void setup() { // Adding behaviours addBehaviour(new MessageHandler (this)); … } // If needed, put agent clean-up operations here protected void takeDown() { System.out.println(“Tamagotchi “+getAID().getName()+” terminating.”); … }

Defining behaviours package DigitalPet; import jade.core.*; import jade.core.behaviours.*; import jade.lang.acl.*; public class MyOneShotBehaviour extends OneShotBehaviour { public void action() { // perform operation X } public class MyCyclicBehaviour extends CyclicBehaviour { public void action() { // perform operation Y }

Sending messages ACLMessage msg = new ACLMessage(ACLMessage.INFORM); msg.addReceiver(new AID(“tama1”, false); msg.setLanguage(“English”); msg.setOntology(“Weather-forecast-ontology”); msg.setContent(“Today it’s raining”); myAgent.send(msg); // Message carrying a request for offer ACLMessage cfp = new ACLMessage(ACLMessage.CFP); for (int i = 0; i < sellerAgents.lenght; ++i) { cfp.addReceiver(sellerAgents[i]); } cfp.setContent(targetBookTitle); myAgent.send(cfp);

Receiving messages public void action() { ACLMessage msg = myAgent.receive(); if (msg != null) { // Message received. Process it... } else { block(); }

Setting classpath Please include in the classpath the following library files: …\jade\lib\jade.jar …\jade\lib\jadeTools.jar …\jade\lib\http.jar …\jade\lib\iiop.jar Please include in the classpath the location(s) of your Java class files

Compiling and running JADE agents javac Tamagotchi.java Behaviours.java … java jade.Boot –gui -platform java jade.Boot –container tama1:DigitalPet.Tamagotchi

Please consult API!

Passing arguments to an agent public class BookBuyerAgent extends Agent { private String targetBookTitle; // The list of known seller agents private AID[] sellerAgents = {new AID(“seller1”, AID.ISLOCALNAME), new AID(“seller2”, AID.ISLOCALNAME)}; // Put agent initializations here protected void setup() { // Printout a welcome message System.out.println(“Hello! Buyer-agent“ +getAID().getName()+ ” is ready.”); // Get the title of the book to buy as a start-up argument Object[] args = getArguments(); if (args != null && args.length > 0) { targetBookTitle = (String) args[0]; System.out.println(“Trying to buy” + targetBookTitle); } else { // Make the agent terminate immediately System.out.println(“No book title specified“); doDelete(); } … }

Running an agent with arguments java jade.Boot –container buyer:BookBuyerAgent (The-Lord-of- the-rings)