Agent Platform Script
From Agent Factory
Contents |
Editorial History
07/11/2008: Version 1 - Initial Version of Page
Introduction
The Agent Platform Script (APS) file is the complement of the Platform Configuration File (CFG), which is used to define the configuration of the actual agent platform. Specifically, the APS file is used to define the initial community of agents that are to be deployed when the platform is started up. Broadly speaking, this community can consist of two basic types of agent:
- System Agents: These agents provide infrastructure services for the application and are guaranteed to have been created and initialised before any of the application agents are started. The most commonly used examples of system agents are the FIPA specified AMS and DF agents. Other kinds of agents may include Port Authority Agents (i.e. an agent that mediates migration of agents onto the platform), Framework Manager Agents (i.e. an agent that mediates access to a shared framework resource, such as a component framework or an artifact-based framework such as CARTAGO).
- Application Agents: These are the agents that implement the associated agents (i.e. this is the core of your implemented agent system).
In addition to specifying what agent should exist, the APS file also provides support for passing initialization information to those agents (e.g. for an AFAPL2 agent, this may take the form of initial beliefs or commitments, while for a Reactive Message Agent, this may take the form of initial data for the agents internal memory.
Finally, the APS file also allows you to decide whether an agent is to be in a suspended or active state on start up.
File Format
The APS file contains four basic statements:
- SYSTEMAGENT <name> <design> [platformSpecific]: Creates a system agent of type <design> with name <name>. If the platformSpecific flag is present, then the name is post-fixed with the platform name (e.g. <name>@<platform-name>).
- CREATE_AGENT <name> <design> [platformSpecific]: Creates an application agent of type <design> with name <name>. Again, the platformSpecific flag can be used to generate unique names.
- INIITALISE <name> <data>: Passes the <data> to the initialisation method of the agent with name <name>. The format of <data> is dependent on the specific type of agent that is being initialised.
- START_AGENT <name>: Sets the state of the agent with name <name> to active (i.e. it will start to execute immediately). Application agents are only started once every System Agent is successfully created and initialised.
Example
To illustrate what an APS file looks like, the example below shows a simple example application in which two Chatter agents, "Rem" and "Bob" are created. Rem is given initial data that will allow it to contact Bob and start the chatter behavour (this behaviour involves one agent sending a "chat" inform message to the other, which then responds by sending a "chat" inform message back to the first agent, causing a cyclical behaviour to ensue).
SYSTEMAGENT ams fipa/AMS.java platformSpecific
CREATE_AGENT Rem examples/chatter/Chatter.agent
CREATE_AGENT Bob examples/chatter/Chatter.agent
INITIALISE Rem BELIEF(wantToChatter(Bob, addresses("http://localhost:4444/acc")))
START_AGENT Rem
START_AGENT Bob
The first line specifies that the Reactive Message Agent based implementation of the FIPA AMS agent should be used. The second and third lines specify that two agents, "Rem" and "Bob" should be created. Both agents are instances of the example/chatter/Chatter.agent type. This itself is an AFAPL2 target file. The fourth line passes initialisation data to "Rem" in the form of a belief about the address of "Bob". Finally, the fifth and sixth lines cause "Rem" and "Bob" to start running immediately.
