Answered step by step
Verified Expert Solution
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
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
Each student will try to follow and solve the given questions.
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 addBehaviourBehaviour 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:
Oneshot 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 and "Seller"
Create a container, that includes another agent "Buyer
Create a OneshotBehaviour for Buyer in the setup method of the Class Buyer to display "I am Ready".
Create a TickerBehaviour for Buyer in the setup method of the Class Buyer The behavior is to display "I am Ready" every seconds for one minute.
Add another behavior CyclicBehaviour to the same agent. The behavior is to display the value of a counter starting from
Replace the previous behavior by a GenericBehavior for the same agent. The behavior will display all the values from and stops at the value
Add a WeakerBehavior to the same agent, that displays "I am awake" after
Add a ticker behavior to the agent Buyer Asking for a book "Multi agent systems"
Run all these above behaviors in parallel for the same agent.
Good Luck
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started