Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 0 2 Programming with JADE Agent behavior Objective The objective of this lab is to implement the behavior of JADE agents. Current Lab Learning

Lab 02
Programming with JADE
Agent behavior
Objective
The objective of this lab is to implement the behavior of JADE agents.
Current Lab Learning Outcomes (LLO)
By completion of the lab, the students should be able to:
Create and Deploy simple types of agents.
Design and implement the behavior of agents
Lab Requirements
Students allowed using their lecture notes in the lab in order to solve the exercises.
Lab Assessment
1- Each student will try to follow and solve the given questions.
2- Students may discuss between them and the instructor, the best answer will be shared on board.
Lab Description
In this part the instructor will introduce how to define and design tasks for agents and how to execute them. A behaviour of an agent is an instance of the class jade.core.Behaviours. to execute a task by an agent, we should use the method addBehaviour(Behaviour b) of the Class jade.core.Agent.
Each Behaviour involves two methods:
action(): designs the instructions to be executed by the behaviour.
done():to express whether the behaviour is done or not.
Three types of behaviours for JADE
Simple behaviours:
One-shot Behaviour: is an instance of the class jade.core.behaviours.OneShotBehaviour. Used to execute the behaviour one time and terminate. This class implements the method done(), that returns true.
Cyclic Behaviour: is an instance of the class jade.core.behaviours.CyclicBehaviour. Used to execute the behaviour repetitively. The done() method returns always false.
Generic Behaviour: is an instance of the class jade.core.behaviours.Behaviour. Used when the programmer needs to repeat some tasks for some time, so the method done() needs to be implemented by the programmer.
Planned behaviours:
WeakerBehaviour: is implemented to execute onWake() after some amount of time (expressed in milliseconds) given as argument to the constructor. The behaviour stopes just after executing onWake().
TickerBehaviour: used to execute a task periodically using onTick() method, the amount of time is given as argument.
Create a main container, that includes two agents "Buyer 1" and "Seller"
Create a container, that includes another agent "Buyer 2"
Create a One-shotBehaviour for Buyer1 in the setup method of the Class Buyer 1 to display "I am Ready".
Create a TickerBehaviour for Buyer1 in the setup method of the Class Buyer 1. The behavior is to display "I am Ready" every 10 seconds for one minute.
Add another behavior CyclicBehaviour to the same agent. The behavior is to display the value of a counter starting from 10.
Replace the previous behavior by a GenericBehavior for the same agent. The behavior will display all the values from 10 and stops at the value 999.
Add a WeakerBehavior to the same agent, that displays "I am awake" after 5mn.
Add a ticker behavior to the agent Buyer 2, Asking for a book "Multi agent systems"
Run all these above behaviors in parallel for the same agent.
Good Luck
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2021 Workshops Biokdd Iwcfs Mlkgraphs Al Cares Protime Alsys 2021 Virtual Event September 27 30 2021 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Anna Fensel ,Jorge Martinez-Gil ,Lukas Fischer

1st Edition

3030871002, 978-3030871000

More Books

Students also viewed these Databases questions

Question

Does it exceed two pages in length?

Answered: 1 week ago

Question

Does it avoid typos and grammatical errors?

Answered: 1 week ago