Question: 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
 Lab 02 Programming with JADE Agent behavior Objective The objective of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!