Author: Giovanni Caire (TILab S.p.a)
This examples shows how to use the support for application specific ontologies provided by JADE.
A very simple ontology (the employment-ontology)including concepts related to the employment of people into companies is defined in the package examples.ontology.employment. The roles in this ontology are
WORKS-FOR – meaning that a person is working for a company
ENGAGE – meaning that a person is being engaged by a company
ENGAGEMENT-ERROR – meaning that an error occurred in performing the engage action
PERSON-TOO-OLD – meaning that a person cannot be engaged by a company because he is too old.
The employment subdirectory contains one class for each ontological role plus the static class EmploymentOntology that creates an ontology
object and adds to it all the roles described above.
The employment-ontology is used by two agents:
|The RequesterAgent gets the details of people to engage from the user and asks the EngagerAgent to actually engage them. It has a single cyclic complex behaviour in which
– The details of a person to engage are got from the user. This is done in the onStart() method.
– A query is sent to the EngagerAgent to check that the indicated person is not already working for the indicated company. This is done by following the FIPA-Query protocol and it is implemented through a SimpleAchieveREInitiator that is added as a sub-behaviour of the main agent behaviour.
– According to the result of the query, A request is sent to the EngagerAgent to actually perform the engagement. This is done following the FIPA-Request protocol and is implemented through another SimpleAchieveREInitiator that is added as a sub-behaviour.
– In the onEnd() method the main agent behaviour is reset so that it is performed cyclicallyIn the agent setup, besides the addition of the main behaviour, the name of the EngagerAgent and the detail of the company where to engage people are requested to the user.
|Jade classes used:
|The EngagerAgent actually performs the engagement. The Agent has two behaviours:
– A SimpleAchieveREResponder to handle queries about people working for a company following a FIPA-Query protocol.
– Another SimpleAchieveREResponder to handle engagement requests following a FIPA-Request protocol.
Both behaviours are cyclic.
The company whose engagement are handled by the EngagerAgent is fixed:
Via Reiss Romoli 274
|Jade classes used: