CLF::DFS Library
From Agent Factory
This library provides support for interacting with the FIPA Directory Facilitator Service which is deployed by default on all agent platforms. It can be used with any agent that is implemented using a language that is based on the Common Language Framework. All of the examples provided on this page are based on AF-AgentSpeak. Details of other libraries provided with the Common Language Framework can be found here.
This service is still experimental, and subject to change (particularly the sensing component)
Contents |
Installing the Library
To use the DF Library, you must add the following line to your AgentSpeak program:
module df -> com.agentfactory.clf.library.DFSLibrary;
All actions may then be accessed by using the prefix "df". This is because you associated the library with this identifier. If you change the module identifier, then any action call must be prefixed by the new identifier.
Actions
This module provides actions to allow the agent to access the functionality of the FIPA DF platform service.
| Action | Description |
|
.setup |
Initializes the library and binds the agent to the FIPA Directory Facilitator Service. #agent example
module df -> com.agentfactory.clf.library.DFSLibrary;
+initialized : true <-
df.setup;
The DFS Library is now initialised and ready to use. |
|
.register |
Create a profile on the service (the agent identifier will be published and visible to all agents on the local platform). The agent does not need to register to use the service, only to advertise on the service. #agent example
module df -> com.agentfactory.clf.library.DFSLibrary;
+initialized : true <-
df.setup;
df.register;
The agent is now registered with the DFS and able to advertise services. |
|
.deregister |
Remove the agents profile from the service (its identifier is no longer visible via the DFS service). #agent example
module df -> com.agentfactory.clf.library.DFSLibrary;
+initialized : true <-
df.setup;
df.register,
df.deregister;
The agent registers itself and then deregisters itself. |
|
.addService(?name, ?type, ?protocols, ?ontolgoies, ?languages, ?properties) |
Add a service to your profile (this service will be visible to all agents on the local platform). #agent example
module df -> com.agentfactory.clf.library.DFSLibrary;
+initialized : true <-
df.setup;
df.register,
df.addService(stockList, stock-listing, [fipa-request], [Stocks], [AFAPL], []);
Adds a service called "stockList" to the agents profile. In adding the service, the agent indicates that the type of service is a stock listing service, and this service is accessible using the "fipa-request" protocol. Additionally, the action indicates that the service uses the "Stocks" ontology and the content language should be "AFAPL" (i.e. the default logic format of Agent Factory). |
|
.removeService(?name) |
Removes the service description with the given name (if it exists). #agent example
module df -> com.agentfactory.clf.library.DFSLibrary;
+initialized : true <-
df.setup;
df.register,
df.addService(stockList, stock-listing, fipa-request, Stocks, AFAPL, []);
+finished : true <-
df.removeService(stockList);
Same as the .addService(...) example, but the agent later removes the service (when it believes that it is finished). |
Sensors
Sensors provide beliefs that the agent can use to make decisions about how best to act. The Core API comes with a number of default sensors that are listed below.
| Action | Generates | Description |
|
.serviceDescriptions |
dfsService(?agentID) |
The first belief relates to agent identifier of the agents from the local platform that are registered with the DF Service. The second belief relates to the services provided by the agent itself. |
Examples
To be completed...
